Skip to contentSkip to conversation

linux-next: build warning after merge of the bitmap tree

DISCUSSION Stephen Rothwell 2 participants 2 messages Apr 20, 2022 Linux-next tree

lore
Share & tools
lore
#0 lore raw

Hi all,

After merging the bitmap tree, today's linux-next build (htmldocs) produced this warning:

Documentation/core-api/kernel-api:87: /home/sfr/next/next/include/linux/bitmap.h:425: WARNING: Unexpected indentation. Documentation/core-api/kernel-api:87: /home/sfr/next/next/include/linux/bitmap.h:426: WARNING: Block quote ends without a blank line; unexpected unindent. Documentation/core-api/kernel-api:87: /home/sfr/next/next/include/linux/bitmap.h:431: WARNING: Unexpected indentation.

Introduced by commit

6f46c24da767 ("bitmap: add bitmap_weight_{cmp, eq, gt, ge, lt, le} functions")

Signature · 2 lines
Cheers,
Stephen Rothwell
#1 lore raw

Hi Stephen,

(Adding Maxim Kuvyrkov from linaro/TCWG as he might be interested in arm part of this.

Quoted 6 lines · Stephen Rothwell

Hi all,

After merging the bitmap tree, today's linux-next build (htmldocs) produced this warning:

Quoted 7 lines

Documentation/core-api/kernel-api:87: /home/sfr/next/next/include/linux/bitmap.h:425: WARNING: Unexpected indentation. Documentation/core-api/kernel-api:87: /home/sfr/next/next/include/linux/bitmap.h:426: WARNING: Block quote ends without a blank line; unexpected unindent. Documentation/core-api/kernel-api:87: /home/sfr/next/next/include/linux/bitmap.h:431: WARNING: Unexpected indentation.

Introduced by commit

6f46c24da767 ("bitmap: add bitmap_weight_{cmp, eq, gt, ge, lt, le} functions")

I'll build docs and fix those warnings. Thanks for pointing this out.

From previous linux-next build message:

Quoted 22 lines

../lib/bitmap.c:21:5: error: conflicting types for '__bitmap_weight_cmp'; have 'int(const long unsigned int *, unsigned int, int)'
21 | int __bitmap_weight_cmp(const unsigned long *bitmap, unsigned int bits, int num)

      |     ^~~~~~~~~~~~~~~~~~~
In file included from ../lib/bitmap.c:6:
tools/include/linux/bitmap.h:15:5: note: previous declaration of '__bitmap_weight_cmp' with type 'int(const long unsigned int *, unsigned int,  unsigned int)'
   15 | int __bitmap_weight_cmp(const unsigned long *bitmap, unsigned int bits,
      |     ^~~~~~~~~~~~~~~~~~~

../lib/bitmap.c: In function '__bitmap_weight_cmp':
../lib/bitmap.c:26:50: error: comparison of integer expressions of different signedness: 'unsigned int' and 'int' [-Werror=sign-compare]
26 | if (w + bits - k * BITS_PER_LONG < num)
| ^
../lib/bitmap.c:31:23: error: comparison of integer expressions of different signedness: 'unsigned int' and 'int' [-Werror=sign-compare]
31 | if (w > num)
| ^
cc1: all warnings being treated as errors
tools/perf/../lib/bitmap.c:21:5: error: conflicting types for '__bitmap_weight_cmp'; have 'int(const long unsigned int *, unsigned int, int)'
21 | int __bitmap_weight_cmp(const unsigned long *bitmap, unsigned int bits, int num)

      |     ^~~~~~~~~~~~~~~~~~~
In file included from tools/perf/../lib/bitmap.c:6:
tools/include/linux/bitmap.h:15:5: note: previous declaration of '__bitmap_weight_cmp' with type 'int(const long unsigned int *, unsigned int,  unsigned int)'
   15 | int __bitmap_weight_cmp(const unsigned long *bitmap, unsigned int bits,
      |     ^~~~~~~~~~~~~~~~~~~
Quoted 8 lines

tools/perf/../lib/bitmap.c: In function '__bitmap_weight_cmp':
tools/perf/../lib/bitmap.c:26:50: error: comparison of integer expressions of different signedness: 'unsigned int' and 'int' [-Werror=sign-compare]
26 | if (w + bits - k * BITS_PER_LONG < num)
| ^
tools/perf/../lib/bitmap.c:31:23: error: comparison of integer expressions of different signedness: 'unsigned int' and 'int' [-Werror=sign-compare]
31 | if (w > num)
| ^
cc1: all warnings being treated as errors

I fixed tools build error and updated the bitmap-for-next branch. The problem is that tools/perf
enables -Werror=sign-compare, and main kernel not. So direct copying of functions from kernel
to tools doesn't work. This might be an issue by itself because I think it would be better to keep
kernel and tools code consistent whenever possible.

Another problem is that the tools lacks testing from (obviously) me, 0-day and TCWG. I added
tools/perf to my testing build suite, and found that the build fails for arm and s390 on v5.18-rc2.
See tools/perf build log attached.

Thanks,
Yury

s390:
PERF_VERSION = 5.18.rc2.gce522ba9ef7e
In file included from /usr/s390x-linux-gnu/include/stdio.h:866,
from
/home/yury/work/linux/tools/lib/perf/include/perf/cpumap.h:7,

                 from util/session.c:13:

In function ‘printf’,
inlined from ‘dump_event’ at util/session.c:1292:2,
inlined from ‘machines__deliver_event’ at util/session.c:1502:2, inlined from ‘perf_session__deliver_synth_event’ at util/session.c:1703:9:
/usr/s390x-linux-gnu/include/bits/stdio2.h:112:10: error: ‘%s’ directive argument is null [-Werror=format-overflow=]
112 | return __printf_chk (__USE_FORTIFY_LEVEL - 1, __fmt,

__va_arg_pack ());
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

util/session.c: In function ‘perf_session__deliver_synth_event’:
util/session.c:1292:25: note: format string is defined here
1292 | printf("\n%#" PRIx64 "@%s [%#x]: event: %d\n",
| ^~
cc1: all warnings being treated as errors

arm:
PERF_VERSION = 5.18.rc2.gce522ba9ef7e
/tmp/ccHIlKZJ.s: Assembler messages:
/tmp/ccHIlKZJ.s:541: Error: selected processor does not support `ldrd r0,r1,[r2]' in ARM mode
/tmp/ccHIlKZJ.s:630: Error: selected processor does not support `strd r4,r5,[r3]' in ARM mode
make[9]: *** [/home/yury/work/linux/tools/build/Makefile.build:96:
/home/yury/work/linux/build/arm/tools/perf/arch/arm/util/auxtrace.o] Error 1