net: stmmac: fix missed le32_to_cpu()
Subsystems (4)
PATCH 1/1 net: stmmac: fix missed le32_to_cpu()
The print in ndesc_display_ring() sends the des2 and des3 to the pr_info() without passing them through the relevant conversion to cpu order.
Fix the (prototype) sparse warnings by using le32_to_cpu():drivers/net/ethernet/stmicro/stmmac/norm_desc.c:258:17: warning: incorrect type in argument 6 (different base types)drivers/net/ethernet/stmicro/stmmac/norm_desc.c:258:17: expected unsigned intdrivers/net/ethernet/stmicro/stmmac/norm_desc.c:258:17: got restricted __le32 [usertype] des2drivers/net/ethernet/stmicro/stmmac/norm_desc.c:258:17: warning: incorrect type in argument 7 (different base types)drivers/net/ethernet/stmicro/stmmac/norm_desc.c:258:17: expected unsigned intdrivers/net/ethernet/stmicro/stmmac/norm_desc.c:258:17: got restricted __le32 [usertype] des3
--- drivers/net/ethernet/stmicro/stmmac/norm_desc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/stmicro/stmmac/norm_desc.c +1 -1
@@ -258,7 +258,7 @@ static void ndesc_display_ring(void *head, unsigned int size, bool rx,pr_info ("%03d [%pad]: 0x%x 0x%x 0x%x 0x%x" , i, &dma_addr, (unsigned int )x, (unsigned int )(x >>32 ), - p->des2, p->des3); +le32_to_cpu (p->des2),le32_to_cpu (p->des3)); p++; }pr_info ("\n" );
Signature · 1 line
2.37.2.352.g3c44437643
Maxime Chevallier
maintainerHi Ben,
Quoted 12 lines · Ben Dooks
The print in
ndesc_display_ring()sends the des2 and des3 to thepr_info()without passing them through the relevant conversion to cpu order.Fix the (prototype) sparse warnings by using
le32_to_cpu():drivers/net/ethernet/stmicro/stmmac/norm_desc.c:258:17: warning: incorrect type in argument 6 (different base types)drivers/net/ethernet/stmicro/stmmac/norm_desc.c:258:17: expected unsigned intdrivers/net/ethernet/stmicro/stmmac/norm_desc.c:258:17: got restricted__le32[usertype] des2drivers/net/ethernet/stmicro/stmmac/norm_desc.c:258:17: warning: incorrect type in argument 7 (different base types)drivers/net/ethernet/stmicro/stmmac/norm_desc.c:258:17: expected unsigned intdrivers/net/ethernet/stmicro/stmmac/norm_desc.c:258:17: got restricted__le32[usertype] des3
Quoted 1 line
Signed-off-by Ben Dooks <[email protected]>
I agree on the principle, but this isn't a fix so this'll have to wait until net-next re-opens :)
Thanks,
Maxime
Quoted 17 lines
--- drivers/net/ethernet/stmicro/stmmac/norm_desc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/net/ethernet/stmicro/stmmac/norm_desc.c +1
-1@@ -258,7 +258,7 @@ static void ndesc_display_ring(void *head, unsigned int size, bool rx,pr_info ("%03d [%pad]: 0x%x 0x%x 0x%x 0x%x" , i, &dma_addr, (unsigned int )x, (unsigned int )(x >>32 ), - p->des2, p->des3); +le32_to_cpu (p->des2),le32_to_cpu (p->des3)); p++; }pr_info ("\n" );
Jakub Kicinski
maintainerQuoted 15 lines · On Mon, 22 Jun 2026 19:51:39 +0200 Maxime Chevallier wrote:
Hi Ben,
Quoted 12 lines · Ben Dooks
The print in
ndesc_display_ring()sends the des2 and des3 to thepr_info()without passing them through the relevant conversion to cpu order.Fix the (prototype) sparse warnings by using
le32_to_cpu():drivers/net/ethernet/stmicro/stmmac/norm_desc.c:258:17: warning: incorrect type in argument 6 (different base types)drivers/net/ethernet/stmicro/stmmac/norm_desc.c:258:17: expected unsigned intdrivers/net/ethernet/stmicro/stmmac/norm_desc.c:258:17: got restricted__le32[usertype] des2drivers/net/ethernet/stmicro/stmmac/norm_desc.c:258:17: warning: incorrect type in argument 7 (different base types)drivers/net/ethernet/stmicro/stmmac/norm_desc.c:258:17: expected unsigned intdrivers/net/ethernet/stmicro/stmmac/norm_desc.c:258:17: got restricted__le32[usertype] des3
Quoted 4 lines
Quoted 1 line
Signed-off-by Ben Dooks <[email protected]>I agree on the principle, but this isn't a fix so this'll have to wait until net-next re-opens :)
Humpf, why are we not seeing this on x86 allmodconfig ? 🤔️
$ make C=1 W=1 drivers/net/ethernet/stmicro/stmmac/norm_desc.o DESCEND objtool CC [M] drivers/net/ethernet/stmicro/stmmac/norm_desc.o CHECK drivers/net/ethernet/stmicro/stmmac/norm_desc.c $
Maxime Chevallier
maintainerQuoted 21 lines · Jakub Kicinski
Quoted 15 lines · On Mon, 22 Jun 2026 19:51:39 +0200 Maxime Chevallier wrote:
Hi Ben,
Quoted 12 lines · Ben Dooks
The print in
ndesc_display_ring()sends the des2 and des3 to thepr_info()without passing them through the relevant conversion to cpu order.Fix the (prototype) sparse warnings by using
le32_to_cpu():drivers/net/ethernet/stmicro/stmmac/norm_desc.c:258:17: warning: incorrect type in argument 6 (different base types)drivers/net/ethernet/stmicro/stmmac/norm_desc.c:258:17: expected unsigned intdrivers/net/ethernet/stmicro/stmmac/norm_desc.c:258:17: got restricted__le32[usertype] des2drivers/net/ethernet/stmicro/stmmac/norm_desc.c:258:17: warning: incorrect type in argument 7 (different base types)drivers/net/ethernet/stmicro/stmmac/norm_desc.c:258:17: expected unsigned intdrivers/net/ethernet/stmicro/stmmac/norm_desc.c:258:17: got restricted__le32[usertype] des3Quoted 4 lines
Quoted 1 line
Signed-off-by Ben Dooks <[email protected]>I agree on the principle, but this isn't a fix so this'll have to wait until net-next re-opens :)
Quoted 7 lines
Humpf, why are we not seeing this on x86 allmodconfig ? 🤔️
$ make C=1 W=1 drivers/net/ethernet/stmicro/stmmac/norm_desc.o DESCEND objtool CC [M] drivers/net/ethernet/stmicro/stmmac/norm_desc.o CHECK drivers/net/ethernet/stmicro/stmmac/norm_desc.c $
Heh good point indeed !
Quoted 1 line
Quoted 1 line
Quoted 1 line
Fix the (prototype) sparse warnings by using
le32_to_cpu():
Ben, what's this "prototype" sparse ? a custom tool of yours that you used to find that ?
Maxime
Quoted 32 lines · Maxime Chevallier
Quoted 21 lines · Jakub Kicinski
Quoted 15 lines · On Mon, 22 Jun 2026 19:51:39 +0200 Maxime Chevallier wrote:
Hi Ben,
Quoted 12 lines · Ben Dooks
The print in
ndesc_display_ring()sends the des2 and des3 to thepr_info()without passing them through the relevant conversion to cpu order.Fix the (prototype) sparse warnings by using
le32_to_cpu():drivers/net/ethernet/stmicro/stmmac/norm_desc.c:258:17: warning: incorrect type in argument 6 (different base types)drivers/net/ethernet/stmicro/stmmac/norm_desc.c:258:17: expected unsigned intdrivers/net/ethernet/stmicro/stmmac/norm_desc.c:258:17: got restricted__le32[usertype] des2drivers/net/ethernet/stmicro/stmmac/norm_desc.c:258:17: warning: incorrect type in argument 7 (different base types)drivers/net/ethernet/stmicro/stmmac/norm_desc.c:258:17: expected unsigned intdrivers/net/ethernet/stmicro/stmmac/norm_desc.c:258:17: got restricted__le32[usertype] des3Quoted 4 lines
Quoted 1 line
Signed-off-by Ben Dooks <[email protected]>I agree on the principle, but this isn't a fix so this'll have to wait until net-next re-opens :)
Quoted 7 lines
Humpf, why are we not seeing this on x86 allmodconfig ? 🤔️
$ make C=1 W=1 drivers/net/ethernet/stmicro/stmmac/norm_desc.o DESCEND objtool CC [M] drivers/net/ethernet/stmicro/stmmac/norm_desc.o CHECK drivers/net/ethernet/stmicro/stmmac/norm_desc.c $
Quoted 6 lines
Heh good point indeed !
Quoted 1 line
Quoted 1 line
Quoted 1 line
Fix the (prototype) sparse warnings by using
le32_to_cpu():Ben, what's this "prototype" sparse ? a custom tool of yours that you used to find that ?
I have an RFC to add variadic and thus also printf/scanf formatting to sparse. This is waiting on review after the original got re-worked to add scanf and a few other bug-fixed and shuffles.
Ref: https://marc.info/?l=linux-sparse&m=178185274600679&w=2
Signature · 4 lines
Ben Dooks http://www.codethink.co.uk/ Senior Engineer Codethink - Providing Genius https://www.codethink.co.uk/privacy.html
Jakub Kicinski
maintainerQuoted 9 lines · On Mon, 29 Jun 2026 12:11:08 +0100 Ben Dooks wrote:
Quoted 2 lines · Maxime Chevallier
Ben, what's this "prototype" sparse ? a custom tool of yours that you used to find that ?
I have an RFC to add variadic and thus also printf/scanf formatting to sparse. This is waiting on review after the original got re-worked to add scanf and a few other bug-fixed and shuffles.
Ref: https://marc.info/?l=linux-sparse&m=178185274600679&w=2
Ah, makes sense. This most definitely need to be part of the commit message.