Skip to contentSkip to conversation

net/i40e/base: fix invalid log format characters

PATCH Applied Bruce Richardson 2 participants 4 messages Oct 25, 2024 – Oct 28, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/i40e/base: fix invalid log format characters

With commit cb593a832630 ("net/i40e/base: reduce size of time variables"), the time_left value is 32-bits rather than 64-bits. However the printf-style format strings were never updated in the logs, so were left at PRIu64. Change them to PRIu32, fixing the build when additional format warnings were enabled.

Fixes cb593a832630 ("net/i40e/base: reduce size of time variables")
---
 drivers/net/i40e/base/i40e_nvm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/i40e/base/i40e_nvm.c +2 -2
index 185af67817..3e16a0d997 100644
@@ -79,7 +79,7 @@ enum i40e_status_code i40e_acquire_nvm(struct i40e_hw *hw,
 
 	if (ret_code)
 		i40e_debug(hw, I40E_DEBUG_NVM,
-			   "NVM acquire type %d failed time_left=%" PRIu64 " ret=%d aq_err=%d\n",
+			   "NVM acquire type %d failed time_left=%" PRIu32 " ret=%d aq_err=%d\n",
 			   access, time_left, ret_code, hw->aq.asq_last_status);
 
 	if (ret_code && time_left) {
@@ -101,7 +101,7 @@ enum i40e_status_code i40e_acquire_nvm(struct i40e_hw *hw,
 		if (ret_code != I40E_SUCCESS) {
 			hw->nvm.hw_semaphore_timeout = 0;
 			i40e_debug(hw, I40E_DEBUG_NVM,
-				   "NVM acquire timed out, wait %" PRIu64 " ms before trying again. status=%d aq_err=%d\n",
+				   "NVM acquire timed out, wait %" PRIu32 " ms before trying again. status=%d aq_err=%d\n",
 				   time_left, ret_code, hw->aq.asq_last_status);
 		}
 	}
Signature · 1 line
2.43.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Bruce Richardson

With commit cb593a832630 ("net/i40e/base: reduce size of time variables"), the time_left value is 32-bits rather than 64-bits. However the printf-style format strings were never updated in the logs, so were left at PRIu64. Change them to PRIu32, fixing the build when additional format warnings were enabled.

Fixes cb593a832630 ("net/i40e/base: reduce size of time variables")

I'll wait for the CI then apply it directly in main.

Btw, I tested this patch after removing following options:

$ git diff
(quoted diff) +0 -0

b/drivers/net/i40e/base/meson.build
index d94108629b..ffe264a934 100644

drivers/net/i40e/base/meson.build +0 -2
@@ -12,8 +12,6 @@ sources = [
 ]
 
 error_cflags = ['-Wno-sign-compare', '-Wno-unused-value',
-        '-Wno-format', '-Wno-format-security',
-        '-Wno-format-nonliteral',
         '-Wno-strict-aliasing', '-Wno-unused-but-set-variable',
         '-Wno-unused-parameter',
 ]

and it builds fine on my f39.

The -Wformat-security caught my eye especially, because net/i40e is the only driver silencing this warning while the whole DPDK tree is built with it.

Signature · 1 line
David Marchand
#2 lore raw
Quoted 35 lines · David Marchand
Quoted 10 lines · Bruce Richardson

With commit cb593a832630 ("net/i40e/base: reduce size of time variables"), the time_left value is 32-bits rather than 64-bits. However the printf-style format strings were never updated in the logs, so were left at PRIu64. Change them to PRIu32, fixing the build when additional format warnings were enabled.

Fixes cb593a832630 ("net/i40e/base: reduce size of time variables")

I'll wait for the CI then apply it directly in main.

Btw, I tested this patch after removing following options:

$ git diff
drivers/net/i40e/base/meson.build +0 -2
index d94108629b..ffe264a934 100644
@@ -12,8 +12,6 @@ sources = [
 ]
 
 error_cflags = ['-Wno-sign-compare', '-Wno-unused-value',
-        '-Wno-format', '-Wno-format-security',
-        '-Wno-format-nonliteral',
         '-Wno-strict-aliasing', '-Wno-unused-but-set-variable',
         '-Wno-unused-parameter',
 ]
Quoted 2 lines

and it builds fine on my f39.

And also on Ubuntu in my tests. I'll push a patch removing those error flags when this patch is merged (and next-net-intel rebased).

/Bruce

#3 lore raw
In reply to Bruce Richardson
Quoted 10 lines · Bruce Richardson

With commit cb593a832630 ("net/i40e/base: reduce size of time variables"), the time_left value is 32-bits rather than 64-bits. However the printf-style format strings were never updated in the logs, so were left at PRIu64. Change them to PRIu32, fixing the build when additional format warnings were enabled.

Fixes cb593a832630 ("net/i40e/base: reduce size of time variables")

Applied, thanks.

Signature · 1 line
David Marchand