patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH] raw/ifpga: fix logically dead code
@ 2019-05-17 11:25 Zhang, Tianfei
  2019-05-17  4:43 ` Xu, Rosen
  0 siblings, 1 reply; 3+ messages in thread
From: Zhang, Tianfei @ 2019-05-17 11:25 UTC (permalink / raw)
  To: rosen.xu; +Cc: andy.pei, Zhang, Tianfei, stable, Zhang

add temporary variable in max10_reg_write().

Coverity issue: 337927
Cc: stable@dpdk.org

Signed-off-by: Zhang, Tianfei <tianfei.zhang@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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-05-17  5:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-17 11:25 [dpdk-stable] [PATCH] raw/ifpga: fix logically dead code Zhang, Tianfei
2019-05-17  4:43 ` Xu, Rosen
2019-05-17  5:49   ` Zhang, Tianfei

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).