Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: usb: aqc111: Initialize wol_cfg with memset in aqc111_suspend

Clang warns:

drivers/net/usb/aqc111.c:1326:37: warning: suggest braces around
initialization of subobject [-Wmissing-braces]
struct aqc111_wol_cfg wol_cfg = { 0 };
^
{}
1 warning generated.

Use memset to initialize the object to take compiler instrumentation out
of the equation.

Fixes: e58ba4544c77 ("net: usb: aqc111: Add support for wake on LAN by MAGIC packet")
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Nathan Chancellor and committed by
David S. Miller
97e6c858 315c9e83

+3 -1
+3 -1
drivers/net/usb/aqc111.c
··· 1323 1323 1, 1, &reg8); 1324 1324 1325 1325 if (aqc111_data->wol_flags) { 1326 - struct aqc111_wol_cfg wol_cfg = { 0 }; 1326 + struct aqc111_wol_cfg wol_cfg; 1327 + 1328 + memset(&wol_cfg, 0, sizeof(struct aqc111_wol_cfg)); 1327 1329 1328 1330 aqc111_data->phy_cfg |= AQ_WOL; 1329 1331 ether_addr_copy(wol_cfg.hw_addr, dev->net->dev_addr);