fs/ext4/super.c:2295:1: warning: unused function 'ctx_test_flags'

From: kernel test robot
Date: Fri Jan 21 2022 - 23:38:36 EST


Hi Lukas,

FYI, the error/warning still remains.

tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 9b57f458985742bd1c585f4c7f36d04634ce1143
commit: 6e47a3cc68fc525428297a00524833361ebbb0e9 ext4: get rid of super block and sbi from handle_mount_ops()
date: 6 weeks ago
config: mips-randconfig-c004-20220118 (https://download.01.org/0day-ci/archive/20220122/202201221207.g5vwf1MI-lkp@xxxxxxxxx/config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 5f782d25a742302d25ef3c8b84b54f7483c2deb9)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install mips cross compiling tool for clang build
# apt-get install binutils-mips-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=6e47a3cc68fc525428297a00524833361ebbb0e9
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 6e47a3cc68fc525428297a00524833361ebbb0e9
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=mips SHELL=/bin/bash

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All warnings (new ones prefixed by >>):

>> fs/ext4/super.c:2295:1: warning: unused function 'ctx_test_flags'
EXT4_SET_CTX(flags);
^
fs/ext4/super.c:2290:20: note: expanded from macro 'EXT4_SET_CTX'
static inline bool ctx_test_##name(struct ext4_fs_context int flag) ^
<scratch space>:85:1: note: expanded from here
ctx_test_flags
^
>> fs/ext4/super.c:2298:1: warning: unused function 'ctx_clear_mount_flags'
EXT4_SET_CTX(mount_flags);
^
fs/ext4/super.c:2285:20: note: expanded from macro 'EXT4_SET_CTX'
static inline void ctx_clear_##name(struct ext4_fs_context int flag) ^
<scratch space>:106:1: note: expanded from here
ctx_clear_mount_flags
^
>> fs/ext4/super.c:2298:1: warning: unused function 'ctx_test_mount_flags'
fs/ext4/super.c:2290:20: note: expanded from macro 'EXT4_SET_CTX'
static inline bool ctx_test_##name(struct ext4_fs_context int flag) ^
<scratch space>:109:1: note: expanded from here
ctx_test_mount_flags
^
fatal error: error in backend: Nested variants found in inline asm string: ' .set push
.set mips64r2
.if ( 0x00 ) != -1)) 0x00 ) != -1)) : ($( static struct ftrace_branch_data __attribute__((__aligned__(4))) __attribute__((__section__("_ftrace_branch"))) __if_trace = $( .func = __func__, .file = "arch/mips/include/asm/bitops.h", .line = 105, $); 0x00 ) != -1)) : $))) ) && ( 0 ); .set push; .set mips64r2; .rept 1; sync 0x00; .endr; .set pop; .else; ; .endif
1: ll $0, $1
or $0, $2
sc $0, $1
beqz $0, 1b
.set pop
'
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0. Program arguments: clang -Wp,-MMD,fs/ext4/.super.o.d -nostdinc -Iarch/mips/include -I./arch/mips/include/generated -Iinclude -I./include -Iarch/mips/include/uapi -I./arch/mips/include/generated/uapi -Iinclude/uapi -I./include/generated/uapi -include include/linux/compiler-version.h -include include/linux/kconfig.h -include include/linux/compiler_types.h -D__KERNEL__ -DVMLINUX_LOAD_ADDRESS=0xffffffff80100000 -DLINKER_LOAD_ADDRESS=0x80100000 -DDATAOFFSET=0 -Qunused-arguments -fmacro-prefix-map== -DKBUILD_EXTRA_WARN1 -Wall -Wundef -Werror=strict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -fshort-wchar -fno-PIE -Werror=implicit-function-declaration -Werror=implicit-int -Werror=return-type -Wno-format-security -std=gnu89 --target=mips-linux -fintegrated-as -Werror=unknown-warning-option -Werror=ignored-optimization-argument -mno-check-zero-division -mabi=32 -G 0 -mno-abicalls -fno-pic -pipe -msoft-float -DGAS_HAS_SET_HARDFLOAT -Wa,-msoft-float -ffreestanding -EB -fno-stack-check -march=mips32 -Wa,--trap -DTOOLCHAIN_SUPPORTS_VIRT -Iarch/mips/include/asm/mach-generic -Iarch/mips/include/asm/mach-generic -fno-asynchronous-unwind-tables -fno-delete-null-pointer-checks -Wno-frame-address -Wno-address-of-packed-member -O2 -Wframe-larger-than=1024 -fno-stack-protector -Wimplicit-fallthrough -Wno-gnu -mno-global-merge -Wno-unused-but-set-variable -Wno-unused-const-variable -fno-stack-clash-protection -pg -Wdeclaration-after-statement -Wvla -Wno-pointer-sign -Wno-array-bounds -fno-strict-overflow -fno-stack-check -Werror=date-time -Werror=incompatible-pointer-types -Wextra -Wunused -Wno-unused-parameter -Wmissing-declarations -Wmissing-format-attribute -Wmissing-prototypes -Wold-style-definition -Wmissing-include-dirs -Wunused-but-set-variable -Wunused-const-variable -Wno-missing-field-initializers -Wno-sign-compare -Wno-type-limits -I fs/ext4 -I ./fs/ext4 -DKBUILD_MODFILE="fs/ext4/ext4" -DKBUILD_BASENAME="super" -DKBUILD_MODNAME="ext4" -D__KBUILD_MODNAME=kmod_ext4 -c -o fs/ext4/super.o fs/ext4/super.c
1. <eof> parser at end of file
2. Code generation
3. Running pass 'Function Pass Manager' on module 'fs/ext4/super.c'.
4. Running pass 'Mips Assembly Printer' on function '@ext4_read_bh_nowait'
#0 0x000056120809e14f Signals.cpp:0:0
#1 0x000056120809c02c llvm::sys::CleanupOnSignal(unsigned long) (/opt/cross/clang-7b3d307288/bin/clang-14+0x342202c)
#2 0x0000561207fdb747 llvm::CrashRecoveryContext::HandleExit(int) (/opt/cross/clang-7b3d307288/bin/clang-14+0x3361747)
#3 0x00005612080946de llvm::sys::Process::Exit(int, bool) (/opt/cross/clang-7b3d307288/bin/clang-14+0x341a6de)
#4 0x0000561205d04bcb (/opt/cross/clang-7b3d307288/bin/clang-14+0x108abcb)
#5 0x0000561207fe21fc llvm::report_fatal_error(llvm::Twine const&, bool) (/opt/cross/clang-7b3d307288/bin/clang-14+0x33681fc)
#6 0x0000561208cc6487 llvm::AsmPrinter::emitInlineAsm(llvm::MachineInstr const (/opt/cross/clang-7b3d307288/bin/clang-14+0x404c487)
#7 0x0000561208cc23e4 llvm::AsmPrinter::emitFunctionBody() (/opt/cross/clang-7b3d307288/bin/clang-14+0x40483e4)
#8 0x00005612067617e7 llvm::MipsAsmPrinter::runOnMachineFunction(llvm::MachineFunction&) (/opt/cross/clang-7b3d307288/bin/clang-14+0x1ae77e7)
#9 0x0000561207405ced llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (.part.53) MachineFunctionPass.cpp:0:0
#10 0x000056120783e8a7 llvm::FPPassManager::runOnFunction(llvm::Function&) (/opt/cross/clang-7b3d307288/bin/clang-14+0x2bc48a7)
#11 0x000056120783ea21 llvm::FPPassManager::runOnModule(llvm::Module&) (/opt/cross/clang-7b3d307288/bin/clang-14+0x2bc4a21)
#12 0x000056120783fcff llvm::legacy::PassManagerImpl::run(llvm::Module&) (/opt/cross/clang-7b3d307288/bin/clang-14+0x2bc5cff)
#13 0x00005612083adb7a clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::HeaderSearchOptions const&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::StringRef, clang::BackendAction, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream> >) (/opt/cross/clang-7b3d307288/bin/clang-14+0x3733b7a)
#14 0x0000561208fdde53 clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) (/opt/cross/clang-7b3d307288/bin/clang-14+0x4363e53)
#15 0x0000561209ae8769 clang::ParseAST(clang::Sema&, bool, bool) (/opt/cross/clang-7b3d307288/bin/clang-14+0x4e6e769)
#16 0x0000561208fdcc9f clang::CodeGenAction::ExecuteAction() (/opt/cross/clang-7b3d307288/bin/clang-14+0x4362c9f)
#17 0x00005612089dcca1 clang::FrontendAction::Execute() (/opt/cross/clang-7b3d307288/bin/clang-14+0x3d62ca1)
#18 0x000056120897432a clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/cross/clang-7b3d307288/bin/clang-14+0x3cfa32a)
#19 0x0000561208aa0e0b (/opt/cross/clang-7b3d307288/bin/clang-14+0x3e26e0b)
#20 0x0000561205d05914 cc1_main(llvm::ArrayRef<char char (/opt/cross/clang-7b3d307288/bin/clang-14+0x108b914)
#21 0x0000561205d02e5b ExecuteCC1Tool(llvm::SmallVectorImpl<char driver.cpp:0:0
#22 0x000056120880f8a5 void llvm::function_ref<void ()>::callback_fn<clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> const::'lambda'()>(long) Job.cpp:0:0
#23 0x0000561207fdb603 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/opt/cross/clang-7b3d307288/bin/clang-14+0x3361603)
#24 0x000056120881019e clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> const (.part.216) Job.cpp:0:0
#25 0x00005612087e6877 clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const (/opt/cross/clang-7b3d307288/bin/clang-14+0x3b6c877)
#26 0x00005612087e7257 clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command >&) const (/opt/cross/clang-7b3d307288/bin/clang-14+0x3b6d257)
#27 0x00005612087f0bc9 clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command >&) (/opt/cross/clang-7b3d307288/bin/clang-14+0x3b76bc9)
#28 0x0000561205c2d25f main (/opt/cross/clang-7b3d307288/bin/clang-14+0xfb325f)
#29 0x00007faabc246d0a __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x26d0a)
#30 0x0000561205d0297a _start (/opt/cross/clang-7b3d307288/bin/clang-14+0x108897a)
clang-14: error: clang frontend command failed with exit code 70 (use -v to see invocation)
clang version 14.0.0 (git://gitmirror/llvm_project 7b3d30728816403d1fd73cc5082e9fb761262bce)
Target: mips-unknown-linux
Thread model: posix
InstalledDir: /opt/cross/clang-7b3d307288/bin
clang-14: note: diagnostic msg:
Makefile arch block certs crypto drivers fs include init ipc kernel lib mm net scripts security sound source usr virt


vim +/ctx_test_flags +2295 fs/ext4/super.c

2294
> 2295 EXT4_SET_CTX(flags);
2296 EXT4_SET_CTX(mount_opt);
2297 EXT4_SET_CTX(mount_opt2);
> 2298 EXT4_SET_CTX(mount_flags);
2299

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx