On Fri, Oct 02, 2020 at 11:14:29AM +0300, Kalle Valo wrote: > + arnd > > Nathan Chancellor <natechancellor@xxxxxxxxx> writes: > > >> +int rtw_fw_dump_fifo(struct rtw_dev *rtwdev, u8 fifo_sel, u32 addr, u32 size, > >> + u32 *buffer) > >> +{ > >> + if (!rtwdev->chip->fw_fifo_addr) { > > > > This causes a clang warning, which points out it is probably not doing > > what you think it is: > > > > drivers/net/wireless/realtek/rtw88/fw.c:1485:21: warning: address of > > array 'rtwdev->chip->fw_fifo_addr' will always evaluate to 'true' > > [-Wpointer-bool-conversion] > > if (!rtwdev->chip->fw_fifo_addr) { > > ~~~~~~~~~~~~~~~^~~~~~~~~~~~ > > 1 warning generated. > > > > Was fw_fifo_addr[0] intended or should the check just be deleted? > > BTW what is the easiest way to install clang for build testing the > kernel? For GCC I use crosstool[1] which is awesome as it makes the > installation so simple, do we have something similar for clang? > > Just supporting x86 would be fine, as my use case would be just to > reproduce build warnings. > > [1] https://mirrors.edge.kernel.org/pub/tools/crosstool/ > > -- > https://patchwork.kernel.org/project/linux-wireless/list/ > > https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches Unfortunately, we do not have anything for clang right now. It is on my TODO list but being a hobbyist, I have less time than I would like... If you do not mind building it from source, I maintain a Python script that tries to optimize building LLVM as much as possible by turning off things that the kernel does not care about so that the build is quick and it does not intrude or interfere with the host environment. Something like this should work to give you a stable clang toolchain that should work well for compiling the kernel: $ git clone https://github.com/ClangBuiltLinux/tc-build $ tc-build/build-llvm.py \ --branch llvmorg-11.0.0-rc5 \ --projects "clang;lld" $ tc-build/install/bin/clang --version | head -1 ClangBuiltLinux clang version 11.0.0 (https://github.com/llvm/llvm-project 60a25202a7dd1e00067fcfce512086ebf3788537) The script by default does a 2-stage build for optimization purposes; if you cannot spare many cycles, feel free to add --build-stage1-only --install-stage1-only to the build-llvm.py invocation. The toolchain is installed to "install" within the tc-build repo and it only requires a few external dependencies (outlined in the README) that it lets you know about before doing anything. Feel free to give it a shot and let me know if anything is broken. Otherwise, as long as your distribution has clang 10.0.1 or newer, it should be fine for compiling the kernel. Cheers, Nathan