* [PATCH v2] seqlock: Fix build errors
@ 2020-08-14 4:12 Xingxing Su
2020-08-14 8:35 ` Peter Zijlstra
0 siblings, 1 reply; 4+ messages in thread
From: Xingxing Su @ 2020-08-14 4:12 UTC (permalink / raw)
To: Peter Zijlstra, Ingo Molnar, Will Deacon; +Cc: linux-kernel
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=y, Size: 1450 bytes --]
Fix the following build errors:
In file included from ./include/linux/time.h:6:0,
from ./include/linux/compat.h:10,
from arch/mips/kernel/asm-offsets.c:12:
./include/linux/seqlock.h: In function ‘write_seqcount_begin_nested’:
./include/linux/seqlock.h:286:2: error: implicit declaration of function
‘raw_smp_processor_id’ [-Werror=implicit-function-declaration]
lockdep_assert_preemption_disabled();
^
./arch/mips/include/asm/smp.h: At top level:
./arch/mips/include/asm/smp.h:28:19: error: static declaration of
‘raw_smp_processor_id’ follows non-static declaration
static inline int raw_smp_processor_id(void)
^
cc1: some warnings being treated as errors
scripts/Makefile.build:117: recipe for target 'arch/mips/kernel/asm-offsets.s' failed
make[1]: *** [arch/mips/kernel/asm-offsets.s] Error 1
arch/mips/Makefile:396: recipe for target 'archprepare' failed
make: *** [archprepare] Error 2
Signed-off-by: Xingxing Su <suxingxing@loongson.cn>
---
v2: update the commit message
include/linux/seqlock.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/include/linux/seqlock.h b/include/linux/seqlock.h
index 54bc204..4763c13 100644
--- a/include/linux/seqlock.h
+++ b/include/linux/seqlock.h
@@ -17,6 +17,7 @@
#include <linux/lockdep.h>
#include <linux/compiler.h>
#include <linux/kcsan-checks.h>
+#include <linux/smp.h>
#include <asm/processor.h>
/*
--
2.1.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v2] seqlock: Fix build errors
2020-08-14 4:12 [PATCH v2] seqlock: Fix build errors Xingxing Su
@ 2020-08-14 8:35 ` Peter Zijlstra
2020-08-14 10:20 ` Ingo Molnar
2020-08-14 10:30 ` Xingxing Su
0 siblings, 2 replies; 4+ messages in thread
From: Peter Zijlstra @ 2020-08-14 8:35 UTC (permalink / raw)
To: Xingxing Su; +Cc: Ingo Molnar, Will Deacon, linux-kernel
On Fri, Aug 14, 2020 at 12:12:38PM +0800, Xingxing Su wrote:
> Fix the following build errors:
>
> In file included from ./include/linux/time.h:6:0,
> from ./include/linux/compat.h:10,
> from arch/mips/kernel/asm-offsets.c:12:
> ./include/linux/seqlock.h: In function ‘write_seqcount_begin_nested’:
> ./include/linux/seqlock.h:286:2: error: implicit declaration of function
> ‘raw_smp_processor_id’ [-Werror=implicit-function-declaration]
> lockdep_assert_preemption_disabled();
> ^
> ./arch/mips/include/asm/smp.h: At top level:
> ./arch/mips/include/asm/smp.h:28:19: error: static declaration of
> ‘raw_smp_processor_id’ follows non-static declaration
> static inline int raw_smp_processor_id(void)
> ^
> cc1: some warnings being treated as errors
> scripts/Makefile.build:117: recipe for target 'arch/mips/kernel/asm-offsets.s' failed
> make[1]: *** [arch/mips/kernel/asm-offsets.s] Error 1
> arch/mips/Makefile:396: recipe for target 'archprepare' failed
> make: *** [archprepare] Error 2
>
What kernel are you building?
Commit 0cd39f4600ed ("locking/seqlock, headers: Untangle the spaghetti monster")
should have solved that I think.
>
> Signed-off-by: Xingxing Su <suxingxing@loongson.cn>
> ---
> v2: update the commit message
>
> include/linux/seqlock.h | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/include/linux/seqlock.h b/include/linux/seqlock.h
> index 54bc204..4763c13 100644
> --- a/include/linux/seqlock.h
> +++ b/include/linux/seqlock.h
> @@ -17,6 +17,7 @@
> #include <linux/lockdep.h>
> #include <linux/compiler.h>
> #include <linux/kcsan-checks.h>
> +#include <linux/smp.h>
> #include <asm/processor.h>
Wrong place, it's lockdep_assert_preemption_disabled() that requires
asm/percpu.h, and thus lockdep.h should include linux/smp. before
asm/percpu.h
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] seqlock: Fix build errors
2020-08-14 8:35 ` Peter Zijlstra
@ 2020-08-14 10:20 ` Ingo Molnar
2020-08-14 10:30 ` Xingxing Su
1 sibling, 0 replies; 4+ messages in thread
From: Ingo Molnar @ 2020-08-14 10:20 UTC (permalink / raw)
To: Peter Zijlstra; +Cc: Xingxing Su, Ingo Molnar, Will Deacon, linux-kernel
* Peter Zijlstra <peterz@infradead.org> wrote:
> > Signed-off-by: Xingxing Su <suxingxing@loongson.cn>
> > ---
> > v2: update the commit message
> >
> > include/linux/seqlock.h | 1 +
> > 1 file changed, 1 insertion(+)
> >
> > diff --git a/include/linux/seqlock.h b/include/linux/seqlock.h
> > index 54bc204..4763c13 100644
> > --- a/include/linux/seqlock.h
> > +++ b/include/linux/seqlock.h
> > @@ -17,6 +17,7 @@
> > #include <linux/lockdep.h>
> > #include <linux/compiler.h>
> > #include <linux/kcsan-checks.h>
> > +#include <linux/smp.h>
> > #include <asm/processor.h>
>
> Wrong place, it's lockdep_assert_preemption_disabled() that requires
> asm/percpu.h, and thus lockdep.h should include linux/smp. before
> asm/percpu.h
It already does that upstream:
#ifndef __LINUX_LOCKDEP_H
#define __LINUX_LOCKDEP_H
#include <linux/lockdep_types.h>
#include <linux/smp.h>
#include <asm/percpu.h>
So it would be interesting to know what kernel version the build error
occurs on.
Thanks,
Ingo
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] seqlock: Fix build errors
2020-08-14 8:35 ` Peter Zijlstra
2020-08-14 10:20 ` Ingo Molnar
@ 2020-08-14 10:30 ` Xingxing Su
1 sibling, 0 replies; 4+ messages in thread
From: Xingxing Su @ 2020-08-14 10:30 UTC (permalink / raw)
To: Peter Zijlstra; +Cc: Ingo Molnar, Will Deacon, linux-kernel
On 08/14/2020 04:35 PM, Peter Zijlstra wrote:
> On Fri, Aug 14, 2020 at 12:12:38PM +0800, Xingxing Su wrote:
>> Fix the following build errors:
>>
>> In file included from ./include/linux/time.h:6:0,
>> from ./include/linux/compat.h:10,
>> from arch/mips/kernel/asm-offsets.c:12:
>> ./include/linux/seqlock.h: In function ‘write_seqcount_begin_nested’:
>> ./include/linux/seqlock.h:286:2: error: implicit declaration of function
>> ‘raw_smp_processor_id’ [-Werror=implicit-function-declaration]
>> lockdep_assert_preemption_disabled();
>> ^
>> ./arch/mips/include/asm/smp.h: At top level:
>> ./arch/mips/include/asm/smp.h:28:19: error: static declaration of
>> ‘raw_smp_processor_id’ follows non-static declaration
>> static inline int raw_smp_processor_id(void)
>> ^
>> cc1: some warnings being treated as errors
>> scripts/Makefile.build:117: recipe for target 'arch/mips/kernel/asm-offsets.s' failed
>> make[1]: *** [arch/mips/kernel/asm-offsets.s] Error 1
>> arch/mips/Makefile:396: recipe for target 'archprepare' failed
>> make: *** [archprepare] Error 2
>>
> What kernel are you building?
>
> Commit 0cd39f4600ed ("locking/seqlock, headers: Untangle the spaghetti monster")
>
> should have solved that I think.
>
>> Signed-off-by: Xingxing Su <suxingxing@loongson.cn>
>> ---
>> v2: update the commit message
>>
>> include/linux/seqlock.h | 1 +
>> 1 file changed, 1 insertion(+)
>>
>> diff --git a/include/linux/seqlock.h b/include/linux/seqlock.h
>> index 54bc204..4763c13 100644
>> --- a/include/linux/seqlock.h
>> +++ b/include/linux/seqlock.h
>> @@ -17,6 +17,7 @@
>> #include <linux/lockdep.h>
>> #include <linux/compiler.h>
>> #include <linux/kcsan-checks.h>
>> +#include <linux/smp.h>
>> #include <asm/processor.h>
> Wrong place, it's lockdep_assert_preemption_disabled() that requires
> asm/percpu.h, and thus lockdep.h should include linux/smp. before
> asm/percpu.h
Thanks for your reply, I will check it.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-08-14 10:30 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-14 4:12 [PATCH v2] seqlock: Fix build errors Xingxing Su
2020-08-14 8:35 ` Peter Zijlstra
2020-08-14 10:20 ` Ingo Molnar
2020-08-14 10:30 ` Xingxing Su
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).