Skip to contentSkip to conversation

net/cpfl: fix build error for debian 32-bit

PATCH In review Bruce Richardson 2 participants 3 messages Jul 10, 2024 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/cpfl: fix build error for debian 32-bit

When building for debian 11 32-bit, errors were reported with cpfl driver[1]. The error is due to comparing signed and unsigned values:

../drivers/net/cpfl/cpfl_flow_parser.c:1699:29: error: comparison of
integer expressions of different signedness: 'long int' and 'uint32_t' {aka 'unsigned int'} [-Werror=sign-compare]

Fix the issue by using an explicitly cast for the return value from atol.

Fixes c10881d3ee74 ("net/cpfl: support flow prog action")

[1] https://build.opensuse.org/package/live_build_log/home:bluca:dpdk/dpdk/Debian_11/i586

---
 drivers/net/cpfl/cpfl_flow_parser.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/cpfl/cpfl_flow_parser.c +1 -1
index a8f0488f21..40569ddc6f 100644
@@ -1696,7 +1696,7 @@ cpfl_parse_check_prog_action(struct cpfl_flow_js_mr_key_action *key_act,
 	bool check_name;
 
 	check_name = key_act->prog.has_name ? strcmp(prog->name, key_act->prog.name) == 0
-					    : atol(prog->name) == key_act->prog.id;
+					    : (uint32_t)atol(prog->name) == key_act->prog.id;
 	if (!check_name) {
 		PMD_DRV_LOG(ERR, "Not support this prog type: %s.", prog->name);
 		return -EINVAL;
Signature · 1 line
2.43.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Bruce Richardson

When building for debian 11 32-bit, errors were reported with cpfl driver[1]. The error is due to comparing signed and unsigned values:

../drivers/net/cpfl/cpfl_flow_parser.c:1699:29: error: comparison of
integer expressions of different signedness: 'long int' and 'uint32_t' {aka 'unsigned int'} [-Werror=sign-compare]

Quoted 7 lines

Fix the issue by using an explicitly cast for the return value from atol.

Fixes c10881d3ee74 ("net/cpfl: support flow prog action")
Signature · 1 line
David Marchand
author Applied
#2 lore raw
Quoted 10 lines · David Marchand
Quoted 8 lines · Bruce Richardson

When building for debian 11 32-bit, errors were reported with cpfl driver[1]. The error is due to comparing signed and unsigned values:

../drivers/net/cpfl/cpfl_flow_parser.c:1699:29: error: comparison of
integer expressions of different signedness: 'long int' and 'uint32_t' {aka 'unsigned int'} [-Werror=sign-compare]

Quoted 9 lines
Quoted 7 lines

Fix the issue by using an explicitly cast for the return value from atol.

Fixes c10881d3ee74 ("net/cpfl: support flow prog action")

Applied to dpdk-next-net-intel

/Bruce