Skip to contentSkip to conversation

net/ipv4/tcp_output.c:188:3: warning: result of comparison of constant -1 with expression of type 'u8' (aka 'unsigned char') is always false

PATCH Li 1 participant 1 message May 19, 2020 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): 20200519195214.GA1958892@ubuntu-s3-xlarge-x86

Li

#1 lore raw
Quoted 53 lines

Subject: Re: [linux-next:master 5639/6402] net/ipv4/tcp_output.c:188:3: warning:
result of comparison of constant -1 with expression of type 'u8' (aka 'unsigned char') is always false

Quoted 6 lines · kbuild test robot
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   dfd71d381f7e1aa118e0368774aa05f5c4a48870
commit: 2b195850128f5bafde177b12489d9fa27962cc1e [5639/6402] tcp: add tp-

dup_ack_counter
config: x86_64-randconfig-r012-20200519 (attached as .config)
compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project

135b877874fae96b4372c8a3fbfaa8ff44ff86e3)

Quoted 2 lines

reproduce:
wget https://raw.githubusercontent.com/intel/lkp-

tests/master/sbin/make.cross -O ~/bin/make.cross

Quoted 6 lines

chmod +x ~/bin/make.cross
# install x86_64 cross compiling tool for clang build # apt-get install binutils-x86-64-linux-gnu git checkout 2b195850128f5bafde177b12489d9fa27962cc1e # save the attached .config to linux build tree COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang

make.cross ARCH=x86_64

Quoted 7 lines

If you fix the issue, kindly add following tag as appropriate

All warnings (new ones prefixed by >>, old ones prefixed by <<):

Quoted 1 line
Quoted 1 line

net/ipv4/tcp_output.c:188:3: warning: result of comparison of constant -1 with

expression of type 'u8' (aka 'unsigned char') is always false [-Wtautological- constant-out-of-range-compare]

Quoted 5 lines

NET_ADD_STATS(sock_net(sk), LINUX_MIB_TCPACKCOMPRESSED, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/net/ip.h:293:41: note: expanded from macro 'NET_ADD_STATS' #define NET_ADD_STATS(net, field, adnd) SNMP_ADD_STATS((net)- mib.net_statistics, field, adnd)

Quoted 8 lines

^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/net/snmp.h:143:4: note: expanded from macro 'SNMP_ADD_STATS' this_cpu_add(mib->mibs[field], addend) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/linux/percpu-defs.h:509:33: note: expanded from macro 'this_cpu_add'
#define this_cpu_add(pcp, val) __pcpu_size_call(this_cpu_add_, pcp, val)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see

all)

Quoted 4 lines

<scratch space>:292:1: note: expanded from here this_cpu_add_8
^
arch/x86/include/asm/percpu.h:492:35: note: expanded from macro

'this_cpu_add_8'

Quoted 3 lines

#define this_cpu_add_8(pcp, val) percpu_add_op(volatile, (pcp), val)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ arch/x86/include/asm/percpu.h:131:31: note: expanded from macro

Quoted 6 lines

'percpu_add_op'

Quoted 2 lines

((val) == 1 || (val) == -1)) ? ~~~~~ ^ ~~
1 warning generated.

This warning is supposed to be disabled under a regular build, is W=1 being turned on (see scripts/Makefile.extrawarn)?

Yes, this is turned on. Do you have any suggestion/comments for this, we can further tune the make command?

Quoted 3 lines

Cheers,
Nathan