Skip to contentSkip to conversation

Smatch messages that are not understood

DISCUSSION Larry Finger 2 participants 2 messages Sep 12, 2013

lore
Share & tools
lore
#0 lore raw

Hi,

I am in the process of fixing smatch warnings and errors in the rtlwifi family of drivers. Most are straight forward; however, some routines show info messages originating from an inline routine in the header files as follows:

CHECK drivers/net/wireless/rtlwifi/rtl8192ce/dm.c
include/linux/etherdevice.h:278 ether_addr_equal_64bits() info: ignoring unreachable code. include/linux/etherdevice.h:278 ether_addr_equal_64bits() info: ignoring unreachable code.

The source code is a current pull of the mainline git tree. I'm not sure if this is a subtle case of unreachable code that I do not see, or if it is a smatch bug.

Thanks,

Larry

#1 lore raw
Quoted 13 lines · Larry Finger

Hi,

I am in the process of fixing smatch warnings and errors in the rtlwifi family of drivers. Most are straight forward; however, some routines show info messages originating from an inline routine in the header files as follows:

CHECK drivers/net/wireless/rtlwifi/rtl8192ce/dm.c
include/linux/etherdevice.h:278 ether_addr_equal_64bits() info:
ignoring unreachable code. include/linux/etherdevice.h:278 ether_addr_equal_64bits() info:
ignoring unreachable code.

Quoted 3 lines

The source code is a current pull of the mainline git tree. I'm not sure if this is a subtle case of unreachable code that I do not see, or if it is a smatch bug.

include/linux/etherdevice.h
275 if (sizeof(fold) == 8)
276 return zap_last_2bytes(fold) == 0;
277
278 fold |= zap_last_2bytes((*(unsigned long *)(addr1 + 4)) ^
279 (*(unsigned long *)(addr2 + 4)));

It's hitting the (sizeof(fold) == 8) and returning.

regards,
dan carpenter