[dpdk-dev] [PATCH v1 2/2] raw/ifpga: fix logically dead code

Ye Xiaolong xiaolong.ye at intel.com
Tue Jun 4 09:26:46 CEST 2019


On 06/04, Zhang, Tianfei wrote:
>add temporary variable in max10_reg_write().
>
>Coverity issue: 337927
>Cc: stable at dpdk.org

Missing a Fixes line?

>
>Signed-off-by: Zhang, Tianfei <tianfei.zhang at intel.com>
>---
> drivers/raw/ifpga_rawdev/base/opae_intel_max10.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
>diff --git a/drivers/raw/ifpga_rawdev/base/opae_intel_max10.c b/drivers/raw/ifpga_rawdev/base/opae_intel_max10.c
>index f354ee4b6..3ff6575d7 100644
>--- a/drivers/raw/ifpga_rawdev/base/opae_intel_max10.c
>+++ b/drivers/raw/ifpga_rawdev/base/opae_intel_max10.c
>@@ -17,11 +17,13 @@ int max10_reg_read(unsigned int reg, unsigned int *val)
> 
> int max10_reg_write(unsigned int reg, unsigned int val)
> {
>+	unsigned int tmp = val;
>+
> 	if (!g_max10)
> 		return -ENODEV;
> 
> 	return spi_transaction_write(g_max10->spi_tran_dev,
>-			reg, 4, (unsigned char *)&val);
>+			reg, 4, (unsigned char *)&tmp);
> }
> 
> struct intel_max10_device *
>@@ -57,7 +59,7 @@ intel_max10_device_probe(struct altera_spi_device *spi,
> 
> 	/* set PKVL Polling manually in BBS */
> 	ret = max10_reg_write(PKVL_POLLING_CTRL, 0x3);
>-	if (ret) {
>+	if (ret != 0) {
> 		dev_err(dev, "%s set PKVL polling fail\n", __func__);
> 		goto spi_tran_fail;
> 	}
>-- 
>2.17.1
>


More information about the dev mailing list