Re: [PATCH] LoongArch: Fix some build warnings with -W1 option

From: bibo mao
Date: Sat Sep 16 2023 - 06:31:19 EST




在 2023/9/16 18:07, Xi Ruoyao 写道:
> On Sat, 2023-09-16 at 17:56 +0800, bibo mao wrote:
>>
>>
>> 在 2023/9/16 17:42, Huacai Chen 写道:
>>> Hi, Bibo,
>>>
>>> On Sat, Sep 16, 2023 at 5:23 PM Bibo Mao <maobibo@xxxxxxxxxxx> wrote:
>>>>
>>>> There are some building warnings when building LoongArch kernel
>>>> with -W1 option as following, this patch fixes these building
>>>> warnings.
>>> Don't touch asm-offsets.c now, because it is being refactored by the community.
>> Well, I will bypass this file and send the next version.
>>
>> Do you think that is it deserved to add -Wno-override-init option
>> to remove compiling warning about file syscall.c? I am not sure about it.
>
> What is a -W1 option? At least GCC 13 does not recognize it.
>
> And generally you cannot randomly add warning options building the
> kernel and expect a clean result. I don't think we should "fix"
> breakages caused by custom warnings at all, unless the warning indicates
> a real issue.
it is W=1 option:), and it is reported by lkp tool like this:

kernel test robot noticed the following build errors:
[auto build test ERROR on 744a759492b5c57ff24a6e8aabe47b17ad8ee964]
url: https://github.com/intel-lab-lkp/linux/commits/Bibo-Mao/LoongArch-Add-tlb_flush_threshold-for-tlb-flush-range/20230908-093017
base: 744a759492b5c57ff24a6e8aabe47b17ad8ee964
patch link: https://lore.kernel.org/r/20230908012907.2994001-1-maobibo%40loongson.cn
patch subject: [PATCH] LoongArch: Add tlb_flush_threshold for tlb flush range
config: loongarch-randconfig-r021-20230909 (https://download.01.org/0day-ci/archive/20230909/202309090624.CrkoQ4fj-lkp@xxxxxxxxx/config)
compiler: loongarch64-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20230909/202309090624.CrkoQ4fj-lkp@xxxxxxxxx/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202309090624.CrkoQ4fj-lkp@xxxxxxxxx/

Regards
Bibo Mao

>
>