linux/drivers/net/ethernet/stmicro/stmmac
Nathan Chancellor df10317085 net: stmmac: Avoid sometimes uninitialized Clang warnings
When building with -Wsometimes-uninitialized, Clang warns:

drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:495:3: warning: variable 'ns' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:495:3: warning: variable 'ns' is used uninitialized whenever '&&' condition is false [-Wsometimes-uninitialized]
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:532:3: warning: variable 'ns' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:532:3: warning: variable 'ns' is used uninitialized whenever '&&' condition is false [-Wsometimes-uninitialized]
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:741:3: warning: variable 'sec_inc' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:741:3: warning: variable 'sec_inc' is used uninitialized whenever '&&' condition is false [-Wsometimes-uninitialized]

Clang is concerned with the use of stmmac_do_void_callback (which
stmmac_get_timestamp and stmmac_config_sub_second_increment wrap),
as it may fail to initialize these values if the if condition was ever
false (meaning the callbacks don't exist). It's not wrong because the
callbacks (get_timestamp and config_sub_second_increment respectively)
are the ones that initialize the variables. While it's unlikely that the
callbacks are ever going to disappear and make that condition false, we
can easily avoid this warning by zero initialize the variables.

Link: https://github.com/ClangBuiltLinux/linux/issues/384
Suggested-by: Nick Desaulniers <ndesaulniers@google.com>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2019-03-07 10:14:19 -08:00
..
altr_tse_pcs.c
altr_tse_pcs.h
chain_mode.c
common.h net: stmmac: Fix RX packet size > 8191 2018-11-08 19:47:44 -08:00
descs_com.h net: stmmac: Fix RX packet size > 8191 2018-11-08 19:47:44 -08:00
descs.h
dwmac4_core.c
dwmac4_descs.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2019-02-20 00:34:07 -08:00
dwmac4_descs.h
dwmac4_dma.c
dwmac4_dma.h
dwmac4_lib.c net: stmmac: dwmac4: Also use TBU interrupt to clean TX path 2019-02-21 15:42:34 -08:00
dwmac4.h
dwmac5.c
dwmac5.h
dwmac100_core.c
dwmac100_dma.c
dwmac100.h
dwmac1000_core.c
dwmac1000_dma.c
dwmac1000.h
dwmac_dma.h
dwmac_lib.c
dwmac-anarion.c
dwmac-dwc-qos-eth.c
dwmac-generic.c
dwmac-ipq806x.c
dwmac-lpc18xx.c
dwmac-mediatek.c net-next: stmmac: dwmac-mediatek: remove fine-tune property 2018-12-19 16:24:58 -08:00
dwmac-meson8b.c
dwmac-meson.c
dwmac-oxnas.c
dwmac-qcom-ethqos.c net: stmmac: Fix return value check in qcom_ethqos_probe() 2019-01-24 22:13:03 -08:00
dwmac-rk.c net: stmmac: dwmac-rk: fix error handling in rk_gmac_powerup() 2019-01-27 23:03:38 -08:00
dwmac-socfpga.c
dwmac-sti.c
dwmac-stm32.c
dwmac-sun8i.c net: stmmac: dwmac-sun8i: fix OF child-node lookup 2018-10-23 13:28:52 -05:00
dwmac-sunxi.c net: stmicro: fix a missing check of clk_prepare 2018-12-27 16:20:44 -08:00
dwxgmac2_core.c
dwxgmac2_descs.c
dwxgmac2_dma.c net: stmmac: dwxgmac2: Also use TBU interrupt to clean TX path 2019-02-21 15:42:34 -08:00
dwxgmac2.h net: stmmac: dwxgmac2: Also use TBU interrupt to clean TX path 2019-02-21 15:42:34 -08:00
enh_desc.c net: stmmac: Fix RX packet size > 8191 2018-11-08 19:47:44 -08:00
hwif.c
hwif.h
Kconfig net: stmmac: Add driver for Qualcomm ethqos 2019-01-22 19:37:59 -08:00
Makefile net: stmmac: Add driver for Qualcomm ethqos 2019-01-22 19:37:59 -08:00
mmc_core.c
mmc.h
norm_desc.c
ring_mode.c net: stmmac: Fix RX packet size > 8191 2018-11-08 19:47:44 -08:00
stmmac_ethtool.c net: stmmac: Fix a race in EEE enable callback 2019-02-18 17:39:11 -08:00
stmmac_hwtstamp.c
stmmac_main.c net: stmmac: Avoid sometimes uninitialized Clang warnings 2019-03-07 10:14:19 -08:00
stmmac_mdio.c net: stmmac: Fix stmmac_mdio_reset() when building stmmac as modules 2018-10-31 18:35:58 -07:00
stmmac_pci.c net: stmmac: Fix PCI module removal leak 2019-01-11 15:35:06 -08:00
stmmac_pcs.h
stmmac_platform.c
stmmac_platform.h
stmmac_ptp.c
stmmac_ptp.h net: stmmac: fix ptp timestamping on Rx on gmac4 2019-02-06 17:28:15 -08:00
stmmac_tc.c net: stmmac: Check if CBS is supported before configuring 2019-01-11 15:35:06 -08:00
stmmac.h net: stmmac: Fix NAPI poll in TX path when in multi-queue 2019-02-21 15:42:34 -08:00