1
0
Fork 0
alistair23-linux/drivers/net/ethernet/stmicro/stmmac
Nathan Chancellor 1f5d861f7f net: stmmac: Avoid one more sometimes uninitialized Clang warning
When building with -Wsometimes-uninitialized, Clang warns:

drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c:111:2: error: variable
'ns' is used uninitialized whenever 'if' condition is false
[-Werror,-Wsometimes-uninitialized]
drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c:111:2: error: variable
'ns' is used uninitialized whenever '&&' condition is false
[-Werror,-Wsometimes-uninitialized]

Clang is concerned with the use of stmmac_do_void_callback (which
stmmac_get_systime wraps), as it may fail to initialize these values if
the if condition was ever false (meaning the callback doesn't exist).
It's not wrong because the callback is what initializes ns. While it's
unlikely that the callback is going to disappear at some point and make
that condition false, we can easily avoid this warning by zero
initializing the variable.

Link: https://github.com/ClangBuiltLinux/linux/issues/384
Fixes: df10317085 ("net: stmmac: Avoid sometimes uninitialized Clang warnings")
Suggested-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2019-03-08 23:20:22 -08:00
..
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
altr_tse_pcs.c net: ethernet: stmmac: Convert timers to use timer_setup() 2017-10-18 12:39:37 +01:00
altr_tse_pcs.h
chain_mode.c net: stmmac: Switch stmmac_mode_ops to generic HW Interface Helpers 2018-04-16 18:50:03 -04:00
common.h net: stmmac: Fix RX packet size > 8191 2018-11-08 19:47:44 -08:00
descs.h
descs_com.h net: stmmac: Fix RX packet size > 8191 2018-11-08 19:47:44 -08:00
dwmac-anarion.c
dwmac-dwc-qos-eth.c net: stmmac: dwc-qos-eth: Fix typo in DT bindings parsing 2017-10-27 23:23:19 +09:00
dwmac-generic.c net: stmmac: Add the bindings parsing for XGMAC2 2018-08-09 11:16:28 -07:00
dwmac-ipq806x.c net: ethernet: stmmac: Clean up dead code 2017-10-08 21:19:07 -07:00
dwmac-lpc18xx.c
dwmac-mediatek.c net-next: stmmac: dwmac-mediatek: remove fine-tune property 2018-12-19 16:24:58 -08:00
dwmac-meson.c
dwmac-meson8b.c net: stmmac: dwmac-meson8b: Fix an error handling path in 'meson8b_dwmac_probe()' 2018-06-12 15:36:14 -07:00
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 net: stmmac: socfpga: add additional ocp reset line for Stratix10 2018-06-20 14:34:26 +09:00
dwmac-sti.c
dwmac-stm32.c net: ethernet: stmmac: update to support all PHY config for stm32mp157c. 2019-03-08 11:48:19 -08:00
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
dwmac4.h net: stmmac: Add Flexible PPS support 2018-06-04 10:13:16 -04:00
dwmac4_core.c net: stmmac: Add Flexible PPS support 2018-06-04 10:13:16 -04:00
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 Merge ra.kernel.org:/pub/scm/linux/kernel/git/davem/net 2018-07-03 10:29:26 +09:00
dwmac4_dma.h net: stmmac: Set DMA buffer size in HW 2018-06-28 22:24:25 +09:00
dwmac4_lib.c net: stmmac: dwmac4: Also use TBU interrupt to clean TX path 2019-02-21 15:42:34 -08:00
dwmac5.c net: stmmac: Add Flexible PPS support 2018-06-04 10:13:16 -04:00
dwmac5.h net: stmmac: Add Flexible PPS support 2018-06-04 10:13:16 -04:00
dwmac100.h
dwmac100_core.c net: stmmac: Implement logic to automatically select HW Interface 2018-04-23 12:03:50 -04:00
dwmac100_dma.c net: stmmac: Uniformize the use of dma_init_* callbacks 2018-05-18 11:00:15 -04:00
dwmac1000.h net: stmmac: Implement logic to automatically select HW Interface 2018-04-23 12:03:50 -04:00
dwmac1000_core.c net: stmmac: Implement logic to automatically select HW Interface 2018-04-23 12:03:50 -04:00
dwmac1000_dma.c net: stmmac: Uniformize the use of dma_init_* callbacks 2018-05-18 11:00:15 -04:00
dwmac_dma.h
dwmac_lib.c net: stmmac: dwmac_lib: fix interchanged sleep/timeout values in DMA reset function 2017-10-13 10:19:52 -07:00
dwxgmac2.h net: stmmac: dwxgmac2: Also use TBU interrupt to clean TX path 2019-02-21 15:42:34 -08:00
dwxgmac2_core.c net: stmmac: Add CBS support in XGMAC2 2018-09-01 17:40:22 -07:00
dwxgmac2_descs.c net: stmmac: Add descriptor related callbacks for XGMAC2 2018-08-09 11:16:28 -07:00
dwxgmac2_dma.c 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 net: stmmac: Enable TC Ops for GMAC >= 4 2018-09-08 10:24:30 -07:00
hwif.h net: stmmac: Add descriptor related callbacks for XGMAC2 2018-08-09 11:16:28 -07:00
mmc.h
mmc_core.c
norm_desc.c net: stmmac: Let descriptor code get skbuff address 2018-05-18 11:00:16 -04:00
ring_mode.c net: stmmac: Fix RX packet size > 8191 2018-11-08 19:47:44 -08:00
stmmac.h net: stmmac: Fix NAPI poll in TX path when in multi-queue 2019-02-21 15:42:34 -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 net: stmmac: Switch stmmac_hwtimestamp to generic HW Interface Helpers 2018-04-16 18:49:55 -04:00
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 net: ethernet: stmmac: add management of clk_csr property 2019-03-08 11:48:19 -08:00
stmmac_platform.h
stmmac_ptp.c net: stmmac: Avoid one more sometimes uninitialized Clang warning 2019-03-08 23:20:22 -08:00
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