Re: [PATCH v2 2/2] lib: make a test module with set/clear bit

From: Peter Zijlstra
Date: Thu Feb 20 2020 - 13:10:49 EST


On Thu, Feb 20, 2020 at 09:37:22AM -0800, Jesse Brandeburg wrote:
> Test some bit clears/sets to make sure assembly doesn't change.
> Instruct Kbuild to build this file with extra warning level -Wextra,
> to catch new issues, and also doesn't hurt to build with C=1.
>
> This was used to test changes to arch/x86/include/asm/bitops.h.
>
> Recommended usage:
> make defconfig
> scripts/config -m CONFIG_TEST_BITOPS
> make modules_prepare
> make C=1 W=1 lib/test_bitops.ko
> objdump -S -d lib/test_bitops.ko

I only applied this second patch:

# sparse --version
0.6.0 (Debian: 0.6.0-3+b1)

# grep TEST_BITOPS defconfig-build/.config
CONFIG_TEST_BITOPS=m

# make C=1 W=1 O=defconfig-build/ lib/test_bitops.ko
make[1]: Entering directory '/usr/src/linux-2.6/defconfig-build'
GEN Makefile
HOSTCC scripts/basic/fixdep
HOSTCC arch/x86/tools/relocs_32.o
HOSTCC arch/x86/tools/relocs_64.o
HOSTCC arch/x86/tools/relocs_common.o
HOSTLD arch/x86/tools/relocs
HOSTCC scripts/selinux/genheaders/genheaders
HOSTCC scripts/selinux/mdp/mdp
HOSTCC scripts/kallsyms
HOSTCC scripts/sorttable
HOSTCC scripts/asn1_compiler
HOSTCC scripts/extract-cert
HOSTCC scripts/mod/mk_elfconfig
CHECK ../scripts/mod/empty.c
CC scripts/mod/empty.o
MKELF scripts/mod/elfconfig.h
HOSTCC scripts/mod/modpost.o
CC scripts/mod/devicetable-offsets.s
HOSTCC scripts/mod/file2alias.o
HOSTCC scripts/mod/sumversion.o
HOSTLD scripts/mod/modpost
CC kernel/bounds.s
CC arch/x86/kernel/asm-offsets.s
CALL ../scripts/checksyscalls.sh
CALL ../scripts/atomic/check-atomics.sh
DESCEND objtool
HOSTCC /usr/src/linux-2.6/defconfig-build/tools/objtool/fixdep.o
HOSTLD /usr/src/linux-2.6/defconfig-build/tools/objtool/fixdep-in.o
LINK /usr/src/linux-2.6/defconfig-build/tools/objtool/fixdep
CC /usr/src/linux-2.6/defconfig-build/tools/objtool/exec-cmd.o
CC /usr/src/linux-2.6/defconfig-build/tools/objtool/help.o
CC /usr/src/linux-2.6/defconfig-build/tools/objtool/pager.o
CC /usr/src/linux-2.6/defconfig-build/tools/objtool/parse-options.o
CC /usr/src/linux-2.6/defconfig-build/tools/objtool/run-command.o
CC /usr/src/linux-2.6/defconfig-build/tools/objtool/sigchain.o
CC /usr/src/linux-2.6/defconfig-build/tools/objtool/subcmd-config.o
LD /usr/src/linux-2.6/defconfig-build/tools/objtool/libsubcmd-in.o
AR /usr/src/linux-2.6/defconfig-build/tools/objtool/libsubcmd.a
CC /usr/src/linux-2.6/defconfig-build/tools/objtool/arch/x86/decode.o
LD /usr/src/linux-2.6/defconfig-build/tools/objtool/arch/x86/objtool-in.o
CC /usr/src/linux-2.6/defconfig-build/tools/objtool/builtin-check.o
CC /usr/src/linux-2.6/defconfig-build/tools/objtool/builtin-orc.o
CC /usr/src/linux-2.6/defconfig-build/tools/objtool/check.o
CC /usr/src/linux-2.6/defconfig-build/tools/objtool/orc_gen.o
CC /usr/src/linux-2.6/defconfig-build/tools/objtool/orc_dump.o
CC /usr/src/linux-2.6/defconfig-build/tools/objtool/elf.o
CC /usr/src/linux-2.6/defconfig-build/tools/objtool/special.o
CC /usr/src/linux-2.6/defconfig-build/tools/objtool/objtool.o
CC /usr/src/linux-2.6/defconfig-build/tools/objtool/libstring.o
CC /usr/src/linux-2.6/defconfig-build/tools/objtool/libctype.o
CC /usr/src/linux-2.6/defconfig-build/tools/objtool/str_error_r.o
LD /usr/src/linux-2.6/defconfig-build/tools/objtool/objtool-in.o
LINK /usr/src/linux-2.6/defconfig-build/tools/objtool/objtool
CHECK ../lib/test_bitops.c
CC [M] lib/test_bitops.o
MODPOST 1 modules
CC [M] lib/test_bitops.mod.o
LD [M] lib/test_bitops.ko
make[1]: Leaving directory '/usr/src/linux-2.6/defconfig-build'


No warnings for me!