Building the Linux kernel with Clang and LLVM
 help / color / mirror / Atom feed
* [sysctl:sysctl-testing 8/16] mm/nommu.c:394:12: error: static declaration of 'sysctl_nr_trim_pages' follows non-static declaration
@ 2025-01-14 18:39 kernel test robot
  2025-01-15  8:14 ` yukaixiong
  0 siblings, 1 reply; 8+ messages in thread
From: kernel test robot @ 2025-01-14 18:39 UTC (permalink / raw)
  To: Kaixiong Yu; +Cc: llvm, oe-kbuild-all, Joel Granados, Lorenzo Stoakes

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/sysctl/sysctl.git sysctl-testing
head:   2fc99f285719e0cce8df1fe21479cb9e6626c2fe
commit: 0450345eca3ca45264db9ab09d31281e001236b7 [8/16] mm: nommu: move sysctl to mm/nommu.c
config: arm-randconfig-001-20250115 (https://download.01.org/0day-ci/archive/20250115/202501150216.3RVz44uS-lkp@intel.com/config)
compiler: clang version 16.0.6 (https://github.com/llvm/llvm-project 7cbf1a2591520c2491aa35339f227775f4d3adf6)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250115/202501150216.3RVz44uS-lkp@intel.com/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@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202501150216.3RVz44uS-lkp@intel.com/

All errors (new ones prefixed by >>):

>> mm/nommu.c:394:12: error: static declaration of 'sysctl_nr_trim_pages' follows non-static declaration
   static int sysctl_nr_trim_pages = CONFIG_NOMMU_INITIAL_TRIM_EXCESS;
              ^
   include/linux/mm.h:4082:12: note: previous declaration is here
   extern int sysctl_nr_trim_pages;
              ^
   1 error generated.


vim +/sysctl_nr_trim_pages +394 mm/nommu.c

   393	
 > 394	static int sysctl_nr_trim_pages = CONFIG_NOMMU_INITIAL_TRIM_EXCESS;
   395	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [sysctl:sysctl-testing 8/16] mm/nommu.c:394:12: error: static declaration of 'sysctl_nr_trim_pages' follows non-static declaration
  2025-01-14 18:39 [sysctl:sysctl-testing 8/16] mm/nommu.c:394:12: error: static declaration of 'sysctl_nr_trim_pages' follows non-static declaration kernel test robot
@ 2025-01-15  8:14 ` yukaixiong
  2025-01-15 10:55   ` Miguel Ojeda
  2025-01-16 10:57   ` Joel Granados
  0 siblings, 2 replies; 8+ messages in thread
From: yukaixiong @ 2025-01-15  8:14 UTC (permalink / raw)
  To: Joel Granados; +Cc: llvm, oe-kbuild-all, Joel Granados, Lorenzo Stoakes



On 2025/1/15 2:39, kernel test robot wrote:
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/sysctl/sysctl.git sysctl-testing
> head:   2fc99f285719e0cce8df1fe21479cb9e6626c2fe
> commit: 0450345eca3ca45264db9ab09d31281e001236b7 [8/16] mm: nommu: move sysctl to mm/nommu.c
> config: arm-randconfig-001-20250115 (https://download.01.org/0day-ci/archive/20250115/202501150216.3RVz44uS-lkp@intel.com/config)
> compiler: clang version 16.0.6 (https://github.com/llvm/llvm-project 7cbf1a2591520c2491aa35339f227775f4d3adf6)
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250115/202501150216.3RVz44uS-lkp@intel.com/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@intel.com>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202501150216.3RVz44uS-lkp@intel.com/
>
> All errors (new ones prefixed by >>):
>
>>> mm/nommu.c:394:12: error: static declaration of 'sysctl_nr_trim_pages' follows non-static declaration
>     static int sysctl_nr_trim_pages = CONFIG_NOMMU_INITIAL_TRIM_EXCESS;
>                ^
>     include/linux/mm.h:4082:12: note: previous declaration is here
>     extern int sysctl_nr_trim_pages;
>                ^
>     1 error generated.
Help me!

Hi all;

         I have deleted the line : "extern int sysctl_nr_trim_pages;" in 
patch8 of v5. Why still produce this error? I don't understand!

Due to the environment configuration of the server, I have not installed 
the necessary setup for compilation and testing as mentioned in
download.01.org/0day-ci/archive/20250115/202501150216.3RVz44uS-lkp@intel.com/reproduce. 
But I compile the code with the config
as same as 
https://download.01.org/0day-ci/archive/20250115/202501150216.3RVz44uS-lkp@intel.com/config, 
and didn't find the error.

my environment as shown as below:
Linux ubuntu-2288H 5.13.0-40-generic #45~20.04.1-Ubuntu SMP Mon Apr 4 
09:38:31 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

The compile steps as below:

1. export ARCH=arm;export CROSS_COMPILE=arm-linux-gnueabihf-
2. cp ../stm32_config.log ./.config
3. make ARCH=arm olddefconfig
4. make -j200

the content of stm32_config.log is same as 
https://download.01.org/0day-ci/archive/20250115/202501150216.3RVz44uS-lkp@intel.com/config.
no error as shown above. the compile result as  below shown:

yukaixiong@ubuntu-2288H:~/linux_next/linux-next$ file arch/arm/boot/zImage
arch/arm/boot/zImage: Linux kernel ARM boot executable zImage 
(little-endian)
yukaixiong@ubuntu-2288H:~/linux_next/linux-next$ file ./mm/nommu.o
./mm/nommu.o: ELF 32-bit LSB relocatable, ARM, EABI5 version 1 (SYSV), 
with debug_info, not stripped

Can you tell me the reason for the error? It would be best if you could 
directly tell me how to fix it.
Can I fix this error by "git send-email -in-reply-to xxxxx" so that I 
don't need to send a new version?

Thank you so much!
>
> vim +/sysctl_nr_trim_pages +394 mm/nommu.c
>
>     393	
>   > 394	static int sysctl_nr_trim_pages = CONFIG_NOMMU_INITIAL_TRIM_EXCESS;
>     395	
>


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [sysctl:sysctl-testing 8/16] mm/nommu.c:394:12: error: static declaration of 'sysctl_nr_trim_pages' follows non-static declaration
  2025-01-15  8:14 ` yukaixiong
@ 2025-01-15 10:55   ` Miguel Ojeda
  2025-01-15 14:23     ` Nathan Chancellor
  2025-01-16 10:57   ` Joel Granados
  1 sibling, 1 reply; 8+ messages in thread
From: Miguel Ojeda @ 2025-01-15 10:55 UTC (permalink / raw)
  To: yukaixiong; +Cc: Joel Granados, llvm, oe-kbuild-all, Lorenzo Stoakes

On Wed, Jan 15, 2025 at 9:14 AM yukaixiong <yukaixiong@huawei.com> wrote:
>
>          I have deleted the line : "extern int sysctl_nr_trim_pages;" in
> patch8 of v5. Why still produce this error? I don't understand!

As far as I understand, the report is against the tree mentioned in
the report, not against a patch series. So I would recommend checking
the tree to see what it contains (e.g. what version).

> The compile steps as below:
>
> 1. export ARCH=arm;export CROSS_COMPILE=arm-linux-gnueabihf-
> 2. cp ../stm32_config.log ./.config
> 3. make ARCH=arm olddefconfig
> 4. make -j200

Are you using Clang (ideally the same version) and `W=1` to match the report?

I hope that helps.

Cheers,
Miguel

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [sysctl:sysctl-testing 8/16] mm/nommu.c:394:12: error: static declaration of 'sysctl_nr_trim_pages' follows non-static declaration
  2025-01-15 10:55   ` Miguel Ojeda
@ 2025-01-15 14:23     ` Nathan Chancellor
  2025-01-16  2:05       ` yukaixiong
  0 siblings, 1 reply; 8+ messages in thread
From: Nathan Chancellor @ 2025-01-15 14:23 UTC (permalink / raw)
  To: yukaixiong, Joel Granados
  Cc: Miguel Ojeda, llvm, oe-kbuild-all, Lorenzo Stoakes

On Wed, Jan 15, 2025 at 11:55:02AM +0100, Miguel Ojeda wrote:
> On Wed, Jan 15, 2025 at 9:14 AM yukaixiong <yukaixiong@huawei.com> wrote:
> >
> >          I have deleted the line : "extern int sysctl_nr_trim_pages;" in
> > patch8 of v5. Why still produce this error? I don't understand!
> 
> As far as I understand, the report is against the tree mentioned in
> the report, not against a patch series. So I would recommend checking
> the tree to see what it contains (e.g. what version).

This is the key. The version of the patch in the tree:

https://git.kernel.org/pub/scm/linux/kernel/git/sysctl/sysctl.git/commit/?id=0450345eca3ca45264db9ab09d31281e001236b7

is missing the hunk from include/linux/mm.h that was in the patch on the
mailing list:

https://lore.kernel.org/20250111070751.2588654-9-yukaixiong@huawei.com/

Was there a conflict at application time? Seems like this is something
Joel will likely need to sort out.

Cheers,
Nathan

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [sysctl:sysctl-testing 8/16] mm/nommu.c:394:12: error: static declaration of 'sysctl_nr_trim_pages' follows non-static declaration
  2025-01-15 14:23     ` Nathan Chancellor
@ 2025-01-16  2:05       ` yukaixiong
  2025-01-16 10:58         ` Joel Granados
  0 siblings, 1 reply; 8+ messages in thread
From: yukaixiong @ 2025-01-16  2:05 UTC (permalink / raw)
  To: Nathan Chancellor, Joel Granados
  Cc: Miguel Ojeda, llvm, oe-kbuild-all, Lorenzo Stoakes



On 2025/1/15 22:23, Nathan Chancellor wrote:
> On Wed, Jan 15, 2025 at 11:55:02AM +0100, Miguel Ojeda wrote:
>> On Wed, Jan 15, 2025 at 9:14 AM yukaixiong <yukaixiong@huawei.com> wrote:
>>>           I have deleted the line : "extern int sysctl_nr_trim_pages;" in
>>> patch8 of v5. Why still produce this error? I don't understand!
>> As far as I understand, the report is against the tree mentioned in
>> the report, not against a patch series. So I would recommend checking
>> the tree to see what it contains (e.g. what version).
> This is the key. The version of the patch in the tree:
>
> https://git.kernel.org/pub/scm/linux/kernel/git/sysctl/sysctl.git/commit/?id=0450345eca3ca45264db9ab09d31281e001236b7
>
> is missing the hunk from include/linux/mm.h that was in the patch on the
> mailing list:
>
> https://lore.kernel.org/20250111070751.2588654-9-yukaixiong@huawei.com/
>
> Was there a conflict at application time? Seems like this is something
> Joel will likely need to sort out.
>
> Cheers,
> Nathan
> .
Right!Waiting for Joel's reply.

Best ...


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Re: [sysctl:sysctl-testing 8/16] mm/nommu.c:394:12: error: static declaration of 'sysctl_nr_trim_pages' follows non-static declaration
  2025-01-15  8:14 ` yukaixiong
  2025-01-15 10:55   ` Miguel Ojeda
@ 2025-01-16 10:57   ` Joel Granados
  1 sibling, 0 replies; 8+ messages in thread
From: Joel Granados @ 2025-01-16 10:57 UTC (permalink / raw)
  To: yukaixiong; +Cc: llvm, oe-kbuild-all, Lorenzo Stoakes

On Wed, Jan 15, 2025 at 04:14:09PM +0800, yukaixiong wrote:
> 
> 
> On 2025/1/15 2:39, kernel test robot wrote:
> > tree:   https://git.kernel.org/pub/scm/linux/kernel/git/sysctl/sysctl.git sysctl-testing
> > head:   2fc99f285719e0cce8df1fe21479cb9e6626c2fe
> > commit: 0450345eca3ca45264db9ab09d31281e001236b7 [8/16] mm: nommu: move sysctl to mm/nommu.c
> > config: arm-randconfig-001-20250115 (https://download.01.org/0day-ci/archive/20250115/202501150216.3RVz44uS-lkp@intel.com/config)
> > compiler: clang version 16.0.6 (https://github.com/llvm/llvm-project 7cbf1a2591520c2491aa35339f227775f4d3adf6)
> > reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250115/202501150216.3RVz44uS-lkp@intel.com/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@intel.com>
> > | Closes: https://lore.kernel.org/oe-kbuild-all/202501150216.3RVz44uS-lkp@intel.com/
> > 
> > All errors (new ones prefixed by >>):
> > 
> > > > mm/nommu.c:394:12: error: static declaration of 'sysctl_nr_trim_pages' follows non-static declaration
> >     static int sysctl_nr_trim_pages = CONFIG_NOMMU_INITIAL_TRIM_EXCESS;
> >                ^
> >     include/linux/mm.h:4082:12: note: previous declaration is here
> >     extern int sysctl_nr_trim_pages;
> >                ^
> >     1 error generated.
> Help me!
> 
> Hi all;
> 
>         I have deleted the line : "extern int sysctl_nr_trim_pages;" in
> patch8 of v5. Why still produce this error? I don't understand!
Because I messed up and re-introduced the line when I resolved a merge
conflict.

> 
> Due to the environment configuration of the server, I have not installed the
> necessary setup for compilation and testing as mentioned in
> download.01.org/0day-ci/archive/20250115/202501150216.3RVz44uS-lkp@intel.com/reproduce.
> But I compile the code with the config
> as same as https://download.01.org/0day-ci/archive/20250115/202501150216.3RVz44uS-lkp@intel.com/config,
> and didn't find the error.
That is exactly my experience as well. But this is why we have the CI
that does a bigger sweep of configurations that I/we don't have.

> 
> my environment as shown as below:
> Linux ubuntu-2288H 5.13.0-40-generic #45~20.04.1-Ubuntu SMP Mon Apr 4
> 09:38:31 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
> 
> The compile steps as below:
> 
> 1. export ARCH=arm;export CROSS_COMPILE=arm-linux-gnueabihf-
> 2. cp ../stm32_config.log ./.config
> 3. make ARCH=arm olddefconfig
> 4. make -j200
> 
> the content of stm32_config.log is same as https://download.01.org/0day-ci/archive/20250115/202501150216.3RVz44uS-lkp@intel.com/config.
> no error as shown above. the compile result as  below shown:
> 
> yukaixiong@ubuntu-2288H:~/linux_next/linux-next$ file arch/arm/boot/zImage
> arch/arm/boot/zImage: Linux kernel ARM boot executable zImage
> (little-endian)
> yukaixiong@ubuntu-2288H:~/linux_next/linux-next$ file ./mm/nommu.o
> ./mm/nommu.o: ELF 32-bit LSB relocatable, ARM, EABI5 version 1 (SYSV), with
> debug_info, not stripped
> 
> Can you tell me the reason for the error? It would be best if you could
> directly tell me how to fix it.
Not on your side. I introduced and fixed the error. No worries.

> Can I fix this error by "git send-email -in-reply-to xxxxx" so that I don't
> need to send a new version?
Please do *not* send a new version. Your V5 did not have the error and
there is NO need to resend.

Best


-- 

Joel Granados

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Re: [sysctl:sysctl-testing 8/16] mm/nommu.c:394:12: error: static declaration of 'sysctl_nr_trim_pages' follows non-static declaration
  2025-01-16  2:05       ` yukaixiong
@ 2025-01-16 10:58         ` Joel Granados
  2025-01-16 11:07           ` yukaixiong
  0 siblings, 1 reply; 8+ messages in thread
From: Joel Granados @ 2025-01-16 10:58 UTC (permalink / raw)
  To: yukaixiong
  Cc: Nathan Chancellor, Miguel Ojeda, llvm, oe-kbuild-all,
	Lorenzo Stoakes

On Thu, Jan 16, 2025 at 10:05:27AM +0800, yukaixiong wrote:
> 
> 
> On 2025/1/15 22:23, Nathan Chancellor wrote:
> > On Wed, Jan 15, 2025 at 11:55:02AM +0100, Miguel Ojeda wrote:
> > > On Wed, Jan 15, 2025 at 9:14 AM yukaixiong <yukaixiong@huawei.com> wrote:
> > > >           I have deleted the line : "extern int sysctl_nr_trim_pages;" in
> > > > patch8 of v5. Why still produce this error? I don't understand!
> > > As far as I understand, the report is against the tree mentioned in
> > > the report, not against a patch series. So I would recommend checking
> > > the tree to see what it contains (e.g. what version).
> > This is the key. The version of the patch in the tree:
> > 
> > https://git.kernel.org/pub/scm/linux/kernel/git/sysctl/sysctl.git/commit/?id=0450345eca3ca45264db9ab09d31281e001236b7
> > 
> > is missing the hunk from include/linux/mm.h that was in the patch on the
> > mailing list:
> > 
> > https://lore.kernel.org/20250111070751.2588654-9-yukaixiong@huawei.com/
> > 
> > Was there a conflict at application time? Seems like this is something
> > Joel will likely need to sort out.
> > 
> > Cheers,
> > Nathan
> > .
> Right!Waiting for Joel's reply.
Should be OK now.



-- 

Joel Granados

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [sysctl:sysctl-testing 8/16] mm/nommu.c:394:12: error: static declaration of 'sysctl_nr_trim_pages' follows non-static declaration
  2025-01-16 10:58         ` Joel Granados
@ 2025-01-16 11:07           ` yukaixiong
  0 siblings, 0 replies; 8+ messages in thread
From: yukaixiong @ 2025-01-16 11:07 UTC (permalink / raw)
  To: Joel Granados
  Cc: Nathan Chancellor, Miguel Ojeda, llvm, oe-kbuild-all,
	Lorenzo Stoakes



On 2025/1/16 18:58, Joel Granados wrote:
> On Thu, Jan 16, 2025 at 10:05:27AM +0800, yukaixiong wrote:
>>
>> On 2025/1/15 22:23, Nathan Chancellor wrote:
>>> On Wed, Jan 15, 2025 at 11:55:02AM +0100, Miguel Ojeda wrote:
>>>> On Wed, Jan 15, 2025 at 9:14 AM yukaixiong <yukaixiong@huawei.com> wrote:
>>>>>            I have deleted the line : "extern int sysctl_nr_trim_pages;" in
>>>>> patch8 of v5. Why still produce this error? I don't understand!
>>>> As far as I understand, the report is against the tree mentioned in
>>>> the report, not against a patch series. So I would recommend checking
>>>> the tree to see what it contains (e.g. what version).
>>> This is the key. The version of the patch in the tree:
>>>
>>> https://git.kernel.org/pub/scm/linux/kernel/git/sysctl/sysctl.git/commit/?id=0450345eca3ca45264db9ab09d31281e001236b7
>>>
>>> is missing the hunk from include/linux/mm.h that was in the patch on the
>>> mailing list:
>>>
>>> https://lore.kernel.org/20250111070751.2588654-9-yukaixiong@huawei.com/
>>>
>>> Was there a conflict at application time? Seems like this is something
>>> Joel will likely need to sort out.
>>>
>>> Cheers,
>>> Nathan
>>> .
>> Right!Waiting for Joel's reply.
> Should be OK now.
>
>
Thx

Best ...


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2025-01-16 11:07 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-14 18:39 [sysctl:sysctl-testing 8/16] mm/nommu.c:394:12: error: static declaration of 'sysctl_nr_trim_pages' follows non-static declaration kernel test robot
2025-01-15  8:14 ` yukaixiong
2025-01-15 10:55   ` Miguel Ojeda
2025-01-15 14:23     ` Nathan Chancellor
2025-01-16  2:05       ` yukaixiong
2025-01-16 10:58         ` Joel Granados
2025-01-16 11:07           ` yukaixiong
2025-01-16 10:57   ` Joel Granados

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox