linux-stable/drivers/net/ethernet/amd
Justin Stitt 647df0d41b net: amd-xgbe: fix clang -Wformat warning
see warning:
| drivers/net/ethernet/amd/xgbe/xgbe-drv.c:2787:43: warning: format specifies
| type 'unsigned short' but the argument has type 'int' [-Wformat]
|        netdev_dbg(netdev, "Protocol: %#06hx\n", ntohs(eth->h_proto));
|                                      ~~~~~~     ^~~~~~~~~~~~~~~~~~~

Variadic functions (printf-like) undergo default argument promotion.
Documentation/core-api/printk-formats.rst specifically recommends
using the promoted-to-type's format flag.

Also, as per C11 6.3.1.1:
(https://www.open-std.org/jtc1/sc22/wg14/www/docs/n1548.pdf)
`If an int can represent all values of the original type ..., the
value is converted to an int; otherwise, it is converted to an
unsigned int. These are called the integer promotions.`

Since the argument is a u16 it will get promoted to an int and thus it is
most accurate to use the %x format specifier here. It should be noted that the
`#06` formatting sugar does not alter the promotion rules.

Link: https://github.com/ClangBuiltLinux/linux/issues/378
Signed-off-by: Justin Stitt <jstitt007@gmail.com>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Link: https://lore.kernel.org/r/20220607191119.20686-1-jstitt007@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2022-06-08 21:12:03 -07:00
..
xgbe net: amd-xgbe: fix clang -Wformat warning 2022-06-08 21:12:03 -07:00
7990.c mm: reorder includes after introduction of linux/pgtable.h 2020-06-09 09:39:13 -07:00
7990.h net: 7990: Fix use correct return type for ndo_start_xmit() 2020-05-06 14:26:14 -07:00
a2065.c amd: a2065/ariadne: use eth_hw_addr_set() 2021-11-19 11:05:20 +00:00
a2065.h
amd8111e.c eth: switch to netif_napi_add_weight() 2022-05-08 11:33:57 +01:00
amd8111e.h net: amd: remove leading spaces before tabs 2021-05-19 12:17:30 -07:00
ariadne.c amd: a2065/ariadne: use eth_hw_addr_set() 2021-11-19 11:05:20 +00:00
ariadne.h
atarilance.c amd: atarilance: use eth_hw_addr_set() 2021-11-19 11:05:20 +00:00
au1000_eth.c au1000_eth: stop using virt_to_bus() 2022-06-08 11:32:02 -07:00
au1000_eth.h au1000_eth: stop using virt_to_bus() 2022-06-08 11:32:02 -07:00
declance.c amd: declance: use eth_hw_addr_set() 2022-01-25 09:00:53 -08:00
hplance.c amd: hplance: use eth_hw_addr_set() 2021-11-19 11:05:20 +00:00
hplance.h
Kconfig eth: amd: remove NI6510 support (ni65) 2022-05-11 13:09:59 +01:00
lance.c amd: lance: use eth_hw_addr_set() 2021-11-19 11:05:20 +00:00
Makefile eth: amd: remove NI6510 support (ni65) 2022-05-11 13:09:59 +01:00
mvme147.c amd: mvme147: use eth_hw_addr_set() 2021-11-19 11:05:20 +00:00
nmclan_cs.c ethernet: constify references to netdev->dev_addr in drivers 2021-10-14 09:22:11 -07:00
pcnet32.c eth: switch to netif_napi_add_weight() 2022-05-08 11:33:57 +01:00
sun3lance.c ethernet: replace netdev->dev_addr assignment loops 2021-10-14 09:22:25 -07:00
sunlance.c ethernet: replace netdev->dev_addr assignment loops 2021-10-14 09:22:25 -07:00