[dpdk-dev] [PATCH 44/53] net/sfc/base: fix warnings from VS2015 C compiler (C4244)

Andrew Rybchenko arybchenko at solarflare.com
Thu Nov 16 09:04:32 CET 2017


From: Andrew Lee <alee at solarflare.com>

Fix level 4 warning
"C4244: '+=': conversion from 'unsigned int' to 'uint16_t', possible loss
of data"; no functional changes.

Fixes: 946ba3b6941a ("net/sfc/base: import VPD support")
Cc: stable at dpdk.org

Signed-off-by: Andrew Lee <alee at solarflare.com>
Signed-off-by: Andrew Rybchenko <arybchenko at solarflare.com>
---
 drivers/net/sfc/base/efx_vpd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/sfc/base/efx_vpd.c b/drivers/net/sfc/base/efx_vpd.c
index 1e47df2..956460f 100644
--- a/drivers/net/sfc/base/efx_vpd.c
+++ b/drivers/net/sfc/base/efx_vpd.c
@@ -928,7 +928,7 @@ efx_vpd_hunk_set(
 		}
 
 		/* Modify tag length (large resource type) */
-		taglen += (dest - source);
+		taglen += (uint16_t)(dest - source);
 		EFX_POPULATE_WORD_1(word, EFX_WORD_0, taglen);
 		data[offset - 2] = EFX_WORD_FIELD(word, EFX_BYTE_0);
 		data[offset - 1] = EFX_WORD_FIELD(word, EFX_BYTE_1);
-- 
2.7.4



More information about the dev mailing list