linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* linux-next: build failure after merge of the modules tree
@ 2021-02-09 10:08 Stephen Rothwell
  2021-02-09 15:16 ` Jessica Yu
  0 siblings, 1 reply; 43+ messages in thread
From: Stephen Rothwell @ 2021-02-09 10:08 UTC (permalink / raw)
  To: Jessica Yu
  Cc: Christoph Hellwig, Linux Kernel Mailing List, Linux Next Mailing List

[-- Attachment #1: Type: text/plain, Size: 1013 bytes --]

Hi all,

After merging the modules tree, today's linux-next build (powerpc
allyesconfig) failed like this:

In file included from include/linux/export.h:123,
                 from include/linux/linkage.h:7,
                 from arch/powerpc/include/asm/unistd.h:18,
                 from <stdin>:2:
./include/generated/autoksyms.h:5:9: warning: missing whitespace after the macro name
    5 | #define __KSYM_.HT_update_self_and_peer_setting 1
      |         ^~~~~~~
./include/generated/autoksyms.h:6:9: warning: missing whitespace after the macro name
    6 | #define __KSYM_.RemovePeerTS 1
      |         ^~~~~~~
./include/generated/autoksyms.h:6: warning: "__KSYM_" redefined
    6 | #define __KSYM_.RemovePeerTS 1
      | 
./include/generated/autoksyms.h:5: note: this is the location of the previous definition

and on and on :-(

Caused by commit

  367948220fce ("module: remove EXPORT_UNUSED_SYMBOL*")

I have reverted that commit for today.

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: linux-next: build failure after merge of the modules tree
  2021-02-09 10:08 linux-next: build failure after merge of the modules tree Stephen Rothwell
@ 2021-02-09 15:16 ` Jessica Yu
  2021-02-09 16:06   ` Christoph Hellwig
  2021-02-09 21:50   ` Stephen Rothwell
  0 siblings, 2 replies; 43+ messages in thread
From: Jessica Yu @ 2021-02-09 15:16 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Christoph Hellwig, Linux Kernel Mailing List,
	Linux Next Mailing List, Michael Ellerman, Masahiro Yamada

+++ Stephen Rothwell [09/02/21 21:08 +1100]:
>Hi all,
>
>After merging the modules tree, today's linux-next build (powerpc
>allyesconfig) failed like this:
>
>In file included from include/linux/export.h:123,
>                 from include/linux/linkage.h:7,
>                 from arch/powerpc/include/asm/unistd.h:18,
>                 from <stdin>:2:
>./include/generated/autoksyms.h:5:9: warning: missing whitespace after the macro name
>    5 | #define __KSYM_.HT_update_self_and_peer_setting 1
>      |         ^~~~~~~
>./include/generated/autoksyms.h:6:9: warning: missing whitespace after the macro name
>    6 | #define __KSYM_.RemovePeerTS 1
>      |         ^~~~~~~
>./include/generated/autoksyms.h:6: warning: "__KSYM_" redefined
>    6 | #define __KSYM_.RemovePeerTS 1
>      |
>./include/generated/autoksyms.h:5: note: this is the location of the previous definition
>
>and on and on :-(
>
>Caused by commit
>
>  367948220fce ("module: remove EXPORT_UNUSED_SYMBOL*")
>
>I have reverted that commit for today.

[ Adding Michael and Masahiro to CC ]

Hi Stephen,

Hmm, these errors don't look like it's related to that particular commit. I was
able to reproduce these weird autoksym errors even without any modules-next
patches applied, and on a clean v5.11-rc7 tree. To reproduce it,
CONFIG_TRIM_UNUSED_KSYMS needs to be enabled. I guess that's why we run into
these errors with allyesconfig. I used a gcc-7 ppc64le cross compiler and got
the same compiler warnings. It seems to not compile on powerpc properly because
it looks like some symbols have an extra dot "." prefix, for example in
kthread.o:

    168: 0000000000000318    24 NOTYPE  GLOBAL DEFAULT    6 kthread_create_worker
    169: 0000000000001d90   104 FUNC    GLOBAL DEFAULT    1 .kthread_create_worker
    170: 0000000000000330    24 NOTYPE  GLOBAL DEFAULT    6 kthread_create_worker_on_cpu
    171: 0000000000001e00    88 FUNC    GLOBAL DEFAULT    1 .kthread_create_worker_on_cpu
    172: 0000000000000348    24 NOTYPE  GLOBAL DEFAULT    6 kthread_queue_work
    173: 0000000000001e60   228 FUNC    GLOBAL DEFAULT    1 .kthread_queue_work

So I suppose this dot prefix is specific to powerpc. From the ppc64 elf abi docs:

     Symbol names with a dot (.) prefix are reserved for holding entry point
     addresses. The value of a symbol named ".FN", if it exists, is the entry point
     of the function "FN".

I guess the presence of the extra dot symbols is confusing
scripts/gen_autoksyms.sh, so we get the dot symbols in autoksyms.h, which the
preprocessor doesn't like. I am wondering how this was never caught until now
and also now curious if this feature was ever functional on powerpc..

Thanks,

Jessica

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

* Re: linux-next: build failure after merge of the modules tree
  2021-02-09 15:16 ` Jessica Yu
@ 2021-02-09 16:06   ` Christoph Hellwig
  2021-02-09 21:50   ` Stephen Rothwell
  1 sibling, 0 replies; 43+ messages in thread
From: Christoph Hellwig @ 2021-02-09 16:06 UTC (permalink / raw)
  To: Jessica Yu
  Cc: Stephen Rothwell, Christoph Hellwig, Linux Kernel Mailing List,
	Linux Next Mailing List, Michael Ellerman, Masahiro Yamada

On Tue, Feb 09, 2021 at 04:16:20PM +0100, Jessica Yu wrote:
> Hmm, these errors don't look like it's related to that particular commit. I was
> able to reproduce these weird autoksym errors even without any modules-next
> patches applied, and on a clean v5.11-rc7 tree.

I OTOH can't reproduce it at all with either linux-next or module-next
and the powerpc allyesconfig..

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

* Re: linux-next: build failure after merge of the modules tree
  2021-02-09 15:16 ` Jessica Yu
  2021-02-09 16:06   ` Christoph Hellwig
@ 2021-02-09 21:50   ` Stephen Rothwell
  2021-02-10  8:06     ` Jessica Yu
  1 sibling, 1 reply; 43+ messages in thread
From: Stephen Rothwell @ 2021-02-09 21:50 UTC (permalink / raw)
  To: Jessica Yu
  Cc: Christoph Hellwig, Linux Kernel Mailing List,
	Linux Next Mailing List, Michael Ellerman, Masahiro Yamada

[-- Attachment #1: Type: text/plain, Size: 2107 bytes --]

Hi Jessica,

On Tue, 9 Feb 2021 16:16:20 +0100 Jessica Yu <jeyu@kernel.org> wrote:
>
> Hmm, these errors don't look like it's related to that particular commit. I was

I found this commit by bisection and then tested by reverting it.

Before this commit, CONFIG_TRIM_UNUSED_KSYMS would not be set in the
allyesconfig build because CONFIG_UNUSED_SYMBOLS was set.  After this
commit, CONFIG_TRIM_UNUSED_KSYMS will be set in the allyesconfig build.

> able to reproduce these weird autoksym errors even without any modules-next
> patches applied, and on a clean v5.11-rc7 tree. To reproduce it,
> CONFIG_TRIM_UNUSED_KSYMS needs to be enabled. I guess that's why we run into
> these errors with allyesconfig. I used a gcc-7 ppc64le cross compiler and got
> the same compiler warnings. It seems to not compile on powerpc properly because
> it looks like some symbols have an extra dot "." prefix, for example in
> kthread.o:
> 
>     168: 0000000000000318    24 NOTYPE  GLOBAL DEFAULT    6 kthread_create_worker
>     169: 0000000000001d90   104 FUNC    GLOBAL DEFAULT    1 .kthread_create_worker
>     170: 0000000000000330    24 NOTYPE  GLOBAL DEFAULT    6 kthread_create_worker_on_cpu
>     171: 0000000000001e00    88 FUNC    GLOBAL DEFAULT    1 .kthread_create_worker_on_cpu
>     172: 0000000000000348    24 NOTYPE  GLOBAL DEFAULT    6 kthread_queue_work
>     173: 0000000000001e60   228 FUNC    GLOBAL DEFAULT    1 .kthread_queue_work
> 
> So I suppose this dot prefix is specific to powerpc. From the ppc64 elf abi docs:
> 
>      Symbol names with a dot (.) prefix are reserved for holding entry point
>      addresses. The value of a symbol named ".FN", if it exists, is the entry point
>      of the function "FN".
> 
> I guess the presence of the extra dot symbols is confusing
> scripts/gen_autoksyms.sh, so we get the dot symbols in autoksyms.h, which the
> preprocessor doesn't like. I am wondering how this was never caught until now
> and also now curious if this feature was ever functional on powerpc..

Which feature?

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: linux-next: build failure after merge of the modules tree
  2021-02-09 21:50   ` Stephen Rothwell
@ 2021-02-10  8:06     ` Jessica Yu
  2021-02-10  8:37       ` Masahiro Yamada
  2021-02-10 12:21       ` Stephen Rothwell
  0 siblings, 2 replies; 43+ messages in thread
From: Jessica Yu @ 2021-02-10  8:06 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Christoph Hellwig, Linux Kernel Mailing List,
	Linux Next Mailing List, Michael Ellerman, Masahiro Yamada

+++ Stephen Rothwell [10/02/21 08:50 +1100]:
>Hi Jessica,
>
>On Tue, 9 Feb 2021 16:16:20 +0100 Jessica Yu <jeyu@kernel.org> wrote:
>>
>> Hmm, these errors don't look like it's related to that particular commit. I was
>
>I found this commit by bisection and then tested by reverting it.
>
>Before this commit, CONFIG_TRIM_UNUSED_KSYMS would not be set in the
>allyesconfig build because CONFIG_UNUSED_SYMBOLS was set.  After this
>commit, CONFIG_TRIM_UNUSED_KSYMS will be set in the allyesconfig build.

Ah, that makes sense then. I would get the error on powerpc whenever
CONFIG_TRIM_UNUSED_KSYMS was enabled.

>> able to reproduce these weird autoksym errors even without any modules-next
>> patches applied, and on a clean v5.11-rc7 tree. To reproduce it,
>> CONFIG_TRIM_UNUSED_KSYMS needs to be enabled. I guess that's why we run into
>> these errors with allyesconfig. I used a gcc-7 ppc64le cross compiler and got
>> the same compiler warnings. It seems to not compile on powerpc properly because
>> it looks like some symbols have an extra dot "." prefix, for example in
>> kthread.o:
>>
>>     168: 0000000000000318    24 NOTYPE  GLOBAL DEFAULT    6 kthread_create_worker
>>     169: 0000000000001d90   104 FUNC    GLOBAL DEFAULT    1 .kthread_create_worker
>>     170: 0000000000000330    24 NOTYPE  GLOBAL DEFAULT    6 kthread_create_worker_on_cpu
>>     171: 0000000000001e00    88 FUNC    GLOBAL DEFAULT    1 .kthread_create_worker_on_cpu
>>     172: 0000000000000348    24 NOTYPE  GLOBAL DEFAULT    6 kthread_queue_work
>>     173: 0000000000001e60   228 FUNC    GLOBAL DEFAULT    1 .kthread_queue_work
>>
>> So I suppose this dot prefix is specific to powerpc. From the ppc64 elf abi docs:
>>
>>      Symbol names with a dot (.) prefix are reserved for holding entry point
>>      addresses. The value of a symbol named ".FN", if it exists, is the entry point
>>      of the function "FN".
>>
>> I guess the presence of the extra dot symbols is confusing
>> scripts/gen_autoksyms.sh, so we get the dot symbols in autoksyms.h, which the
>> preprocessor doesn't like. I am wondering how this was never caught until now
>> and also now curious if this feature was ever functional on powerpc..
>
>Which feature?

Sorry, by "feature" I meant CONFIG_TRIM_UNUSED_KSYMS. This config
option was introduced around v4.7. If simply enabling it produces
these compilation errors I was wondering if it ever built properly on
powerpc.

Thanks,

Jessica

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

* Re: linux-next: build failure after merge of the modules tree
  2021-02-10  8:06     ` Jessica Yu
@ 2021-02-10  8:37       ` Masahiro Yamada
  2021-02-11  6:19         ` Masahiro Yamada
  2021-02-10 12:21       ` Stephen Rothwell
  1 sibling, 1 reply; 43+ messages in thread
From: Masahiro Yamada @ 2021-02-10  8:37 UTC (permalink / raw)
  To: Jessica Yu
  Cc: Stephen Rothwell, Christoph Hellwig, Linux Kernel Mailing List,
	Linux Next Mailing List, Michael Ellerman

On Wed, Feb 10, 2021 at 5:06 PM Jessica Yu <jeyu@kernel.org> wrote:
>
> +++ Stephen Rothwell [10/02/21 08:50 +1100]:
> >Hi Jessica,
> >
> >On Tue, 9 Feb 2021 16:16:20 +0100 Jessica Yu <jeyu@kernel.org> wrote:
> >>
> >> Hmm, these errors don't look like it's related to that particular commit. I was
> >
> >I found this commit by bisection and then tested by reverting it.
> >
> >Before this commit, CONFIG_TRIM_UNUSED_KSYMS would not be set in the
> >allyesconfig build because CONFIG_UNUSED_SYMBOLS was set.  After this
> >commit, CONFIG_TRIM_UNUSED_KSYMS will be set in the allyesconfig build.
>
> Ah, that makes sense then. I would get the error on powerpc whenever
> CONFIG_TRIM_UNUSED_KSYMS was enabled.
>
> >> able to reproduce these weird autoksym errors even without any modules-next
> >> patches applied, and on a clean v5.11-rc7 tree. To reproduce it,
> >> CONFIG_TRIM_UNUSED_KSYMS needs to be enabled. I guess that's why we run into
> >> these errors with allyesconfig. I used a gcc-7 ppc64le cross compiler and got
> >> the same compiler warnings. It seems to not compile on powerpc properly because
> >> it looks like some symbols have an extra dot "." prefix, for example in
> >> kthread.o:
> >>
> >>     168: 0000000000000318    24 NOTYPE  GLOBAL DEFAULT    6 kthread_create_worker
> >>     169: 0000000000001d90   104 FUNC    GLOBAL DEFAULT    1 .kthread_create_worker
> >>     170: 0000000000000330    24 NOTYPE  GLOBAL DEFAULT    6 kthread_create_worker_on_cpu
> >>     171: 0000000000001e00    88 FUNC    GLOBAL DEFAULT    1 .kthread_create_worker_on_cpu
> >>     172: 0000000000000348    24 NOTYPE  GLOBAL DEFAULT    6 kthread_queue_work
> >>     173: 0000000000001e60   228 FUNC    GLOBAL DEFAULT    1 .kthread_queue_work
> >>
> >> So I suppose this dot prefix is specific to powerpc. From the ppc64 elf abi docs:
> >>
> >>      Symbol names with a dot (.) prefix are reserved for holding entry point
> >>      addresses. The value of a symbol named ".FN", if it exists, is the entry point
> >>      of the function "FN".
> >>
> >> I guess the presence of the extra dot symbols is confusing
> >> scripts/gen_autoksyms.sh, so we get the dot symbols in autoksyms.h, which the
> >> preprocessor doesn't like. I am wondering how this was never caught until now
> >> and also now curious if this feature was ever functional on powerpc..
> >
> >Which feature?
>
> Sorry, by "feature" I meant CONFIG_TRIM_UNUSED_KSYMS. This config
> option was introduced around v4.7. If simply enabling it produces
> these compilation errors I was wondering if it ever built properly on
> powerpc.
>
> Thanks,
>
> Jessica


Thanks for the report.

I think the following will fix the issue,
but modpost needs fixing too.


diff --git a/scripts/gen_autoksyms.sh b/scripts/gen_autoksyms.sh
index 16c0b2ddaa4c..996a7109167b 100755
--- a/scripts/gen_autoksyms.sh
+++ b/scripts/gen_autoksyms.sh
@@ -44,7 +44,7 @@ sed 's/ko$/mod/' $modlist |
 xargs -n1 sed -n -e '2{s/ /\n/g;/^$/!p;}' -- |
 cat - "$ksym_wl" |
 sort -u |
-sed -e 's/\(.*\)/#define __KSYM_\1 1/' >> "$output_file"
+sed -e 's/^\.\{,1\}\(.*\)/#define __KSYM_\1 1/' >> "$output_file"

 # Special case for modversions (see modpost.c)
 if [ -n "$CONFIG_MODVERSIONS" ]; then
m




I will post two patches with some commit log
after some testing.
(one for gen_autoksyms.sh and the other for modpost).





-- 
Best Regards
Masahiro Yamada

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

* Re: linux-next: build failure after merge of the modules tree
  2021-02-10  8:06     ` Jessica Yu
  2021-02-10  8:37       ` Masahiro Yamada
@ 2021-02-10 12:21       ` Stephen Rothwell
  2021-02-10 16:16         ` Jessica Yu
  1 sibling, 1 reply; 43+ messages in thread
From: Stephen Rothwell @ 2021-02-10 12:21 UTC (permalink / raw)
  To: Jessica Yu
  Cc: Christoph Hellwig, Linux Kernel Mailing List,
	Linux Next Mailing List, Michael Ellerman, Masahiro Yamada

[-- Attachment #1: Type: text/plain, Size: 695 bytes --]

Hi Jessica,

On Wed, 10 Feb 2021 09:06:48 +0100 Jessica Yu <jeyu@kernel.org> wrote:
> 
> Sorry, by "feature" I meant CONFIG_TRIM_UNUSED_KSYMS. This config
> option was introduced around v4.7. If simply enabling it produces
> these compilation errors I was wondering if it ever built properly on
> powerpc.

Ah, of course.  So for a quick fix, you could revert just the changes
to lib/Kconfig and all the defconfigs.  That way all the UNUSED_SYMBOLS
infrastructure is still removed, but TRIM_UNUSED_KSYMS remains (un)set
whenever it used to be (un)set and that could then be cleaned up in a
followup patch set per architecture when we know it works.
-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: linux-next: build failure after merge of the modules tree
  2021-02-10 12:21       ` Stephen Rothwell
@ 2021-02-10 16:16         ` Jessica Yu
  0 siblings, 0 replies; 43+ messages in thread
From: Jessica Yu @ 2021-02-10 16:16 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Christoph Hellwig, Linux Kernel Mailing List,
	Linux Next Mailing List, Michael Ellerman, Masahiro Yamada

+++ Stephen Rothwell [10/02/21 23:21 +1100]:
>Hi Jessica,
>
>On Wed, 10 Feb 2021 09:06:48 +0100 Jessica Yu <jeyu@kernel.org> wrote:
>>
>> Sorry, by "feature" I meant CONFIG_TRIM_UNUSED_KSYMS. This config
>> option was introduced around v4.7. If simply enabling it produces
>> these compilation errors I was wondering if it ever built properly on
>> powerpc.
>
>Ah, of course.  So for a quick fix, you could revert just the changes
>to lib/Kconfig and all the defconfigs.  That way all the UNUSED_SYMBOLS
>infrastructure is still removed, but TRIM_UNUSED_KSYMS remains (un)set
>whenever it used to be (un)set and that could then be cleaned up in a
>followup patch set per architecture when we know it works.

Hi Stephen,

What's maybe simpler is marking this as BROKEN on PPC64 as a temporary
fix for linux-next until Masahiro's patch (the real fix) is posted. I
think the real problem is that TRIM_UNUSED_KSYMS was pretty much
hiding behind UNUSED_SYMBOLS=y until it finally got removed. Anyway
the main point is that TRIM_UNUSED_KSYMS=y shouldn't be breaking any
builds. I've pushed this change and hope that won't break linux-next now.

---
	
 From 1fa67f8391acb88a54e7defe6b73f8f171450f4a Mon Sep 17 00:00:00 2001
From: Jessica Yu <jeyu@kernel.org>
Date: Wed, 10 Feb 2021 16:59:53 +0100
Subject: [PATCH] module: mark TRIM_UNUSED_KSYMS as BROKEN on powerpc

Commit 367948220fce, which removed CONFIG_UNUSED_SYMBOLS, unraveled the
TRIM_UNUSED_KSYMS config option to be generally available without depending
on CONFIG_UNUSED_SYMBOLS=y. With CONFIG_UNUSED_SYMBOLS gone, this means
allyesconfig will now select this option without being "behind"
CONFIG_UNUSED_SYMBOLS. Unfortunately, this revealed some underlying build
issues on powerpc. When CONFIG_TRIM_UNUSED_KSYMS is enabled on powerpc, the
build would fail like this:

In file included from include/linux/export.h:123,
                  from include/linux/linkage.h:7,
                  from arch/powerpc/include/asm/unistd.h:18,
                  from <stdin>:2:
./include/generated/autoksyms.h:5:9: warning: missing whitespace after the
macro name
     5 | #define __KSYM_.HT_update_self_and_peer_setting 1
       |         ^~~~~~~
./include/generated/autoksyms.h:6:9: warning: missing whitespace after the
macro name
     6 | #define __KSYM_.RemovePeerTS 1
       |         ^~~~~~~
./include/generated/autoksyms.h:6: warning: "__KSYM_" redefined
     6 | #define __KSYM_.RemovePeerTS 1
       |
./include/generated/autoksyms.h:5: note: this is the location of the
previous definition

This is due to the addition of a dot "." prefix to some symbols that is
specific to powerpc, which confuses the gen_autoksyms script.

This is a temporary workaround for linux-next until gen_autoksyms and
modpost gets fixed.

Link: http://lore.kernel.org/r/20210209210843.3af66662@canb.auug.org.au
Signed-off-by: Jessica Yu <jeyu@kernel.org>
---
  init/Kconfig | 1 +
  1 file changed, 1 insertion(+)

diff --git a/init/Kconfig b/init/Kconfig
index 11b803b45c19..e4504a04b601 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -2264,6 +2264,7 @@ config MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS
  
  config TRIM_UNUSED_KSYMS
  	bool "Trim unused exported kernel symbols"
+	depends on !PPC64 || BROKEN
  	help
  	  The kernel and some modules make many symbols available for
  	  other modules to use via EXPORT_SYMBOL() and variants. Depending


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

* Re: linux-next: build failure after merge of the modules tree
  2021-02-10  8:37       ` Masahiro Yamada
@ 2021-02-11  6:19         ` Masahiro Yamada
  0 siblings, 0 replies; 43+ messages in thread
From: Masahiro Yamada @ 2021-02-11  6:19 UTC (permalink / raw)
  To: Jessica Yu
  Cc: Stephen Rothwell, Christoph Hellwig, Linux Kernel Mailing List,
	Linux Next Mailing List, Michael Ellerman

On Wed, Feb 10, 2021 at 5:37 PM Masahiro Yamada <masahiroy@kernel.org> wrote:
>
> On Wed, Feb 10, 2021 at 5:06 PM Jessica Yu <jeyu@kernel.org> wrote:
> >
> > +++ Stephen Rothwell [10/02/21 08:50 +1100]:
> > >Hi Jessica,
> > >
> > >On Tue, 9 Feb 2021 16:16:20 +0100 Jessica Yu <jeyu@kernel.org> wrote:
> > >>
> > >> Hmm, these errors don't look like it's related to that particular commit. I was
> > >
> > >I found this commit by bisection and then tested by reverting it.
> > >
> > >Before this commit, CONFIG_TRIM_UNUSED_KSYMS would not be set in the
> > >allyesconfig build because CONFIG_UNUSED_SYMBOLS was set.  After this
> > >commit, CONFIG_TRIM_UNUSED_KSYMS will be set in the allyesconfig build.
> >
> > Ah, that makes sense then. I would get the error on powerpc whenever
> > CONFIG_TRIM_UNUSED_KSYMS was enabled.
> >
> > >> able to reproduce these weird autoksym errors even without any modules-next
> > >> patches applied, and on a clean v5.11-rc7 tree. To reproduce it,
> > >> CONFIG_TRIM_UNUSED_KSYMS needs to be enabled. I guess that's why we run into
> > >> these errors with allyesconfig. I used a gcc-7 ppc64le cross compiler and got
> > >> the same compiler warnings. It seems to not compile on powerpc properly because
> > >> it looks like some symbols have an extra dot "." prefix, for example in
> > >> kthread.o:
> > >>
> > >>     168: 0000000000000318    24 NOTYPE  GLOBAL DEFAULT    6 kthread_create_worker
> > >>     169: 0000000000001d90   104 FUNC    GLOBAL DEFAULT    1 .kthread_create_worker
> > >>     170: 0000000000000330    24 NOTYPE  GLOBAL DEFAULT    6 kthread_create_worker_on_cpu
> > >>     171: 0000000000001e00    88 FUNC    GLOBAL DEFAULT    1 .kthread_create_worker_on_cpu
> > >>     172: 0000000000000348    24 NOTYPE  GLOBAL DEFAULT    6 kthread_queue_work
> > >>     173: 0000000000001e60   228 FUNC    GLOBAL DEFAULT    1 .kthread_queue_work
> > >>
> > >> So I suppose this dot prefix is specific to powerpc. From the ppc64 elf abi docs:
> > >>
> > >>      Symbol names with a dot (.) prefix are reserved for holding entry point
> > >>      addresses. The value of a symbol named ".FN", if it exists, is the entry point
> > >>      of the function "FN".
> > >>
> > >> I guess the presence of the extra dot symbols is confusing
> > >> scripts/gen_autoksyms.sh, so we get the dot symbols in autoksyms.h, which the
> > >> preprocessor doesn't like. I am wondering how this was never caught until now
> > >> and also now curious if this feature was ever functional on powerpc..
> > >
> > >Which feature?
> >
> > Sorry, by "feature" I meant CONFIG_TRIM_UNUSED_KSYMS. This config
> > option was introduced around v4.7. If simply enabling it produces
> > these compilation errors I was wondering if it ever built properly on
> > powerpc.
> >
> > Thanks,
> >
> > Jessica
>
>
> Thanks for the report.
>
> I think the following will fix the issue,
> but modpost needs fixing too.
>
>
> diff --git a/scripts/gen_autoksyms.sh b/scripts/gen_autoksyms.sh
> index 16c0b2ddaa4c..996a7109167b 100755
> --- a/scripts/gen_autoksyms.sh
> +++ b/scripts/gen_autoksyms.sh
> @@ -44,7 +44,7 @@ sed 's/ko$/mod/' $modlist |
>  xargs -n1 sed -n -e '2{s/ /\n/g;/^$/!p;}' -- |
>  cat - "$ksym_wl" |
>  sort -u |
> -sed -e 's/\(.*\)/#define __KSYM_\1 1/' >> "$output_file"
> +sed -e 's/^\.\{,1\}\(.*\)/#define __KSYM_\1 1/' >> "$output_file"
>
>  # Special case for modversions (see modpost.c)
>  if [ -n "$CONFIG_MODVERSIONS" ]; then
> m



After some more tests, I noticed the code above was not correct.
I still saw a lot of modpost errors.

ERROR: modpost: "_mcount" [arch/powerpc/oprofile/oprofile.ko] undefined!
ERROR: modpost: "._mcount" [arch/powerpc/oprofile/oprofile.ko] undefined!


I just posted a patch, which fixes the error as far as I tested.
https://patchwork.kernel.org/project/linux-kbuild/patch/20210211061416.3747231-1-masahiroy@kernel.org/



-- 
Best Regards
Masahiro Yamada

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

* linux-next: build failure after merge of the modules tree
@ 2024-02-02  1:03 Stephen Rothwell
  0 siblings, 0 replies; 43+ messages in thread
From: Stephen Rothwell @ 2024-02-02  1:03 UTC (permalink / raw)
  To: Luis Chamberlain; +Cc: Linux Kernel Mailing List, Linux Next Mailing List

[-- Attachment #1: Type: text/plain, Size: 1725 bytes --]

Hi all,

After merging the modules tree, today's linux-next build (x86_64
allmodconfig) failed like this:

Segmentation fault
make[3]: *** [/home/sfr/next/next/scripts/Makefile.modfinal:56: lib/tests/module/test_kallsyms_d.ko] Error 139
make[3]: *** Deleting file 'lib/tests/module/test_kallsyms_d.ko'

Caused by commit

  6336b7d9a520 ("selftests: add new kallsyms selftests")

These new tests spend a long time just linking the modules (especially
test_kallsyms_c.ko and test_kallsyms_d.ko) and then the linker segfaults
before finishing test_kallsyms_d.ko.  Maybe your stress tests need to be a little less stressful :-)

The build machine does not run out of memory (it has 30-40GB free).

$ x86_64-linux-gnu-gcc --version
x86_64-linux-gnu-gcc (Debian 13.2.0-7) 13.2.0
$ x86_64-linux-gnu-ld --version
GNU ld (GNU Binutils for Debian) 2.41

I have applied the following patch for today.

From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Fri, 2 Feb 2024 11:57:59 +1100
Subject: [PATCH] selftests: disable TEST_KALLSYMS_D for now

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
 lib/Kconfig.debug | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index dcb1bd7c6d9d..152128d63d8d 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -2853,7 +2853,7 @@ config TEST_KALLSYMS
 	select TEST_KALLSYMS_A
 	select TEST_KALLSYMS_B
 	select TEST_KALLSYMS_C
-	select TEST_KALLSYMS_D
+#	select TEST_KALLSYMS_D
 	help
 	  This allows us to stress test find_symbol() through the kallsyms
 	  used to place symbols on the kernel ELF kallsyms and modules kallsyms
-- 
2.43.0



-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: linux-next: build failure after merge of the modules tree
  2022-11-14  8:01 ` Jiri Olsa
@ 2022-11-14  9:08   ` Leizhen (ThunderTown)
  0 siblings, 0 replies; 43+ messages in thread
From: Leizhen (ThunderTown) @ 2022-11-14  9:08 UTC (permalink / raw)
  To: Jiri Olsa, Stephen Rothwell
  Cc: Luis Chamberlain, David Miller, Networking, Alexei Starovoitov,
	Linux Kernel Mailing List, Linux Next Mailing List



On 2022/11/14 16:01, Jiri Olsa wrote:
> On Mon, Nov 14, 2022 at 11:13:50AM +1100, Stephen Rothwell wrote:
>> Hi all,
>>
>> After merging the modules tree, today's linux-next build (powerpc
>> ppc64_defconfig) failed like this:
>>
>> kernel/trace/ftrace.c: In function 'ftrace_lookup_symbols':
>> kernel/trace/ftrace.c:8316:52: error: passing argument 1 of 'module_kallsyms_on_each_symbol' from incompatible pointer type [-Werror=incompatible-pointer-types]
>>  8316 |         found_all = module_kallsyms_on_each_symbol(kallsyms_callback, &args);
>>       |                                                    ^~~~~~~~~~~~~~~~~
>>       |                                                    |
>>       |                                                    int (*)(void *, const char *, long unsigned int)
>> In file included from include/linux/device/driver.h:21,
>>                  from include/linux/device.h:32,
>>                  from include/linux/node.h:18,
>>                  from include/linux/cpu.h:17,
>>                  from include/linux/stop_machine.h:5,
>>                  from kernel/trace/ftrace.c:17:
>> include/linux/module.h:882:48: note: expected 'const char *' but argument is of type 'int (*)(void *, const char *, long unsigned int)'
>>   882 | int module_kallsyms_on_each_symbol(const char *modname,
>>       |                                    ~~~~~~~~~~~~^~~~~~~
>> kernel/trace/ftrace.c:8316:71: error: passing argument 2 of 'module_kallsyms_on_each_symbol' from incompatible pointer type [-Werror=incompatible-pointer-types]
>>  8316 |         found_all = module_kallsyms_on_each_symbol(kallsyms_callback, &args);
>>       |                                                                       ^~~~~
>>       |                                                                       |
>>       |                                                                       struct kallsyms_data *
>> include/linux/module.h:883:42: note: expected 'int (*)(void *, const char *, long unsigned int)' but argument is of type 'struct kallsyms_data *'
>>   883 |                                    int (*fn)(void *, const char *, unsigned long),
>>       |                                    ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> kernel/trace/ftrace.c:8316:21: error: too few arguments to function 'module_kallsyms_on_each_symbol'
>>  8316 |         found_all = module_kallsyms_on_each_symbol(kallsyms_callback, &args);
>>       |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> include/linux/module.h:882:5: note: declared here
>>   882 | int module_kallsyms_on_each_symbol(const char *modname,
>>       |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>
>> Caused by commit
>>
>>   90de88426f3c ("livepatch: Improve the search performance of module_kallsyms_on_each_symbol()")
>>
>> from the modules tree interatcing with commit
>>
>>   3640bf8584f4 ("ftrace: Add support to resolve module symbols in ftrace_lookup_symbols")
>>
>> from the next-next tree.
>>
>> I have no idea how to easily fix this up, so I have used the modules
>> tree from next-20221111 for today in the hope someone will send me a fix.
> 
> hi,
> there's no quick fix.. I sent follow up email to the original
> change and cc-ed you

The fastest fix is drop my patch 7/9, 8/9, they depend on the interface change
of patch 6/9,but other patches don't rely on either of them.. And I can repost
them after v6.2-rc1.

Otherwise, you'll need to modify your patch, take the module reference before
invoking callback and put it after it is called, without passing modname.


> 
> thanks,
> jirka
> .
> 

-- 
Regards,
  Zhen Lei

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

* Re: linux-next: build failure after merge of the modules tree
  2022-11-14  0:13 Stephen Rothwell
@ 2022-11-14  8:01 ` Jiri Olsa
  2022-11-14  9:08   ` Leizhen (ThunderTown)
  0 siblings, 1 reply; 43+ messages in thread
From: Jiri Olsa @ 2022-11-14  8:01 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Luis Chamberlain, David Miller, Networking, Alexei Starovoitov,
	Zhen Lei, Linux Kernel Mailing List, Linux Next Mailing List

On Mon, Nov 14, 2022 at 11:13:50AM +1100, Stephen Rothwell wrote:
> Hi all,
> 
> After merging the modules tree, today's linux-next build (powerpc
> ppc64_defconfig) failed like this:
> 
> kernel/trace/ftrace.c: In function 'ftrace_lookup_symbols':
> kernel/trace/ftrace.c:8316:52: error: passing argument 1 of 'module_kallsyms_on_each_symbol' from incompatible pointer type [-Werror=incompatible-pointer-types]
>  8316 |         found_all = module_kallsyms_on_each_symbol(kallsyms_callback, &args);
>       |                                                    ^~~~~~~~~~~~~~~~~
>       |                                                    |
>       |                                                    int (*)(void *, const char *, long unsigned int)
> In file included from include/linux/device/driver.h:21,
>                  from include/linux/device.h:32,
>                  from include/linux/node.h:18,
>                  from include/linux/cpu.h:17,
>                  from include/linux/stop_machine.h:5,
>                  from kernel/trace/ftrace.c:17:
> include/linux/module.h:882:48: note: expected 'const char *' but argument is of type 'int (*)(void *, const char *, long unsigned int)'
>   882 | int module_kallsyms_on_each_symbol(const char *modname,
>       |                                    ~~~~~~~~~~~~^~~~~~~
> kernel/trace/ftrace.c:8316:71: error: passing argument 2 of 'module_kallsyms_on_each_symbol' from incompatible pointer type [-Werror=incompatible-pointer-types]
>  8316 |         found_all = module_kallsyms_on_each_symbol(kallsyms_callback, &args);
>       |                                                                       ^~~~~
>       |                                                                       |
>       |                                                                       struct kallsyms_data *
> include/linux/module.h:883:42: note: expected 'int (*)(void *, const char *, long unsigned int)' but argument is of type 'struct kallsyms_data *'
>   883 |                                    int (*fn)(void *, const char *, unsigned long),
>       |                                    ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> kernel/trace/ftrace.c:8316:21: error: too few arguments to function 'module_kallsyms_on_each_symbol'
>  8316 |         found_all = module_kallsyms_on_each_symbol(kallsyms_callback, &args);
>       |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> include/linux/module.h:882:5: note: declared here
>   882 | int module_kallsyms_on_each_symbol(const char *modname,
>       |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> Caused by commit
> 
>   90de88426f3c ("livepatch: Improve the search performance of module_kallsyms_on_each_symbol()")
> 
> from the modules tree interatcing with commit
> 
>   3640bf8584f4 ("ftrace: Add support to resolve module symbols in ftrace_lookup_symbols")
> 
> from the next-next tree.
> 
> I have no idea how to easily fix this up, so I have used the modules
> tree from next-20221111 for today in the hope someone will send me a fix.

hi,
there's no quick fix.. I sent follow up email to the original
change and cc-ed you

thanks,
jirka

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

* linux-next: build failure after merge of the modules tree
@ 2022-11-14  0:13 Stephen Rothwell
  2022-11-14  8:01 ` Jiri Olsa
  0 siblings, 1 reply; 43+ messages in thread
From: Stephen Rothwell @ 2022-11-14  0:13 UTC (permalink / raw)
  To: Luis Chamberlain, David Miller
  Cc: Networking, Alexei Starovoitov, Jiri Olsa, Zhen Lei,
	Linux Kernel Mailing List, Linux Next Mailing List

[-- Attachment #1: Type: text/plain, Size: 2974 bytes --]

Hi all,

After merging the modules tree, today's linux-next build (powerpc
ppc64_defconfig) failed like this:

kernel/trace/ftrace.c: In function 'ftrace_lookup_symbols':
kernel/trace/ftrace.c:8316:52: error: passing argument 1 of 'module_kallsyms_on_each_symbol' from incompatible pointer type [-Werror=incompatible-pointer-types]
 8316 |         found_all = module_kallsyms_on_each_symbol(kallsyms_callback, &args);
      |                                                    ^~~~~~~~~~~~~~~~~
      |                                                    |
      |                                                    int (*)(void *, const char *, long unsigned int)
In file included from include/linux/device/driver.h:21,
                 from include/linux/device.h:32,
                 from include/linux/node.h:18,
                 from include/linux/cpu.h:17,
                 from include/linux/stop_machine.h:5,
                 from kernel/trace/ftrace.c:17:
include/linux/module.h:882:48: note: expected 'const char *' but argument is of type 'int (*)(void *, const char *, long unsigned int)'
  882 | int module_kallsyms_on_each_symbol(const char *modname,
      |                                    ~~~~~~~~~~~~^~~~~~~
kernel/trace/ftrace.c:8316:71: error: passing argument 2 of 'module_kallsyms_on_each_symbol' from incompatible pointer type [-Werror=incompatible-pointer-types]
 8316 |         found_all = module_kallsyms_on_each_symbol(kallsyms_callback, &args);
      |                                                                       ^~~~~
      |                                                                       |
      |                                                                       struct kallsyms_data *
include/linux/module.h:883:42: note: expected 'int (*)(void *, const char *, long unsigned int)' but argument is of type 'struct kallsyms_data *'
  883 |                                    int (*fn)(void *, const char *, unsigned long),
      |                                    ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
kernel/trace/ftrace.c:8316:21: error: too few arguments to function 'module_kallsyms_on_each_symbol'
 8316 |         found_all = module_kallsyms_on_each_symbol(kallsyms_callback, &args);
      |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/module.h:882:5: note: declared here
  882 | int module_kallsyms_on_each_symbol(const char *modname,
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Caused by commit

  90de88426f3c ("livepatch: Improve the search performance of module_kallsyms_on_each_symbol()")

from the modules tree interatcing with commit

  3640bf8584f4 ("ftrace: Add support to resolve module symbols in ftrace_lookup_symbols")

from the next-next tree.

I have no idea how to easily fix this up, so I have used the modules
tree from next-20221111 for today in the hope someone will send me a fix.

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: linux-next: build failure after merge of the modules tree
  2022-02-28  5:13   ` Stephen Rothwell
@ 2022-02-28 18:16     ` Luis Chamberlain
  0 siblings, 0 replies; 43+ messages in thread
From: Luis Chamberlain @ 2022-02-28 18:16 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: broonie, Jessica Yu, Aaron Tomlin, Linux Kernel Mailing List,
	Linux Next Mailing List

On Mon, Feb 28, 2022 at 04:13:07PM +1100, Stephen Rothwell wrote:
> Hi all,
> 
> On Tue, 22 Feb 2022 16:32:12 -0800 Luis Chamberlain <mcgrof@kernel.org> wrote:
> >
> > Thanks for the report Mark. Aaron, did you fix this issue on your latest
> > series?
> > 
> > On Mon, Feb 21, 2022 at 04:07:21PM +0000, broonie@kernel.org wrote:
> > > Hi all,
> > > 
> > > After merging the modules tree, today's linux-next build (KCONFIG_NAME)
> 
> This was a powerpc ppc64_defconfig build.
> 
> I am still getting this build failure.

A v9 from Aaron is still in the works so I've dropped all the patches on
linux-next and reset the it to Linus' tree for now.

  Luis

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

* Re: linux-next: build failure after merge of the modules tree
  2022-02-23  0:32 ` Luis Chamberlain
@ 2022-02-28  5:13   ` Stephen Rothwell
  2022-02-28 18:16     ` Luis Chamberlain
  0 siblings, 1 reply; 43+ messages in thread
From: Stephen Rothwell @ 2022-02-28  5:13 UTC (permalink / raw)
  To: Luis Chamberlain
  Cc: broonie, Jessica Yu, Aaron Tomlin, Linux Kernel Mailing List,
	Linux Next Mailing List

[-- Attachment #1: Type: text/plain, Size: 1785 bytes --]

Hi all,

On Tue, 22 Feb 2022 16:32:12 -0800 Luis Chamberlain <mcgrof@kernel.org> wrote:
>
> Thanks for the report Mark. Aaron, did you fix this issue on your latest
> series?
> 
> On Mon, Feb 21, 2022 at 04:07:21PM +0000, broonie@kernel.org wrote:
> > Hi all,
> > 
> > After merging the modules tree, today's linux-next build (KCONFIG_NAME)

This was a powerpc ppc64_defconfig build.

> > failed like this:
> > 
> > In file included from /tmp/next/build/include/linux/build_bug.h:5,
> >                  from /tmp/next/build/include/linux/container_of.h:5,
> >                  from /tmp/next/build/include/linux/list.h:5,
> >                  from /tmp/next/build/include/linux/module.h:12,
> >                  from /tmp/next/build/kernel/module/strict_rwx.c:8:
> > /tmp/next/build/kernel/module/strict_rwx.c: In function 'frob_rodata':
> > /tmp/next/build/kernel/module/strict_rwx.c:16:10: error: implicit declaration of function 'PAGE_ALIGNED'; did you mean 'IS_ALIGNED'? [-Werror=implicit-function-declaration]
> >    16 |  BUG_ON(!PAGE_ALIGNED(layout->base));
> >       |          ^~~~~~~~~~~~
> > /tmp/next/build/include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
> >    78 | # define unlikely(x) __builtin_expect(!!(x), 0)
> >       |                                          ^
> > /tmp/next/build/kernel/module/strict_rwx.c:16:2: note: in expansion of macro 'BUG_ON'
> >    16 |  BUG_ON(!PAGE_ALIGNED(layout->base));
> >       |  ^~~~~~
> > cc1: some warnings being treated as errors
> > 
> > Caused by commit
> > 
> >   e5973a14d18 ("module: Move strict rwx support to a separate file")
> > 
> > I have used the -next tree from the 17th.  

I am still getting this build failure.

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: linux-next: build failure after merge of the modules tree
  2022-02-21 16:07 broonie
@ 2022-02-23  0:32 ` Luis Chamberlain
  2022-02-28  5:13   ` Stephen Rothwell
  0 siblings, 1 reply; 43+ messages in thread
From: Luis Chamberlain @ 2022-02-23  0:32 UTC (permalink / raw)
  To: broonie
  Cc: Jessica Yu, Aaron Tomlin, Linux Kernel Mailing List,
	Linux Next Mailing List

Thanks for the report Mark. Aaron, did you fix this issue on your latest
series?

  Luis

On Mon, Feb 21, 2022 at 04:07:21PM +0000, broonie@kernel.org wrote:
> Hi all,
> 
> After merging the modules tree, today's linux-next build (KCONFIG_NAME)
> failed like this:
> 
> In file included from /tmp/next/build/include/linux/build_bug.h:5,
>                  from /tmp/next/build/include/linux/container_of.h:5,
>                  from /tmp/next/build/include/linux/list.h:5,
>                  from /tmp/next/build/include/linux/module.h:12,
>                  from /tmp/next/build/kernel/module/strict_rwx.c:8:
> /tmp/next/build/kernel/module/strict_rwx.c: In function 'frob_rodata':
> /tmp/next/build/kernel/module/strict_rwx.c:16:10: error: implicit declaration of function 'PAGE_ALIGNED'; did you mean 'IS_ALIGNED'? [-Werror=implicit-function-declaration]
>    16 |  BUG_ON(!PAGE_ALIGNED(layout->base));
>       |          ^~~~~~~~~~~~
> /tmp/next/build/include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
>    78 | # define unlikely(x) __builtin_expect(!!(x), 0)
>       |                                          ^
> /tmp/next/build/kernel/module/strict_rwx.c:16:2: note: in expansion of macro 'BUG_ON'
>    16 |  BUG_ON(!PAGE_ALIGNED(layout->base));
>       |  ^~~~~~
> cc1: some warnings being treated as errors
> 
> Caused by commit
> 
>   e5973a14d18 ("module: Move strict rwx support to a separate file")
> 
> I have used the -next tree from the 17th.

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

* linux-next: build failure after merge of the modules tree
@ 2022-02-21 16:07 broonie
  2022-02-23  0:32 ` Luis Chamberlain
  0 siblings, 1 reply; 43+ messages in thread
From: broonie @ 2022-02-21 16:07 UTC (permalink / raw)
  To: Luis Chamberlain, Jessica Yu, Aaron Tomlin
  Cc: Linux Kernel Mailing List, Linux Next Mailing List

Hi all,

After merging the modules tree, today's linux-next build (KCONFIG_NAME)
failed like this:

In file included from /tmp/next/build/include/linux/build_bug.h:5,
                 from /tmp/next/build/include/linux/container_of.h:5,
                 from /tmp/next/build/include/linux/list.h:5,
                 from /tmp/next/build/include/linux/module.h:12,
                 from /tmp/next/build/kernel/module/strict_rwx.c:8:
/tmp/next/build/kernel/module/strict_rwx.c: In function 'frob_rodata':
/tmp/next/build/kernel/module/strict_rwx.c:16:10: error: implicit declaration of function 'PAGE_ALIGNED'; did you mean 'IS_ALIGNED'? [-Werror=implicit-function-declaration]
   16 |  BUG_ON(!PAGE_ALIGNED(layout->base));
      |          ^~~~~~~~~~~~
/tmp/next/build/include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
   78 | # define unlikely(x) __builtin_expect(!!(x), 0)
      |                                          ^
/tmp/next/build/kernel/module/strict_rwx.c:16:2: note: in expansion of macro 'BUG_ON'
   16 |  BUG_ON(!PAGE_ALIGNED(layout->base));
      |  ^~~~~~
cc1: some warnings being treated as errors

Caused by commit

  e5973a14d18 ("module: Move strict rwx support to a separate file")

I have used the -next tree from the 17th.

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

* linux-next: build failure after merge of the modules tree
@ 2019-06-25  4:27 Stephen Rothwell
  0 siblings, 0 replies; 43+ messages in thread
From: Stephen Rothwell @ 2019-06-25  4:27 UTC (permalink / raw)
  To: Jessica Yu
  Cc: Linux Next Mailing List, Linux Kernel Mailing List,
	Yang Yingliang, Nadav Amit

[-- Attachment #1: Type: text/plain, Size: 641 bytes --]

Hi Jessica,

After merging the modules tree, today's linux-next build (powerpc
ppc64_defconfig) failed like this:

kernel/module.c: In function 'module_enable_x':
kernel/module.c:2030:2: error: implicit declaration of function 'frob_text'; did you mean 'rb_next'? [-Werror=implicit-function-declaration]
  frob_text(&mod->core_layout, set_memory_x);
  ^~~~~~~~~
  rb_next

Caused by commit

  2eef1399a866 ("modules: fix BUG when load module with rodata=n")

frob_text() only exists when CONFIG_STRICT_MODULE_RWX is defined.

I have used the modules tree from next-20190624 for today.



-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: linux-next: build failure after merge of the modules tree
  2015-12-01 20:23 Mark Brown
@ 2015-12-02  3:23 ` Rusty Russell
  0 siblings, 0 replies; 43+ messages in thread
From: Rusty Russell @ 2015-12-02  3:23 UTC (permalink / raw)
  To: Mark Brown; +Cc: linux-next, linux-kernel, Peter Zijlstra, Josh Poimboeuf

Mark Brown <broonie@kernel.org> writes:
> Hi Rusty,
>
> After merging the modules tree, today's linux-next x86 allmodconfig build (20151201) failed like this:
>
> /home/broonie/next/next/arch/x86/kernel/livepatch.c: In function 'klp_write_module_reloc':
> /home/broonie/next/next/arch/x86/kernel/livepatch.c:75:22: error: 'struct module' has no member named 'core_ro_size'
>   if (loc < core + mod->core_ro_size)

Yep, I missed that one.

I also missed an ARM case, so I'll rebase the tree (it's near the top
anyway).

Cheers,
Rusty.


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

* linux-next: build failure after merge of the modules tree
@ 2015-12-01 20:23 Mark Brown
  2015-12-02  3:23 ` Rusty Russell
  0 siblings, 1 reply; 43+ messages in thread
From: Mark Brown @ 2015-12-01 20:23 UTC (permalink / raw)
  To: Rusty Russell; +Cc: linux-next, linux-kernel, Peter Zijlstra, Josh Poimboeuf

[-- Attachment #1: Type: text/plain, Size: 758 bytes --]

Hi Rusty,

After merging the modules tree, today's linux-next x86 allmodconfig build (20151201) failed like this:

/home/broonie/next/next/arch/x86/kernel/livepatch.c: In function 'klp_write_module_reloc':
/home/broonie/next/next/arch/x86/kernel/livepatch.c:75:22: error: 'struct module' has no member named 'core_ro_size'
  if (loc < core + mod->core_ro_size)
                      ^
/home/broonie/next/next/scripts/Makefile.build:258: recipe for target 'arch/x86/kernel/livepatch.o' failed
make[3]: *** [arch/x86/kernel/livepatch.o] Error 1

I've used the modules tree from the previous -next (which looks to be what's in Linus' tree already) instead. Or at least I'll try to, it looks like I had a bit of driver error with the scripts here...

[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]

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

* Re: linux-next: build failure after merge of the modules tree
  2015-11-27  1:26 Stephen Rothwell
@ 2015-11-27  2:57 ` Rusty Russell
  0 siblings, 0 replies; 43+ messages in thread
From: Rusty Russell @ 2015-11-27  2:57 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: linux-next, linux-kernel

Stephen Rothwell <sfr@canb.auug.org.au> writes:
> Hi Rusty,
>
> After merging the modules tree, today's linux-next build (powerpc
> ppc64_defconfig) failed like this:
>
> In file included from include/linux/kexec.h:26:0,
>                  from include/linux/crash_dump.h:5,
>                  from arch/powerpc/platforms/powernv/pci-ioda.c:16:
> include/linux/module.h:770:15: error: return type defaults to 'int' [-Werror=return-type]

Thanks, this typo hit all archs which don't do RO module protection by
default.

Maybe PPC should do that?

I've fixed it (and some others found by 0-day) and rebased.

Thanks,
Rusty.

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

* linux-next: build failure after merge of the modules tree
@ 2015-11-27  1:26 Stephen Rothwell
  2015-11-27  2:57 ` Rusty Russell
  0 siblings, 1 reply; 43+ messages in thread
From: Stephen Rothwell @ 2015-11-27  1:26 UTC (permalink / raw)
  To: Rusty Russell; +Cc: linux-next, linux-kernel

Hi Rusty,

After merging the modules tree, today's linux-next build (powerpc
ppc64_defconfig) failed like this:

In file included from include/linux/kexec.h:26:0,
                 from include/linux/crash_dump.h:5,
                 from arch/powerpc/platforms/powernv/pci-ioda.c:16:
include/linux/module.h:770:15: error: return type defaults to 'int' [-Werror=return-type]
 static inline module_enable_ro(const struct module *mod) { }
               ^

and many many more of these :-(

Caused by commit

  ccd6497a60e5 ("module: clean up RO/NX handling")

I have used the modules tree from next-20151126 for today.

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

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

* Re: linux-next: build failure after merge of the modules tree
  2015-06-25  6:54 Stephen Rothwell
@ 2015-06-25  9:51 ` Dan Streetman
  0 siblings, 0 replies; 43+ messages in thread
From: Dan Streetman @ 2015-06-25  9:51 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: Rusty Russell, linux-next, linux-kernel

On Thu, Jun 25, 2015 at 2:54 AM, Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> Hi Rusty,
>
> After merging the modules tree, today's linux-next build (powerpc
> allnoconfig) failed like this:

I promise I'll build with all[no|mod|yes]config next time! ;-)

Thanks for catching this one too.

>
> kernel/params.c:628:6: error: redefinition of 'kernel_param_lock'
>  void kernel_param_lock(struct module *mod)
>       ^
> In file included from include/linux/module.h:18:0,
>                  from kernel/params.c:21:
> include/linux/moduleparam.h:246:20: note: previous definition of 'kernel_param_lock' was here
>  static inline void kernel_param_lock(struct module *mod)
>                     ^
> kernel/params.c:633:6: error: redefinition of 'kernel_param_unlock'
>  void kernel_param_unlock(struct module *mod)
>       ^
> In file included from include/linux/module.h:18:0,
>                  from kernel/params.c:21:
> include/linux/moduleparam.h:249:20: note: previous definition of 'kernel_param_unlock' was here
>  static inline void kernel_param_unlock(struct module *mod)
>                     ^
>
> Caused by commit b51d23e4e9fe ("module: add per-module param_lock").
> This had not been tested with CONFIG_SYSFS not set.
>
> I have added the following patch for today (which may not be complete,
> but builds).

this is one way to handle it, but it will cause all modules to use the
built-in param_lock,
which (I don't think) is needed if there's no sysfs; another way would
be to elide the
param_lock entirely if !CONFIG_SYSFS.  I'll send a patch for that.

Rusty, is param locking needed if there is no sysfs?

>
> From: Stephen Rothwell <sfr@canb.auug.org.au>
> Date: Thu, 25 Jun 2015 16:38:51 +1000
> Subject: [PATCH] modules: clean up add per-module param_lock
>
> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
> ---
>  include/linux/moduleparam.h | 9 ---------
>  1 file changed, 9 deletions(-)
>
> diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h
> index c12f2147c350..428d7c25c383 100644
> --- a/include/linux/moduleparam.h
> +++ b/include/linux/moduleparam.h
> @@ -239,17 +239,8 @@ __check_old_set_param(int (*oldset)(const char *, struct kernel_param *))
>         return 0;
>  }
>
> -#ifdef CONFIG_SYSFS
>  extern void kernel_param_lock(struct module *mod);
>  extern void kernel_param_unlock(struct module *mod);
> -#else
> -static inline void kernel_param_lock(struct module *mod)
> -{
> -}
> -static inline void kernel_param_unlock(struct module *mod)
> -{
> -}
> -#endif
>
>  #ifndef MODULE
>  /**
> --
> 2.1.4
>
> --
> Cheers,
> Stephen Rothwell                    sfr@canb.auug.org.au

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

* linux-next: build failure after merge of the modules tree
@ 2015-06-25  6:54 Stephen Rothwell
  2015-06-25  9:51 ` Dan Streetman
  0 siblings, 1 reply; 43+ messages in thread
From: Stephen Rothwell @ 2015-06-25  6:54 UTC (permalink / raw)
  To: Rusty Russell; +Cc: linux-next, linux-kernel, Dan Streetman

[-- Attachment #1: Type: text/plain, Size: 2107 bytes --]

Hi Rusty,

After merging the modules tree, today's linux-next build (powerpc
allnoconfig) failed like this:

kernel/params.c:628:6: error: redefinition of 'kernel_param_lock'
 void kernel_param_lock(struct module *mod)
      ^
In file included from include/linux/module.h:18:0,
                 from kernel/params.c:21:
include/linux/moduleparam.h:246:20: note: previous definition of 'kernel_param_lock' was here
 static inline void kernel_param_lock(struct module *mod)
                    ^
kernel/params.c:633:6: error: redefinition of 'kernel_param_unlock'
 void kernel_param_unlock(struct module *mod)
      ^
In file included from include/linux/module.h:18:0,
                 from kernel/params.c:21:
include/linux/moduleparam.h:249:20: note: previous definition of 'kernel_param_unlock' was here
 static inline void kernel_param_unlock(struct module *mod)
                    ^

Caused by commit b51d23e4e9fe ("module: add per-module param_lock").
This had not been tested with CONFIG_SYSFS not set.

I have added the following patch for today (which may not be complete,
but builds).

From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Thu, 25 Jun 2015 16:38:51 +1000
Subject: [PATCH] modules: clean up add per-module param_lock

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
 include/linux/moduleparam.h | 9 ---------
 1 file changed, 9 deletions(-)

diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h
index c12f2147c350..428d7c25c383 100644
--- a/include/linux/moduleparam.h
+++ b/include/linux/moduleparam.h
@@ -239,17 +239,8 @@ __check_old_set_param(int (*oldset)(const char *, struct kernel_param *))
 	return 0;
 }
 
-#ifdef CONFIG_SYSFS
 extern void kernel_param_lock(struct module *mod);
 extern void kernel_param_unlock(struct module *mod);
-#else
-static inline void kernel_param_lock(struct module *mod)
-{
-}
-static inline void kernel_param_unlock(struct module *mod)
-{
-}
-#endif
 
 #ifndef MODULE
 /**
-- 
2.1.4

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: linux-next: build failure after merge of the modules tree
  2015-06-24 22:57   ` Stephen Rothwell
@ 2015-06-25  1:50     ` Stephen Rothwell
  0 siblings, 0 replies; 43+ messages in thread
From: Stephen Rothwell @ 2015-06-25  1:50 UTC (permalink / raw)
  To: Dan Streetman; +Cc: Rusty Russell, linux-next, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1120 bytes --]

Hi Dan,

On Thu, 25 Jun 2015 08:57:06 +1000 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
> On Wed, 24 Jun 2015 14:18:44 -0400 Dan Streetman <ddstreet@ieee.org> wrote:
> >
> > On Tue, Jun 23, 2015 at 9:37 PM, Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> > >
> > > After merging the modules tree, today's linux-next build (x86_64
> > > allmodconfig) failed like this:
> > 
> > that's weird.  Are you sure it failed during allmodconfig?  I can see
> > why it would fail like that if CONFIG_MODULES ins't defined, which
> > I'll send a patch for...
> 
> Pretty sure - and, in any case, I don't do any CONFIG_MODULES=n builds
> between tree merges (only later in the day).  That is why I couldn't
> figure out what went wrong.
> 
> I will apply your patch today and see if that helps.

I built without your patch and it failed again, but applying your patch fixes it.

Rusty, you can consider this

Tested-by: Stephen Rothwell <sfr@canb.auug.org.au>

for "[PATCH] modules: only use mod->param_lock if CONFIG_MODULES"
-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: linux-next: build failure after merge of the modules tree
  2015-06-24 18:18 ` Dan Streetman
@ 2015-06-24 22:57   ` Stephen Rothwell
  2015-06-25  1:50     ` Stephen Rothwell
  0 siblings, 1 reply; 43+ messages in thread
From: Stephen Rothwell @ 2015-06-24 22:57 UTC (permalink / raw)
  To: Dan Streetman; +Cc: Rusty Russell, linux-next, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 764 bytes --]

Hi Dan,

On Wed, 24 Jun 2015 14:18:44 -0400 Dan Streetman <ddstreet@ieee.org> wrote:
>
> On Tue, Jun 23, 2015 at 9:37 PM, Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> >
> > After merging the modules tree, today's linux-next build (x86_64
> > allmodconfig) failed like this:
> 
> that's weird.  Are you sure it failed during allmodconfig?  I can see
> why it would fail like that if CONFIG_MODULES ins't defined, which
> I'll send a patch for...

Pretty sure - and, in any case, I don't do any CONFIG_MODULES=n builds
between tree merges (only later in the day).  That is why I couldn't
figure out what went wrong.

I will apply your patch today and see if that helps.

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: linux-next: build failure after merge of the modules tree
  2015-06-24  1:37 Stephen Rothwell
@ 2015-06-24 18:18 ` Dan Streetman
  2015-06-24 22:57   ` Stephen Rothwell
  0 siblings, 1 reply; 43+ messages in thread
From: Dan Streetman @ 2015-06-24 18:18 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: Rusty Russell, linux-next, linux-kernel

On Tue, Jun 23, 2015 at 9:37 PM, Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> Hi Rusty,
>
> After merging the modules tree, today's linux-next build (x86_64
> allmodconfig) failed like this:

that's weird.  Are you sure it failed during allmodconfig?  I can see
why it would fail like that if CONFIG_MODULES ins't defined, which
I'll send a patch for...

>
> In file included from include/linux/linkage.h:4:0,
>                  from include/linux/kernel.h:6,
>                  from kernel/params.c:18:
> kernel/params.c: In function 'param_array':
> kernel/params.c:32:42: error: dereferencing pointer to incomplete type
>  #define KPARAM_MUTEX(mod) ((mod) ? &(mod)->param_lock : &param_lock)
>                                           ^
> include/linux/compiler.h:164:42: note: in definition of macro 'unlikely'
>  # define unlikely(x) __builtin_expect(!!(x), 0)
>                                           ^
> kernel/params.c:462:3: note: in expansion of macro 'BUG_ON'
>    BUG_ON(!KPARAM_IS_LOCKED(mod));
>    ^
> kernel/params.c:33:47: note: in expansion of macro 'KPARAM_MUTEX'
>  #define KPARAM_IS_LOCKED(mod) mutex_is_locked(KPARAM_MUTEX(mod))
>                                                ^
> kernel/params.c:462:11: note: in expansion of macro 'KPARAM_IS_LOCKED'
>    BUG_ON(!KPARAM_IS_LOCKED(mod));
>            ^
> kernel/params.c: In function 'param_array_get':
> kernel/params.c:32:42: error: dereferencing pointer to incomplete type
>  #define KPARAM_MUTEX(mod) ((mod) ? &(mod)->param_lock : &param_lock)
>                                           ^
> include/linux/compiler.h:164:42: note: in definition of macro 'unlikely'
>  # define unlikely(x) __builtin_expect(!!(x), 0)
>                                           ^
> kernel/params.c:499:3: note: in expansion of macro 'BUG_ON'
>    BUG_ON(!KPARAM_IS_LOCKED(p.mod));
>    ^
> kernel/params.c:33:47: note: in expansion of macro 'KPARAM_MUTEX'
>  #define KPARAM_IS_LOCKED(mod) mutex_is_locked(KPARAM_MUTEX(mod))
>                                                ^
> kernel/params.c:499:11: note: in expansion of macro 'KPARAM_IS_LOCKED'
>    BUG_ON(!KPARAM_IS_LOCKED(p.mod));
>            ^
> In file included from include/linux/notifier.h:13:0,
>                  from include/linux/memory_hotplug.h:6,
>                  from include/linux/mmzone.h:789,
>                  from include/linux/gfp.h:5,
>                  from include/linux/kmod.h:22,
>                  from include/linux/module.h:13,
>                  from kernel/params.c:21:
> kernel/params.c: In function 'kernel_param_lock':
> kernel/params.c:32:42: error: dereferencing pointer to incomplete type
>  #define KPARAM_MUTEX(mod) ((mod) ? &(mod)->param_lock : &param_lock)
>                                           ^
> include/linux/mutex.h:146:44: note: in definition of macro 'mutex_lock'
>  #define mutex_lock(lock) mutex_lock_nested(lock, 0)
>                                             ^
> kernel/params.c:621:13: note: in expansion of macro 'KPARAM_MUTEX'
>   mutex_lock(KPARAM_MUTEX(mod));
>              ^
> kernel/params.c: In function 'kernel_param_unlock':
> kernel/params.c:32:42: error: dereferencing pointer to incomplete type
>  #define KPARAM_MUTEX(mod) ((mod) ? &(mod)->param_lock : &param_lock)
>                                           ^
> kernel/params.c:626:15: note: in expansion of macro 'KPARAM_MUTEX'
>   mutex_unlock(KPARAM_MUTEX(mod));
>                ^
>
> Caused by commit b51d23e4e9fe ("module: add per-module param_lock").
>
> I am not exactly sure why this fails to build.  It may be an
> interaction with some other change.
>
> I have used the modules tree from next-20150623 for today.
>
> --
> Cheers,
> Stephen Rothwell                    sfr@canb.auug.org.au

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

* linux-next: build failure after merge of the modules tree
@ 2015-06-24  1:37 Stephen Rothwell
  2015-06-24 18:18 ` Dan Streetman
  0 siblings, 1 reply; 43+ messages in thread
From: Stephen Rothwell @ 2015-06-24  1:37 UTC (permalink / raw)
  To: Rusty Russell; +Cc: linux-next, linux-kernel, Dan Streetman

[-- Attachment #1: Type: text/plain, Size: 3440 bytes --]

Hi Rusty,

After merging the modules tree, today's linux-next build (x86_64
allmodconfig) failed like this:

In file included from include/linux/linkage.h:4:0,
                 from include/linux/kernel.h:6,
                 from kernel/params.c:18:
kernel/params.c: In function 'param_array':
kernel/params.c:32:42: error: dereferencing pointer to incomplete type
 #define KPARAM_MUTEX(mod) ((mod) ? &(mod)->param_lock : &param_lock)
                                          ^
include/linux/compiler.h:164:42: note: in definition of macro 'unlikely'
 # define unlikely(x) __builtin_expect(!!(x), 0)
                                          ^
kernel/params.c:462:3: note: in expansion of macro 'BUG_ON'
   BUG_ON(!KPARAM_IS_LOCKED(mod));
   ^
kernel/params.c:33:47: note: in expansion of macro 'KPARAM_MUTEX'
 #define KPARAM_IS_LOCKED(mod) mutex_is_locked(KPARAM_MUTEX(mod))
                                               ^
kernel/params.c:462:11: note: in expansion of macro 'KPARAM_IS_LOCKED'
   BUG_ON(!KPARAM_IS_LOCKED(mod));
           ^
kernel/params.c: In function 'param_array_get':
kernel/params.c:32:42: error: dereferencing pointer to incomplete type
 #define KPARAM_MUTEX(mod) ((mod) ? &(mod)->param_lock : &param_lock)
                                          ^
include/linux/compiler.h:164:42: note: in definition of macro 'unlikely'
 # define unlikely(x) __builtin_expect(!!(x), 0)
                                          ^
kernel/params.c:499:3: note: in expansion of macro 'BUG_ON'
   BUG_ON(!KPARAM_IS_LOCKED(p.mod));
   ^
kernel/params.c:33:47: note: in expansion of macro 'KPARAM_MUTEX'
 #define KPARAM_IS_LOCKED(mod) mutex_is_locked(KPARAM_MUTEX(mod))
                                               ^
kernel/params.c:499:11: note: in expansion of macro 'KPARAM_IS_LOCKED'
   BUG_ON(!KPARAM_IS_LOCKED(p.mod));
           ^
In file included from include/linux/notifier.h:13:0,
                 from include/linux/memory_hotplug.h:6,
                 from include/linux/mmzone.h:789,
                 from include/linux/gfp.h:5,
                 from include/linux/kmod.h:22,
                 from include/linux/module.h:13,
                 from kernel/params.c:21:
kernel/params.c: In function 'kernel_param_lock':
kernel/params.c:32:42: error: dereferencing pointer to incomplete type
 #define KPARAM_MUTEX(mod) ((mod) ? &(mod)->param_lock : &param_lock)
                                          ^
include/linux/mutex.h:146:44: note: in definition of macro 'mutex_lock'
 #define mutex_lock(lock) mutex_lock_nested(lock, 0)
                                            ^
kernel/params.c:621:13: note: in expansion of macro 'KPARAM_MUTEX'
  mutex_lock(KPARAM_MUTEX(mod));
             ^
kernel/params.c: In function 'kernel_param_unlock':
kernel/params.c:32:42: error: dereferencing pointer to incomplete type
 #define KPARAM_MUTEX(mod) ((mod) ? &(mod)->param_lock : &param_lock)
                                          ^
kernel/params.c:626:15: note: in expansion of macro 'KPARAM_MUTEX'
  mutex_unlock(KPARAM_MUTEX(mod));
               ^

Caused by commit b51d23e4e9fe ("module: add per-module param_lock").

I am not exactly sure why this fails to build.  It may be an
interaction with some other change.

I have used the modules tree from next-20150623 for today.

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* linux-next: build failure after merge of the modules tree
@ 2014-12-18  2:05 Stephen Rothwell
  0 siblings, 0 replies; 43+ messages in thread
From: Stephen Rothwell @ 2014-12-18  2:05 UTC (permalink / raw)
  To: Rusty Russell; +Cc: linux-next, linux-kernel, Kees Cook

[-- Attachment #1: Type: text/plain, Size: 539 bytes --]

Hi Rusty,

After merging the modules tree, today's linux-next build (powerpc ppc64_defconfig)
failed like this:

kernel/params.c: In function 'add_sysfs_param':
kernel/params.c:649:9: error: 'struct module_kobject' has no member named 'kp'
  if ((mk->kp->perm & (S_IWUSR | S_IWGRP | S_IWOTH)) != 0)
         ^

Caused by commit 12491941a26c ("param: do not set store func without write perm").

I have used the modules tree from next-20141217 for today.
-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: linux-next: build failure after merge of the modules tree
  2014-08-07 13:07     ` Rusty Russell
@ 2014-08-08  1:33       ` Stephen Rothwell
  0 siblings, 0 replies; 43+ messages in thread
From: Stephen Rothwell @ 2014-08-08  1:33 UTC (permalink / raw)
  To: Rusty Russell; +Cc: linux-next, linux-kernel, Stewart Smith

[-- Attachment #1: Type: text/plain, Size: 731 bytes --]

Hi Rusty,

On Thu, 07 Aug 2014 22:37:50 +0930 Rusty Russell <rusty@rustcorp.com.au> wrote:
>
> Stephen Rothwell <sfr@canb.auug.org.au> writes:
> > Hi Rusty,
> >
> > On Thu, 07 Aug 2014 21:07:20 +0930 Rusty Russell <rusty@rustcorp.com.au> wrote:
> >>
> >> Ah, crap.  I really hate that macro magic :(
> >> 
> >> I amended to the minimal fix, so we can pretend that never happened.
> >
> > How about arch/powerpc/platforms/powernv/opal-dump.c as well?
> 
> Hmm, I didn't see that one.

It was in the original report, but I guess a bit hidden by all the guff
the gcc spews out these days.

> I've done that as a separate patch.

Thanks.

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: linux-next: build failure after merge of the modules tree
  2014-08-07 13:03   ` Stephen Rothwell
@ 2014-08-07 13:07     ` Rusty Russell
  2014-08-08  1:33       ` Stephen Rothwell
  0 siblings, 1 reply; 43+ messages in thread
From: Rusty Russell @ 2014-08-07 13:07 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: linux-next, linux-kernel, Stewart Smith

Stephen Rothwell <sfr@canb.auug.org.au> writes:
> Hi Rusty,
>
> On Thu, 07 Aug 2014 21:07:20 +0930 Rusty Russell <rusty@rustcorp.com.au> wrote:
>>
>> Ah, crap.  I really hate that macro magic :(
>> 
>> I amended to the minimal fix, so we can pretend that never happened.
>
> How about arch/powerpc/platforms/powernv/opal-dump.c as well?

Hmm, I didn't see that one.

I've done that as a separate patch.

Thanks,
Rusty.

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

* Re: linux-next: build failure after merge of the modules tree
  2014-08-07 11:37 ` Rusty Russell
@ 2014-08-07 13:03   ` Stephen Rothwell
  2014-08-07 13:07     ` Rusty Russell
  0 siblings, 1 reply; 43+ messages in thread
From: Stephen Rothwell @ 2014-08-07 13:03 UTC (permalink / raw)
  To: Rusty Russell; +Cc: linux-next, linux-kernel, Stewart Smith

[-- Attachment #1: Type: text/plain, Size: 360 bytes --]

Hi Rusty,

On Thu, 07 Aug 2014 21:07:20 +0930 Rusty Russell <rusty@rustcorp.com.au> wrote:
>
> Ah, crap.  I really hate that macro magic :(
> 
> I amended to the minimal fix, so we can pretend that never happened.

How about arch/powerpc/platforms/powernv/opal-dump.c as well?

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: linux-next: build failure after merge of the modules tree
  2014-08-07  3:20 Stephen Rothwell
@ 2014-08-07 11:37 ` Rusty Russell
  2014-08-07 13:03   ` Stephen Rothwell
  0 siblings, 1 reply; 43+ messages in thread
From: Rusty Russell @ 2014-08-07 11:37 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: linux-next, linux-kernel, Stewart Smith

Stephen Rothwell <sfr@canb.auug.org.au> writes:
> Hi Rusty,
>
> After merging the modules tree, today's linux-next build (powerpc
> ppc64_defconfig) failed like this:
>
> arch/powerpc/platforms/powernv/opal-elog.c:85:28: error: macro "__ATTR_RO" passed 2 arguments, but takes just 1
>   __ATTR_RO(id, elog_id_show);

Ah, crap.  I really hate that macro magic :(

I amended to the minimal fix, so we can pretend that never happened.

Cheers,
Rusty.

commit 6656c21ca10e54a84673d0ec2f0cf5f676e66a40
Author: Rusty Russell <rusty@rustcorp.com.au>
Date:   Wed Aug 6 10:15:36 2014 +0930

    arch/powerpc/platforms/powernv/opal-elog.c: fix world-writable sysfs files
    
    If you don't have a store function, you're not writable anyway!
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    Acked-by: Stewart Smith <stewart@linux.vnet.ibm.com>

diff --git a/arch/powerpc/platforms/powernv/opal-elog.c b/arch/powerpc/platforms/powernv/opal-elog.c
index 10268c41d830..925bad993e30 100644
--- a/arch/powerpc/platforms/powernv/opal-elog.c
+++ b/arch/powerpc/platforms/powernv/opal-elog.c
@@ -82,9 +82,9 @@ static ssize_t elog_ack_store(struct elog_obj *elog_obj,
 }
 
 static struct elog_attribute id_attribute =
-	__ATTR(id, 0666, elog_id_show, NULL);
+	__ATTR(id, S_IRUGO, elog_id_show, NULL);
 static struct elog_attribute type_attribute =
-	__ATTR(type, 0666, elog_type_show, NULL);
+	__ATTR(type, S_IRUGO, elog_type_show, NULL);
 static struct elog_attribute ack_attribute =
 	__ATTR(acknowledge, 0660, elog_ack_show, elog_ack_store);
 

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

* linux-next: build failure after merge of the modules tree
@ 2014-08-07  3:20 Stephen Rothwell
  2014-08-07 11:37 ` Rusty Russell
  0 siblings, 1 reply; 43+ messages in thread
From: Stephen Rothwell @ 2014-08-07  3:20 UTC (permalink / raw)
  To: Rusty Russell; +Cc: linux-next, linux-kernel, Stewart Smith

[-- Attachment #1: Type: text/plain, Size: 996 bytes --]

Hi Rusty,

After merging the modules tree, today's linux-next build (powerpc
ppc64_defconfig) failed like this:

arch/powerpc/platforms/powernv/opal-elog.c:85:28: error: macro "__ATTR_RO" passed 2 arguments, but takes just 1
  __ATTR_RO(id, elog_id_show);
                            ^
arch/powerpc/platforms/powernv/opal-elog.c:85:2: error: '__ATTR_RO' undeclared here (not in a function)
  __ATTR_RO(id, elog_id_show);
  ^
arch/powerpc/platforms/powernv/opal-elog.c:87:32: error: macro "__ATTR_RO" passed 2 arguments, but takes just 1
  __ATTR_RO(type, elog_type_show);
                                ^

And it went down hill from there ...

Caused by commit ba987e9b8ab1
("arch/powerpc/platforms/powernv/opal-elog.c: fix world-writable sysfs
files").

I have used the modules tree from next-20140725 again for today.

There is still the error in
arch/powerpc/platforms/powernv/opal-dump.c ...

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: linux-next: build failure after merge of the modules tree
  2014-07-28  3:58 Stephen Rothwell
@ 2014-07-28 11:38 ` Rusty Russell
  0 siblings, 0 replies; 43+ messages in thread
From: Rusty Russell @ 2014-07-28 11:38 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: linux-next, linux-kernel

Stephen Rothwell <sfr@canb.auug.org.au> writes:
> Hi Rusty,
>
> After merging the modules tree, today's linux-next build (powerpc
> ppc64_defconfig) failed like this:

Thanks, I've sent off a fix for that file, and asked Stewart for an
Ack:

Subject: arch/powerpc/platforms/powernv/opal-elog.c: fix world-writable sysfs files

If you don't have a store function, you're not writable anyway!

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

diff --git a/arch/powerpc/platforms/powernv/opal-elog.c b/arch/powerpc/platforms/powernv/opal-elog.c
index 10268c41d830..d59dc2a60260 100644
--- a/arch/powerpc/platforms/powernv/opal-elog.c
+++ b/arch/powerpc/platforms/powernv/opal-elog.c
@@ -82,9 +82,9 @@ static ssize_t elog_ack_store(struct elog_obj *elog_obj,
 }
 
 static struct elog_attribute id_attribute =
-	__ATTR(id, 0666, elog_id_show, NULL);
+	__ATTR_RO(id, elog_id_show);
 static struct elog_attribute type_attribute =
-	__ATTR(type, 0666, elog_type_show, NULL);
+	__ATTR_RO(type, elog_type_show);
 static struct elog_attribute ack_attribute =
 	__ATTR(acknowledge, 0660, elog_ack_show, elog_ack_store);
 

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

* linux-next: build failure after merge of the modules tree
@ 2014-07-28  3:58 Stephen Rothwell
  2014-07-28 11:38 ` Rusty Russell
  0 siblings, 1 reply; 43+ messages in thread
From: Stephen Rothwell @ 2014-07-28  3:58 UTC (permalink / raw)
  To: Rusty Russell; +Cc: linux-next, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 4471 bytes --]

Hi Rusty,

After merging the modules tree, today's linux-next build (powerpc
ppc64_defconfig) failed like this:

In file included from include/linux/thread_info.h:11:0,
                 from arch/powerpc/include/asm/ptrace.h:151,
                 from arch/powerpc/include/asm/processor.h:44,
                 from arch/powerpc/include/asm/mmu-hash64.h:25,
                 from arch/powerpc/include/asm/mmu.h:189,
                 from arch/powerpc/include/asm/lppaca.h:36,
                 from arch/powerpc/include/asm/paca.h:20,
                 from arch/powerpc/include/asm/current.h:16,
                 from include/linux/mutex.h:13,
                 from include/linux/kernfs.h:13,
                 from include/linux/sysfs.h:15,
                 from include/linux/kobject.h:21,
                 from include/linux/of.h:21,
                 from arch/powerpc/platforms/powernv/opal-elog.c:13:
include/linux/bug.h:33:45: error: negative width in bit-field '<anonymous>'
 #define BUILD_BUG_ON_ZERO(e) (sizeof(struct { int:-!!(e); }))
                                             ^
include/linux/kernel.h:853:3: note: in expansion of macro 'BUILD_BUG_ON_ZERO'
   BUILD_BUG_ON_ZERO((perms) & 2) +    \
   ^
include/linux/sysfs.h:75:12: note: in expansion of macro 'VERIFY_OCTAL_PERMISSIONS'
    .mode = VERIFY_OCTAL_PERMISSIONS(_mode) },  \
            ^
arch/powerpc/platforms/powernv/opal-elog.c:85:2: note: in expansion of macro '__ATTR'
  __ATTR(id, 0666, elog_id_show, NULL);
  ^
include/linux/bug.h:33:45: error: negative width in bit-field '<anonymous>'
 #define BUILD_BUG_ON_ZERO(e) (sizeof(struct { int:-!!(e); }))
                                             ^
include/linux/kernel.h:853:3: note: in expansion of macro 'BUILD_BUG_ON_ZERO'
   BUILD_BUG_ON_ZERO((perms) & 2) +    \
   ^
include/linux/sysfs.h:75:12: note: in expansion of macro 'VERIFY_OCTAL_PERMISSIONS'
    .mode = VERIFY_OCTAL_PERMISSIONS(_mode) },  \
            ^
arch/powerpc/platforms/powernv/opal-elog.c:87:2: note: in expansion of macro '__ATTR'
  __ATTR(type, 0666, elog_type_show, NULL);
  ^
In file included from include/linux/thread_info.h:11:0,
                 from arch/powerpc/include/asm/ptrace.h:151,
                 from arch/powerpc/include/asm/processor.h:44,
                 from arch/powerpc/include/asm/mmu-hash64.h:25,
                 from arch/powerpc/include/asm/mmu.h:189,
                 from arch/powerpc/include/asm/lppaca.h:36,
                 from arch/powerpc/include/asm/paca.h:20,
                 from arch/powerpc/include/asm/current.h:16,
                 from include/linux/mutex.h:13,
                 from include/linux/kernfs.h:13,
                 from include/linux/sysfs.h:15,
                 from include/linux/kobject.h:21,
                 from arch/powerpc/platforms/powernv/opal-dump.c:12:
include/linux/bug.h:33:45: error: negative width in bit-field '<anonymous>'
 #define BUILD_BUG_ON_ZERO(e) (sizeof(struct { int:-!!(e); }))
                                             ^
include/linux/kernel.h:853:3: note: in expansion of macro 'BUILD_BUG_ON_ZERO'
   BUILD_BUG_ON_ZERO((perms) & 2) +    \
   ^
include/linux/sysfs.h:75:12: note: in expansion of macro 'VERIFY_OCTAL_PERMISSIONS'
    .mode = VERIFY_OCTAL_PERMISSIONS(_mode) },  \
            ^
arch/powerpc/platforms/powernv/opal-dump.c:105:2: note: in expansion of macro '__ATTR'
  __ATTR(id, 0666, dump_id_show, NULL);
  ^
include/linux/bug.h:33:45: error: negative width in bit-field '<anonymous>'
 #define BUILD_BUG_ON_ZERO(e) (sizeof(struct { int:-!!(e); }))
                                             ^
include/linux/kernel.h:853:3: note: in expansion of macro 'BUILD_BUG_ON_ZERO'
   BUILD_BUG_ON_ZERO((perms) & 2) +    \
   ^
include/linux/sysfs.h:75:12: note: in expansion of macro 'VERIFY_OCTAL_PERMISSIONS'
    .mode = VERIFY_OCTAL_PERMISSIONS(_mode) },  \
            ^
arch/powerpc/platforms/powernv/opal-dump.c:107:2: note: in expansion of macro '__ATTR'
  __ATTR(type, 0666, dump_type_show, NULL);
  ^

Caused by commit 37549e94c77a ("sysfs: disallow world-writable files")
interacting with commit c7e64b9ce04a ("powerpc/powernv Platform dump
interface") from v3.15-rc1.  I guess this patch needs updating ...

I have used the modules tree form next-20140725 for today.
-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: linux-next: build failure after merge of the modules tree
  2014-03-25  3:02 Stephen Rothwell
@ 2014-03-31  3:45 ` Rusty Russell
  0 siblings, 0 replies; 43+ messages in thread
From: Rusty Russell @ 2014-03-31  3:45 UTC (permalink / raw)
  To: Stephen Rothwell, Greg KH; +Cc: linux-next, linux-kernel, William Hubbs

Stephen Rothwell <sfr@canb.auug.org.au> writes:
> Hi Rusty,
>
> After merging the modules tree, today's linux-next build (x86_64
> allmodconfig) failed like this:

Hmm, I sent Greg KH a separate patch for staging, which rips these out
altogether.  He said he'd apply it "in a bit".

I see it hasn't hit mainline yet, so here it is.

From: Rusty Russell <rusty@rustcorp.com.au>
Subject: staging: fix up speakup kobject mode

It uses the unnecessary S_IFREG bit which will break when my
stricter-checking-for-mode patch goes in.

Since we're fixing it anyway, the extra level of indirection is
confusing for readers (ROOT_W == rw-r--r-- for example).

Also, many of these are other-writable.  Is that really intended?

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
---
 drivers/staging/speakup/kobjects.c       | 62 ++++++++++++++++----------------
 drivers/staging/speakup/speakup.h        |  2 --
 drivers/staging/speakup/speakup_acntpc.c | 22 ++++++------
 drivers/staging/speakup/speakup_acntsa.c | 22 ++++++------
 drivers/staging/speakup/speakup_apollo.c | 24 ++++++-------
 drivers/staging/speakup/speakup_audptr.c | 24 ++++++-------
 drivers/staging/speakup/speakup_bns.c    | 22 ++++++------
 drivers/staging/speakup/speakup_decext.c | 24 ++++++-------
 drivers/staging/speakup/speakup_decpc.c  | 24 ++++++-------
 drivers/staging/speakup/speakup_dectlk.c | 24 ++++++-------
 drivers/staging/speakup/speakup_dtlk.c   | 28 +++++++--------
 drivers/staging/speakup/speakup_dummy.c  | 22 ++++++------
 drivers/staging/speakup/speakup_keypc.c  | 18 +++++-----
 drivers/staging/speakup/speakup_ltlk.c   | 28 +++++++--------
 drivers/staging/speakup/speakup_soft.c   | 30 ++++++++--------
 drivers/staging/speakup/speakup_spkout.c | 24 ++++++-------
 drivers/staging/speakup/speakup_txprt.c  | 22 ++++++------
 17 files changed, 210 insertions(+), 212 deletions(-)

diff --git a/drivers/staging/speakup/kobjects.c b/drivers/staging/speakup/kobjects.c
index e2f597ee6261..1ca91f7092b1 100644
--- a/drivers/staging/speakup/kobjects.c
+++ b/drivers/staging/speakup/kobjects.c
@@ -851,75 +851,75 @@ static ssize_t message_store(struct kobject *kobj, struct kobj_attribute *attr,
  * Declare the attributes.
  */
 static struct kobj_attribute keymap_attribute =
-	__ATTR(keymap, ROOT_W, keymap_show, keymap_store);
+	__ATTR(keymap, S_IWUSR|S_IRUGO, keymap_show, keymap_store);
 static struct kobj_attribute silent_attribute =
-	__ATTR(silent, USER_W, NULL, silent_store);
+	__ATTR(silent, S_IWUGO, NULL, silent_store);
 static struct kobj_attribute synth_attribute =
-	__ATTR(synth, USER_RW, synth_show, synth_store);
+	__ATTR(synth, S_IWUGO|S_IRUGO, synth_show, synth_store);
 static struct kobj_attribute synth_direct_attribute =
-	__ATTR(synth_direct, USER_W, NULL, synth_direct_store);
+	__ATTR(synth_direct, S_IWUGO, NULL, synth_direct_store);
 static struct kobj_attribute version_attribute =
 	__ATTR_RO(version);
 
 static struct kobj_attribute delimiters_attribute =
-	__ATTR(delimiters, USER_RW, punc_show, punc_store);
+	__ATTR(delimiters, S_IWUGO|S_IRUGO, punc_show, punc_store);
 static struct kobj_attribute ex_num_attribute =
-	__ATTR(ex_num, USER_RW, punc_show, punc_store);
+	__ATTR(ex_num, S_IWUGO|S_IRUGO, punc_show, punc_store);
 static struct kobj_attribute punc_all_attribute =
-	__ATTR(punc_all, USER_RW, punc_show, punc_store);
+	__ATTR(punc_all, S_IWUGO|S_IRUGO, punc_show, punc_store);
 static struct kobj_attribute punc_most_attribute =
-	__ATTR(punc_most, USER_RW, punc_show, punc_store);
+	__ATTR(punc_most, S_IWUGO|S_IRUGO, punc_show, punc_store);
 static struct kobj_attribute punc_some_attribute =
-	__ATTR(punc_some, USER_RW, punc_show, punc_store);
+	__ATTR(punc_some, S_IWUGO|S_IRUGO, punc_show, punc_store);
 static struct kobj_attribute repeats_attribute =
-	__ATTR(repeats, USER_RW, punc_show, punc_store);
+	__ATTR(repeats, S_IWUGO|S_IRUGO, punc_show, punc_store);
 
 static struct kobj_attribute attrib_bleep_attribute =
-	__ATTR(attrib_bleep, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(attrib_bleep, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute bell_pos_attribute =
-	__ATTR(bell_pos, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(bell_pos, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute bleep_time_attribute =
-	__ATTR(bleep_time, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(bleep_time, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute bleeps_attribute =
-	__ATTR(bleeps, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(bleeps, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute cursor_time_attribute =
-	__ATTR(cursor_time, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(cursor_time, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute key_echo_attribute =
-	__ATTR(key_echo, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(key_echo, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute no_interrupt_attribute =
-	__ATTR(no_interrupt, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(no_interrupt, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute punc_level_attribute =
-	__ATTR(punc_level, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(punc_level, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute reading_punc_attribute =
-	__ATTR(reading_punc, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(reading_punc, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute say_control_attribute =
-	__ATTR(say_control, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(say_control, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute say_word_ctl_attribute =
-	__ATTR(say_word_ctl, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(say_word_ctl, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute spell_delay_attribute =
-	__ATTR(spell_delay, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(spell_delay, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 
 /*
  * These attributes are i18n related.
  */
 static struct kobj_attribute announcements_attribute =
-	__ATTR(announcements, USER_RW, message_show, message_store);
+	__ATTR(announcements, S_IWUGO|S_IRUGO, message_show, message_store);
 static struct kobj_attribute characters_attribute =
-	__ATTR(characters, USER_RW, chars_chartab_show, chars_chartab_store);
+	__ATTR(characters, S_IWUGO|S_IRUGO, chars_chartab_show, chars_chartab_store);
 static struct kobj_attribute chartab_attribute =
-	__ATTR(chartab, USER_RW, chars_chartab_show, chars_chartab_store);
+	__ATTR(chartab, S_IWUGO|S_IRUGO, chars_chartab_show, chars_chartab_store);
 static struct kobj_attribute ctl_keys_attribute =
-	__ATTR(ctl_keys, USER_RW, message_show, message_store);
+	__ATTR(ctl_keys, S_IWUGO|S_IRUGO, message_show, message_store);
 static struct kobj_attribute colors_attribute =
-	__ATTR(colors, USER_RW, message_show, message_store);
+	__ATTR(colors, S_IWUGO|S_IRUGO, message_show, message_store);
 static struct kobj_attribute formatted_attribute =
-	__ATTR(formatted, USER_RW, message_show, message_store);
+	__ATTR(formatted, S_IWUGO|S_IRUGO, message_show, message_store);
 static struct kobj_attribute function_names_attribute =
-	__ATTR(function_names, USER_RW, message_show, message_store);
+	__ATTR(function_names, S_IWUGO|S_IRUGO, message_show, message_store);
 static struct kobj_attribute key_names_attribute =
-	__ATTR(key_names, USER_RW, message_show, message_store);
+	__ATTR(key_names, S_IWUGO|S_IRUGO, message_show, message_store);
 static struct kobj_attribute states_attribute =
-	__ATTR(states, USER_RW, message_show, message_store);
+	__ATTR(states, S_IWUGO|S_IRUGO, message_show, message_store);
 
 /*
  * Create groups of attributes so that we can create and destroy them all
diff --git a/drivers/staging/speakup/speakup.h b/drivers/staging/speakup/speakup.h
index 0126f714821a..a7bcceec436a 100644
--- a/drivers/staging/speakup/speakup.h
+++ b/drivers/staging/speakup/speakup.h
@@ -12,8 +12,6 @@
 /* proc permissions */
 #define USER_R (S_IFREG|S_IRUGO)
 #define USER_W (S_IFREG|S_IWUGO)
-#define USER_RW (S_IFREG|S_IRUGO|S_IWUGO)
-#define ROOT_W (S_IFREG|S_IRUGO|S_IWUSR)
 
 #define TOGGLE_0 .u.n = {NULL, 0, 0, 1, 0, 0, NULL }
 #define TOGGLE_1 .u.n = {NULL, 1, 0, 1, 0, 0, NULL }
diff --git a/drivers/staging/speakup/speakup_acntpc.c b/drivers/staging/speakup/speakup_acntpc.c
index 1c8a7f4a0ef5..e7dfa434bd96 100644
--- a/drivers/staging/speakup/speakup_acntpc.c
+++ b/drivers/staging/speakup/speakup_acntpc.c
@@ -62,28 +62,28 @@ static struct var_t vars[] = {
  * These attributes will appear in /sys/accessibility/speakup/acntpc.
  */
 static struct kobj_attribute caps_start_attribute =
-	__ATTR(caps_start, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(caps_start, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute caps_stop_attribute =
-	__ATTR(caps_stop, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(caps_stop, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute pitch_attribute =
-	__ATTR(pitch, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(pitch, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute rate_attribute =
-	__ATTR(rate, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(rate, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute tone_attribute =
-	__ATTR(tone, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(tone, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute vol_attribute =
-	__ATTR(vol, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(vol, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 
 static struct kobj_attribute delay_time_attribute =
-	__ATTR(delay_time, ROOT_W, spk_var_show, spk_var_store);
+	__ATTR(delay_time, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute direct_attribute =
-	__ATTR(direct, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(direct, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute full_time_attribute =
-	__ATTR(full_time, ROOT_W, spk_var_show, spk_var_store);
+	__ATTR(full_time, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute jiffy_delta_attribute =
-	__ATTR(jiffy_delta, ROOT_W, spk_var_show, spk_var_store);
+	__ATTR(jiffy_delta, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute trigger_time_attribute =
-	__ATTR(trigger_time, ROOT_W, spk_var_show, spk_var_store);
+	__ATTR(trigger_time, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store);
 
 /*
  * Create a group of attributes so that we can create and destroy them all
diff --git a/drivers/staging/speakup/speakup_acntsa.c b/drivers/staging/speakup/speakup_acntsa.c
index 22a8b7291098..c7f014ed9628 100644
--- a/drivers/staging/speakup/speakup_acntsa.c
+++ b/drivers/staging/speakup/speakup_acntsa.c
@@ -47,28 +47,28 @@ static struct var_t vars[] = {
  * These attributes will appear in /sys/accessibility/speakup/acntsa.
  */
 static struct kobj_attribute caps_start_attribute =
-	__ATTR(caps_start, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(caps_start, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute caps_stop_attribute =
-	__ATTR(caps_stop, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(caps_stop, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute pitch_attribute =
-	__ATTR(pitch, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(pitch, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute rate_attribute =
-	__ATTR(rate, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(rate, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute tone_attribute =
-	__ATTR(tone, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(tone, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute vol_attribute =
-	__ATTR(vol, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(vol, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 
 static struct kobj_attribute delay_time_attribute =
-	__ATTR(delay_time, ROOT_W, spk_var_show, spk_var_store);
+	__ATTR(delay_time, S_IRUSR|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute direct_attribute =
-	__ATTR(direct, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(direct, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute full_time_attribute =
-	__ATTR(full_time, ROOT_W, spk_var_show, spk_var_store);
+	__ATTR(full_time, S_IRUSR|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute jiffy_delta_attribute =
-	__ATTR(jiffy_delta, ROOT_W, spk_var_show, spk_var_store);
+	__ATTR(jiffy_delta, S_IRUSR|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute trigger_time_attribute =
-	__ATTR(trigger_time, ROOT_W, spk_var_show, spk_var_store);
+	__ATTR(trigger_time, S_IRUSR|S_IRUGO, spk_var_show, spk_var_store);
 
 /*
  * Create a group of attributes so that we can create and destroy them all
diff --git a/drivers/staging/speakup/speakup_apollo.c b/drivers/staging/speakup/speakup_apollo.c
index 70cf1591676a..38c8c2221e4e 100644
--- a/drivers/staging/speakup/speakup_apollo.c
+++ b/drivers/staging/speakup/speakup_apollo.c
@@ -53,30 +53,30 @@ static struct var_t vars[] = {
  * These attributes will appear in /sys/accessibility/speakup/apollo.
  */
 static struct kobj_attribute caps_start_attribute =
-	__ATTR(caps_start, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(caps_start, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute caps_stop_attribute =
-	__ATTR(caps_stop, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(caps_stop, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute lang_attribute =
-	__ATTR(lang, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(lang, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute pitch_attribute =
-	__ATTR(pitch, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(pitch, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute rate_attribute =
-	__ATTR(rate, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(rate, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute voice_attribute =
-	__ATTR(voice, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(voice, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute vol_attribute =
-	__ATTR(vol, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(vol, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 
 static struct kobj_attribute delay_time_attribute =
-	__ATTR(delay_time, ROOT_W, spk_var_show, spk_var_store);
+	__ATTR(delay_time, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute direct_attribute =
-	__ATTR(direct, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(direct, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute full_time_attribute =
-	__ATTR(full_time, ROOT_W, spk_var_show, spk_var_store);
+	__ATTR(full_time, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute jiffy_delta_attribute =
-	__ATTR(jiffy_delta, ROOT_W, spk_var_show, spk_var_store);
+	__ATTR(jiffy_delta, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute trigger_time_attribute =
-	__ATTR(trigger_time, ROOT_W, spk_var_show, spk_var_store);
+	__ATTR(trigger_time, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store);
 
 /*
  * Create a group of attributes so that we can create and destroy them all
diff --git a/drivers/staging/speakup/speakup_audptr.c b/drivers/staging/speakup/speakup_audptr.c
index 61a3ceeb0d3a..de5b4a5f43b6 100644
--- a/drivers/staging/speakup/speakup_audptr.c
+++ b/drivers/staging/speakup/speakup_audptr.c
@@ -49,30 +49,30 @@ static struct var_t vars[] = {
  * These attributes will appear in /sys/accessibility/speakup/audptr.
  */
 static struct kobj_attribute caps_start_attribute =
-	__ATTR(caps_start, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(caps_start, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute caps_stop_attribute =
-	__ATTR(caps_stop, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(caps_stop, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute pitch_attribute =
-	__ATTR(pitch, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(pitch, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute punct_attribute =
-	__ATTR(punct, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(punct, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute rate_attribute =
-	__ATTR(rate, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(rate, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute tone_attribute =
-	__ATTR(tone, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(tone, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute vol_attribute =
-	__ATTR(vol, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(vol, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 
 static struct kobj_attribute delay_time_attribute =
-	__ATTR(delay_time, ROOT_W, spk_var_show, spk_var_store);
+	__ATTR(delay_time, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute direct_attribute =
-	__ATTR(direct, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(direct, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute full_time_attribute =
-	__ATTR(full_time, ROOT_W, spk_var_show, spk_var_store);
+	__ATTR(full_time, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute jiffy_delta_attribute =
-	__ATTR(jiffy_delta, ROOT_W, spk_var_show, spk_var_store);
+	__ATTR(jiffy_delta, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute trigger_time_attribute =
-	__ATTR(trigger_time, ROOT_W, spk_var_show, spk_var_store);
+	__ATTR(trigger_time, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store);
 
 /*
  * Create a group of attributes so that we can create and destroy them all
diff --git a/drivers/staging/speakup/speakup_bns.c b/drivers/staging/speakup/speakup_bns.c
index 4bfe3d458dc0..4939e8c7272e 100644
--- a/drivers/staging/speakup/speakup_bns.c
+++ b/drivers/staging/speakup/speakup_bns.c
@@ -44,28 +44,28 @@ static struct var_t vars[] = {
  * These attributes will appear in /sys/accessibility/speakup/bns.
  */
 static struct kobj_attribute caps_start_attribute =
-	__ATTR(caps_start, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(caps_start, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute caps_stop_attribute =
-	__ATTR(caps_stop, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(caps_stop, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute pitch_attribute =
-	__ATTR(pitch, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(pitch, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute rate_attribute =
-	__ATTR(rate, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(rate, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute tone_attribute =
-	__ATTR(tone, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(tone, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute vol_attribute =
-	__ATTR(vol, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(vol, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 
 static struct kobj_attribute delay_time_attribute =
-	__ATTR(delay_time, ROOT_W, spk_var_show, spk_var_store);
+	__ATTR(delay_time, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute direct_attribute =
-	__ATTR(direct, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(direct, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute full_time_attribute =
-	__ATTR(full_time, ROOT_W, spk_var_show, spk_var_store);
+	__ATTR(full_time, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute jiffy_delta_attribute =
-	__ATTR(jiffy_delta, ROOT_W, spk_var_show, spk_var_store);
+	__ATTR(jiffy_delta, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute trigger_time_attribute =
-	__ATTR(trigger_time, ROOT_W, spk_var_show, spk_var_store);
+	__ATTR(trigger_time, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store);
 
 /*
  * Create a group of attributes so that we can create and destroy them all
diff --git a/drivers/staging/speakup/speakup_decext.c b/drivers/staging/speakup/speakup_decext.c
index d306e010d3ea..b17af9803929 100644
--- a/drivers/staging/speakup/speakup_decext.c
+++ b/drivers/staging/speakup/speakup_decext.c
@@ -70,30 +70,30 @@ static struct var_t vars[] = {
  * These attributes will appear in /sys/accessibility/speakup/decext.
  */
 static struct kobj_attribute caps_start_attribute =
-	__ATTR(caps_start, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(caps_start, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute caps_stop_attribute =
-	__ATTR(caps_stop, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(caps_stop, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute pitch_attribute =
-	__ATTR(pitch, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(pitch, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute punct_attribute =
-	__ATTR(punct, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(punct, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute rate_attribute =
-	__ATTR(rate, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(rate, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute voice_attribute =
-	__ATTR(voice, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(voice, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute vol_attribute =
-	__ATTR(vol, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(vol, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 
 static struct kobj_attribute delay_time_attribute =
-	__ATTR(delay_time, ROOT_W, spk_var_show, spk_var_store);
+	__ATTR(delay_time, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute direct_attribute =
-	__ATTR(direct, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(direct, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute full_time_attribute =
-	__ATTR(full_time, ROOT_W, spk_var_show, spk_var_store);
+	__ATTR(full_time, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute jiffy_delta_attribute =
-	__ATTR(jiffy_delta, ROOT_W, spk_var_show, spk_var_store);
+	__ATTR(jiffy_delta, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute trigger_time_attribute =
-	__ATTR(trigger_time, ROOT_W, spk_var_show, spk_var_store);
+	__ATTR(trigger_time, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store);
 
 /*
  * Create a group of attributes so that we can create and destroy them all
diff --git a/drivers/staging/speakup/speakup_decpc.c b/drivers/staging/speakup/speakup_decpc.c
index ea6b72d40b31..cfa4bc032358 100644
--- a/drivers/staging/speakup/speakup_decpc.c
+++ b/drivers/staging/speakup/speakup_decpc.c
@@ -164,30 +164,30 @@ static struct var_t vars[] = {
  * These attributes will appear in /sys/accessibility/speakup/decpc.
  */
 static struct kobj_attribute caps_start_attribute =
-	__ATTR(caps_start, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(caps_start, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute caps_stop_attribute =
-	__ATTR(caps_stop, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(caps_stop, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute pitch_attribute =
-	__ATTR(pitch, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(pitch, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute punct_attribute =
-	__ATTR(punct, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(punct, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute rate_attribute =
-	__ATTR(rate, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(rate, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute voice_attribute =
-	__ATTR(voice, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(voice, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute vol_attribute =
-	__ATTR(vol, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(vol, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 
 static struct kobj_attribute delay_time_attribute =
-	__ATTR(delay_time, ROOT_W, spk_var_show, spk_var_store);
+	__ATTR(delay_time, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute direct_attribute =
-	__ATTR(direct, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(direct, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute full_time_attribute =
-	__ATTR(full_time, ROOT_W, spk_var_show, spk_var_store);
+	__ATTR(full_time, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute jiffy_delta_attribute =
-	__ATTR(jiffy_delta, ROOT_W, spk_var_show, spk_var_store);
+	__ATTR(jiffy_delta, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute trigger_time_attribute =
-	__ATTR(trigger_time, ROOT_W, spk_var_show, spk_var_store);
+	__ATTR(trigger_time, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store);
 
 /*
  * Create a group of attributes so that we can create and destroy them all
diff --git a/drivers/staging/speakup/speakup_dectlk.c b/drivers/staging/speakup/speakup_dectlk.c
index 15fdec323a70..0a27c8f32bb9 100644
--- a/drivers/staging/speakup/speakup_dectlk.c
+++ b/drivers/staging/speakup/speakup_dectlk.c
@@ -70,30 +70,30 @@ static struct var_t vars[] = {
  * These attributes will appear in /sys/accessibility/speakup/dectlk.
  */
 static struct kobj_attribute caps_start_attribute =
-	__ATTR(caps_start, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(caps_start, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute caps_stop_attribute =
-	__ATTR(caps_stop, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(caps_stop, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute pitch_attribute =
-	__ATTR(pitch, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(pitch, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute punct_attribute =
-	__ATTR(punct, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(punct, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute rate_attribute =
-	__ATTR(rate, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(rate, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute voice_attribute =
-	__ATTR(voice, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(voice, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute vol_attribute =
-	__ATTR(vol, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(vol, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 
 static struct kobj_attribute delay_time_attribute =
-	__ATTR(delay_time, ROOT_W, spk_var_show, spk_var_store);
+	__ATTR(delay_time, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute direct_attribute =
-	__ATTR(direct, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(direct, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute full_time_attribute =
-	__ATTR(full_time, ROOT_W, spk_var_show, spk_var_store);
+	__ATTR(full_time, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute jiffy_delta_attribute =
-	__ATTR(jiffy_delta, ROOT_W, spk_var_show, spk_var_store);
+	__ATTR(jiffy_delta, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute trigger_time_attribute =
-	__ATTR(trigger_time, ROOT_W, spk_var_show, spk_var_store);
+	__ATTR(trigger_time, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store);
 
 /*
  * Create a group of attributes so that we can create and destroy them all
diff --git a/drivers/staging/speakup/speakup_dtlk.c b/drivers/staging/speakup/speakup_dtlk.c
index 1feb0fba1b43..5c6c34191e8d 100644
--- a/drivers/staging/speakup/speakup_dtlk.c
+++ b/drivers/staging/speakup/speakup_dtlk.c
@@ -67,34 +67,34 @@ static struct var_t vars[] = {
  * These attributes will appear in /sys/accessibility/speakup/dtlk.
  */
 static struct kobj_attribute caps_start_attribute =
-	__ATTR(caps_start, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(caps_start, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute caps_stop_attribute =
-	__ATTR(caps_stop, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(caps_stop, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute freq_attribute =
-	__ATTR(freq, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(freq, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute pitch_attribute =
-	__ATTR(pitch, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(pitch, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute punct_attribute =
-	__ATTR(punct, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(punct, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute rate_attribute =
-	__ATTR(rate, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(rate, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute tone_attribute =
-	__ATTR(tone, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(tone, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute voice_attribute =
-	__ATTR(voice, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(voice, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute vol_attribute =
-	__ATTR(vol, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(vol, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 
 static struct kobj_attribute delay_time_attribute =
-	__ATTR(delay_time, ROOT_W, spk_var_show, spk_var_store);
+	__ATTR(delay_time, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute direct_attribute =
-	__ATTR(direct, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(direct, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute full_time_attribute =
-	__ATTR(full_time, ROOT_W, spk_var_show, spk_var_store);
+	__ATTR(full_time, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute jiffy_delta_attribute =
-	__ATTR(jiffy_delta, ROOT_W, spk_var_show, spk_var_store);
+	__ATTR(jiffy_delta, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute trigger_time_attribute =
-	__ATTR(trigger_time, ROOT_W, spk_var_show, spk_var_store);
+	__ATTR(trigger_time, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store);
 
 /*
  * Create a group of attributes so that we can create and destroy them all
diff --git a/drivers/staging/speakup/speakup_dummy.c b/drivers/staging/speakup/speakup_dummy.c
index 4a24b9c1e8e3..e19e9994bbb5 100644
--- a/drivers/staging/speakup/speakup_dummy.c
+++ b/drivers/staging/speakup/speakup_dummy.c
@@ -46,28 +46,28 @@ static struct var_t vars[] = {
  * These attributes will appear in /sys/accessibility/speakup/dummy.
  */
 static struct kobj_attribute caps_start_attribute =
-	__ATTR(caps_start, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(caps_start, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute caps_stop_attribute =
-	__ATTR(caps_stop, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(caps_stop, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute pitch_attribute =
-	__ATTR(pitch, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(pitch, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute rate_attribute =
-	__ATTR(rate, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(rate, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute tone_attribute =
-	__ATTR(tone, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(tone, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute vol_attribute =
-	__ATTR(vol, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(vol, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 
 static struct kobj_attribute delay_time_attribute =
-	__ATTR(delay_time, ROOT_W, spk_var_show, spk_var_store);
+	__ATTR(delay_time, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute direct_attribute =
-	__ATTR(direct, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(direct, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute full_time_attribute =
-	__ATTR(full_time, ROOT_W, spk_var_show, spk_var_store);
+	__ATTR(full_time, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute jiffy_delta_attribute =
-	__ATTR(jiffy_delta, ROOT_W, spk_var_show, spk_var_store);
+	__ATTR(jiffy_delta, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute trigger_time_attribute =
-	__ATTR(trigger_time, ROOT_W, spk_var_show, spk_var_store);
+	__ATTR(trigger_time, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store);
 
 /*
  * Create a group of attributes so that we can create and destroy them all
diff --git a/drivers/staging/speakup/speakup_keypc.c b/drivers/staging/speakup/speakup_keypc.c
index 2f2fe5eeff63..9c246d701a95 100644
--- a/drivers/staging/speakup/speakup_keypc.c
+++ b/drivers/staging/speakup/speakup_keypc.c
@@ -59,24 +59,24 @@ static struct var_t vars[] = {
  * These attributes will appear in /sys/accessibility/speakup/keypc.
  */
 static struct kobj_attribute caps_start_attribute =
-	__ATTR(caps_start, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(caps_start, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute caps_stop_attribute =
-	__ATTR(caps_stop, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(caps_stop, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute pitch_attribute =
-	__ATTR(pitch, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(pitch, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute rate_attribute =
-	__ATTR(rate, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(rate, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 
 static struct kobj_attribute delay_time_attribute =
-	__ATTR(delay_time, ROOT_W, spk_var_show, spk_var_store);
+	__ATTR(delay_time, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute direct_attribute =
-	__ATTR(direct, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(direct, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute full_time_attribute =
-	__ATTR(full_time, ROOT_W, spk_var_show, spk_var_store);
+	__ATTR(full_time, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute jiffy_delta_attribute =
-	__ATTR(jiffy_delta, ROOT_W, spk_var_show, spk_var_store);
+	__ATTR(jiffy_delta, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute trigger_time_attribute =
-	__ATTR(trigger_time, ROOT_W, spk_var_show, spk_var_store);
+	__ATTR(trigger_time, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store);
 
 /*
  * Create a group of attributes so that we can create and destroy them all
diff --git a/drivers/staging/speakup/speakup_ltlk.c b/drivers/staging/speakup/speakup_ltlk.c
index 326f94d6b079..c9be6f52c254 100644
--- a/drivers/staging/speakup/speakup_ltlk.c
+++ b/drivers/staging/speakup/speakup_ltlk.c
@@ -50,34 +50,34 @@ static struct var_t vars[] = {
  * These attributes will appear in /sys/accessibility/speakup/ltlk.
  */
 static struct kobj_attribute caps_start_attribute =
-	__ATTR(caps_start, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(caps_start, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute caps_stop_attribute =
-	__ATTR(caps_stop, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(caps_stop, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute freq_attribute =
-	__ATTR(freq, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(freq, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute pitch_attribute =
-	__ATTR(pitch, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(pitch, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute punct_attribute =
-	__ATTR(punct, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(punct, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute rate_attribute =
-	__ATTR(rate, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(rate, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute tone_attribute =
-	__ATTR(tone, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(tone, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute voice_attribute =
-	__ATTR(voice, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(voice, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute vol_attribute =
-	__ATTR(vol, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(vol, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 
 static struct kobj_attribute delay_time_attribute =
-	__ATTR(delay_time, ROOT_W, spk_var_show, spk_var_store);
+	__ATTR(delay_time, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute direct_attribute =
-	__ATTR(direct, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(direct, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute full_time_attribute =
-	__ATTR(full_time, ROOT_W, spk_var_show, spk_var_store);
+	__ATTR(full_time, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute jiffy_delta_attribute =
-	__ATTR(jiffy_delta, ROOT_W, spk_var_show, spk_var_store);
+	__ATTR(jiffy_delta, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute trigger_time_attribute =
-	__ATTR(trigger_time, ROOT_W, spk_var_show, spk_var_store);
+	__ATTR(trigger_time, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store);
 
 /*
  * Create a group of attributes so that we can create and destroy them all
diff --git a/drivers/staging/speakup/speakup_soft.c b/drivers/staging/speakup/speakup_soft.c
index 243c3d52fe5e..ee6089502a96 100644
--- a/drivers/staging/speakup/speakup_soft.c
+++ b/drivers/staging/speakup/speakup_soft.c
@@ -61,41 +61,41 @@ static struct var_t vars[] = {
  * These attributes will appear in /sys/accessibility/speakup/soft.
  */
 static struct kobj_attribute caps_start_attribute =
-	__ATTR(caps_start, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(caps_start, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute caps_stop_attribute =
-	__ATTR(caps_stop, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(caps_stop, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute freq_attribute =
-	__ATTR(freq, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(freq, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute pitch_attribute =
-	__ATTR(pitch, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(pitch, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute punct_attribute =
-	__ATTR(punct, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(punct, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute rate_attribute =
-	__ATTR(rate, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(rate, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute tone_attribute =
-	__ATTR(tone, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(tone, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute voice_attribute =
-	__ATTR(voice, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(voice, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute vol_attribute =
-	__ATTR(vol, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(vol, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 
 /*
  * We should uncomment the following definition, when we agree on a
  * method of passing a language designation to the software synthesizer.
  * static struct kobj_attribute lang_attribute =
- *	__ATTR(lang, USER_RW, spk_var_show, spk_var_store);
+ *	__ATTR(lang, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
  */
 
 static struct kobj_attribute delay_time_attribute =
-	__ATTR(delay_time, ROOT_W, spk_var_show, spk_var_store);
+	__ATTR(delay_time, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute direct_attribute =
-	__ATTR(direct, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(direct, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute full_time_attribute =
-	__ATTR(full_time, ROOT_W, spk_var_show, spk_var_store);
+	__ATTR(full_time, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute jiffy_delta_attribute =
-	__ATTR(jiffy_delta, ROOT_W, spk_var_show, spk_var_store);
+	__ATTR(jiffy_delta, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute trigger_time_attribute =
-	__ATTR(trigger_time, ROOT_W, spk_var_show, spk_var_store);
+	__ATTR(trigger_time, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store);
 
 /*
  * Create a group of attributes so that we can create and destroy them all
diff --git a/drivers/staging/speakup/speakup_spkout.c b/drivers/staging/speakup/speakup_spkout.c
index e74f85620c68..711cf114df83 100644
--- a/drivers/staging/speakup/speakup_spkout.c
+++ b/drivers/staging/speakup/speakup_spkout.c
@@ -48,30 +48,30 @@ static struct var_t vars[] = {
  * These attributes will appear in /sys/accessibility/speakup/spkout.
  */
 static struct kobj_attribute caps_start_attribute =
-	__ATTR(caps_start, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(caps_start, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute caps_stop_attribute =
-	__ATTR(caps_stop, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(caps_stop, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute pitch_attribute =
-	__ATTR(pitch, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(pitch, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute punct_attribute =
-	__ATTR(punct, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(punct, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute rate_attribute =
-	__ATTR(rate, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(rate, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute tone_attribute =
-	__ATTR(tone, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(tone, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute vol_attribute =
-	__ATTR(vol, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(vol, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 
 static struct kobj_attribute delay_time_attribute =
-	__ATTR(delay_time, ROOT_W, spk_var_show, spk_var_store);
+	__ATTR(delay_time, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute direct_attribute =
-	__ATTR(direct, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(direct, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute full_time_attribute =
-	__ATTR(full_time, ROOT_W, spk_var_show, spk_var_store);
+	__ATTR(full_time, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute jiffy_delta_attribute =
-	__ATTR(jiffy_delta, ROOT_W, spk_var_show, spk_var_store);
+	__ATTR(jiffy_delta, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute trigger_time_attribute =
-	__ATTR(trigger_time, ROOT_W, spk_var_show, spk_var_store);
+	__ATTR(trigger_time, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store);
 
 /*
  * Create a group of attributes so that we can create and destroy them all
diff --git a/drivers/staging/speakup/speakup_txprt.c b/drivers/staging/speakup/speakup_txprt.c
index 5a29b9fcc930..3f0be04df071 100644
--- a/drivers/staging/speakup/speakup_txprt.c
+++ b/drivers/staging/speakup/speakup_txprt.c
@@ -44,28 +44,28 @@ static struct var_t vars[] = {
  * These attributes will appear in /sys/accessibility/speakup/txprt.
  */
 static struct kobj_attribute caps_start_attribute =
-	__ATTR(caps_start, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(caps_start, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute caps_stop_attribute =
-	__ATTR(caps_stop, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(caps_stop, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute pitch_attribute =
-	__ATTR(pitch, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(pitch, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute rate_attribute =
-	__ATTR(rate, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(rate, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute tone_attribute =
-	__ATTR(tone, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(tone, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute vol_attribute =
-	__ATTR(vol, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(vol, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 
 static struct kobj_attribute delay_time_attribute =
-	__ATTR(delay_time, ROOT_W, spk_var_show, spk_var_store);
+	__ATTR(delay_time, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute direct_attribute =
-	__ATTR(direct, USER_RW, spk_var_show, spk_var_store);
+	__ATTR(direct, S_IWUGO|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute full_time_attribute =
-	__ATTR(full_time, ROOT_W, spk_var_show, spk_var_store);
+	__ATTR(full_time, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute jiffy_delta_attribute =
-	__ATTR(jiffy_delta, ROOT_W, spk_var_show, spk_var_store);
+	__ATTR(jiffy_delta, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store);
 static struct kobj_attribute trigger_time_attribute =
-	__ATTR(trigger_time, ROOT_W, spk_var_show, spk_var_store);
+	__ATTR(trigger_time, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store);
 
 /*
  * Create a group of attributes so that we can create and destroy them all

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

* linux-next: build failure after merge of the modules tree
@ 2014-03-25  3:02 Stephen Rothwell
  2014-03-31  3:45 ` Rusty Russell
  0 siblings, 1 reply; 43+ messages in thread
From: Stephen Rothwell @ 2014-03-25  3:02 UTC (permalink / raw)
  To: Rusty Russell, Greg KH; +Cc: linux-next, linux-kernel, William Hubbs

[-- Attachment #1: Type: text/plain, Size: 2698 bytes --]

Hi Rusty,

After merging the modules tree, today's linux-next build (x86_64
allmodconfig) failed like this:

In file included from include/linux/thread_info.h:11:0,
                 from arch/x86/include/asm/preempt.h:6,
                 from include/linux/preempt.h:18,
                 from include/linux/spinlock.h:50,
                 from include/linux/wait.h:8,
                 from include/linux/fs.h:6,
                 from drivers/staging/speakup/spk_types.h:9,
                 from drivers/staging/speakup/spk_priv.h:27,
                 from drivers/staging/speakup/speakup_acntsa.c:26:
include/linux/bug.h:33:45: error: negative width in bit-field '<anonymous>'
 #define BUILD_BUG_ON_ZERO(e) (sizeof(struct { int:-!!(e); }))
                                             ^
include/linux/kernel.h:848:3: note: in expansion of macro 'BUILD_BUG_ON_ZERO'
   BUILD_BUG_ON_ZERO((perms) > 0777) +    \
   ^
include/linux/sysfs.h:75:12: note: in expansion of macro 'VERIFY_OCTAL_PERMISSIONS'
    .mode = VERIFY_OCTAL_PERMISSIONS(_mode) },  \
            ^
drivers/staging/speakup/speakup_acntsa.c:50:2: note: in expansion of macro '__ATTR'
  __ATTR(caps_start, USER_RW, spk_var_show, spk_var_store);
  ^

And many more ...

Exposed by commit 58f86cc89c33 ("VERIFY_OCTAL_PERMISSIONS: stricter
checking for sysfs perms").

drivers/staging/speakup/speakup.h has

#define USER_RW (S_IFREG|S_IRUGO|S_IWUGO)
and others

which are used in many attribute definitions (and only in those
definitions).  So I added this fixup patch (Rusty you might like to add
this to your tree):

From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Tue, 25 Mar 2014 13:54:38 +1100
Subject: [PATCH] VERIFY_OCTAL_PERMISSIONS: fix up for staging/speakup

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
 drivers/staging/speakup/speakup.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/speakup/speakup.h b/drivers/staging/speakup/speakup.h
index 0126f714821a..578824a9829d 100644
--- a/drivers/staging/speakup/speakup.h
+++ b/drivers/staging/speakup/speakup.h
@@ -10,10 +10,10 @@
 #define MAX_DESC_LEN 72
 
 /* proc permissions */
-#define USER_R (S_IFREG|S_IRUGO)
-#define USER_W (S_IFREG|S_IWUGO)
-#define USER_RW (S_IFREG|S_IRUGO|S_IWUGO)
-#define ROOT_W (S_IFREG|S_IRUGO|S_IWUSR)
+#define USER_R S_IRUGO
+#define USER_W S_IWUGO
+#define USER_RW (S_IRUGO|S_IWUGO)
+#define ROOT_W (S_IRUGO|S_IWUSR)
 
 #define TOGGLE_0 .u.n = {NULL, 0, 0, 1, 0, 0, NULL }
 #define TOGGLE_1 .u.n = {NULL, 1, 0, 1, 0, 0, NULL }
-- 
1.9.1

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: linux-next: build failure after merge of the modules tree
  2012-11-28 11:02 ` Stanislaw Gruszka
@ 2012-12-03  0:29   ` Rusty Russell
  0 siblings, 0 replies; 43+ messages in thread
From: Rusty Russell @ 2012-12-03  0:29 UTC (permalink / raw)
  To: Stanislaw Gruszka, Stephen Rothwell
  Cc: linux-next, linux-kernel, Johannes Berg, Wey-Yi Guy, John W. Linville

Stanislaw Gruszka <sgruszka@redhat.com> writes:

> On Mon, Nov 26, 2012 at 03:10:46PM +1100, Stephen Rothwell wrote:
>> After merging the modules tree, today's linux-next build (x86_64
>> allmodconfig) failed like this:
>> 
>> drivers/net/wireless/iwlwifi/iwl-drv.c:1196:1: error: invalid suffix "n_disabletype__8" on integer constant
>> drivers/net/wireless/iwlwifi/iwl-drv.c:1196:1: error: expected identifier or '(' before numeric constant
>> drivers/net/wireless/iwlwifi/iwl-drv.c:1198:1: error: invalid suffix "n_disable__9" on integer constant
>> drivers/net/wireless/iwlwifi/iwl-drv.c:1198:1: error: expected identifier or '(' before numeric constant
>> drivers/net/wireless/iwlwifi/iwl-drv.c:1263:1: error: invalid suffix "ghz_disabletype__32" on integer constant
>> drivers/net/wireless/iwlwifi/iwl-drv.c:1263:1: error: expected identifier or '(' before numeric constant
>> drivers/net/wireless/iwlwifi/iwl-drv.c:1264:1: error: invalid suffix "ghz_disable__33" on integer constant
>> drivers/net/wireless/iwlwifi/iwl-drv.c:1264:1: error: expected identifier or '(' before numeric constant
>> drivers/net/wireless/iwlegacy/4965-mac.c:6825:1: error: invalid suffix "n_disabletype__11" on integer constant
>> drivers/net/wireless/iwlegacy/4965-mac.c:6825:1: error: expected identifier or '(' before numeric constant
>> drivers/net/wireless/iwlegacy/4965-mac.c:6826:1: error: invalid suffix "n_disable__12" on integer constant
>> drivers/net/wireless/iwlegacy/4965-mac.c:6826:1: error: expected identifier or '(' before numeric constant
>> 
>> Presumably caused by commit 58876af0436e ("moduleparam: use __UNIQUE_ID
>> ()").  This commit removed the "__mod_" prefix that used to be added to
>> the front of the "name" passed to module_param_named().  Admittedly, the
>> documentation says that "name" must be "a valid C identifier which is the
>> parameter name", but the (ab)usage here used to work (the name starts
>> with a number).
>
> I prefer not to change module parameters name, since there are users
> who use current name in they modprobe config.
>
> Stanislaw

Yes, the names can't be changed.

Here's the patch I've applied, which fixes it:

>From 7a918c7fb6499179e14a4e23a5ccff0ab920ffe0 Mon Sep 17 00:00:00 2001
From: Rusty Russell <rusty@rustcorp.com.au>
Date: Mon, 3 Dec 2012 10:49:29 +1030
Subject: [PATCH] compiler: fix UNIQUE_ID() for non-identifier names.

Some modules have parameters starting with digits, so always prepend UNIQUE_ID_
which ensures we produce a valid identifier, plus leave a clue if you
should encounter such a symbol.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
---
 include/linux/compiler-gcc4.h |    2 +-
 include/linux/compiler.h      |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/linux/compiler-gcc4.h b/include/linux/compiler-gcc4.h
index 8908821..56c802c 100644
--- a/include/linux/compiler-gcc4.h
+++ b/include/linux/compiler-gcc4.h
@@ -31,7 +31,7 @@
 
 #define __linktime_error(message) __attribute__((__error__(message)))
 
-#define __UNIQUE_ID(prefix) __PASTE(prefix, __PASTE(__, __COUNTER__))
+#define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__)
 
 #if __GNUC_MINOR__ >= 5
 /*
diff --git a/include/linux/compiler.h b/include/linux/compiler.h
index c55ae87..5f45335 100644
--- a/include/linux/compiler.h
+++ b/include/linux/compiler.h
@@ -170,7 +170,7 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect);
 
 /* Not-quite-unique ID. */
 #ifndef __UNIQUE_ID
-# define __UNIQUE_ID(prefix) __PASTE(__PASTE(prefix, __), __LINE__)
+# define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __LINE__)
 #endif
 
 #endif /* __KERNEL__ */
-- 
1.7.10.4


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

* Re: linux-next: build failure after merge of the modules tree
  2012-11-26  4:10 Stephen Rothwell
@ 2012-11-28 11:02 ` Stanislaw Gruszka
  2012-12-03  0:29   ` Rusty Russell
  0 siblings, 1 reply; 43+ messages in thread
From: Stanislaw Gruszka @ 2012-11-28 11:02 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Rusty Russell, linux-next, linux-kernel, Johannes Berg,
	Wey-Yi Guy, John W. Linville

On Mon, Nov 26, 2012 at 03:10:46PM +1100, Stephen Rothwell wrote:
> After merging the modules tree, today's linux-next build (x86_64
> allmodconfig) failed like this:
> 
> drivers/net/wireless/iwlwifi/iwl-drv.c:1196:1: error: invalid suffix "n_disabletype__8" on integer constant
> drivers/net/wireless/iwlwifi/iwl-drv.c:1196:1: error: expected identifier or '(' before numeric constant
> drivers/net/wireless/iwlwifi/iwl-drv.c:1198:1: error: invalid suffix "n_disable__9" on integer constant
> drivers/net/wireless/iwlwifi/iwl-drv.c:1198:1: error: expected identifier or '(' before numeric constant
> drivers/net/wireless/iwlwifi/iwl-drv.c:1263:1: error: invalid suffix "ghz_disabletype__32" on integer constant
> drivers/net/wireless/iwlwifi/iwl-drv.c:1263:1: error: expected identifier or '(' before numeric constant
> drivers/net/wireless/iwlwifi/iwl-drv.c:1264:1: error: invalid suffix "ghz_disable__33" on integer constant
> drivers/net/wireless/iwlwifi/iwl-drv.c:1264:1: error: expected identifier or '(' before numeric constant
> drivers/net/wireless/iwlegacy/4965-mac.c:6825:1: error: invalid suffix "n_disabletype__11" on integer constant
> drivers/net/wireless/iwlegacy/4965-mac.c:6825:1: error: expected identifier or '(' before numeric constant
> drivers/net/wireless/iwlegacy/4965-mac.c:6826:1: error: invalid suffix "n_disable__12" on integer constant
> drivers/net/wireless/iwlegacy/4965-mac.c:6826:1: error: expected identifier or '(' before numeric constant
> 
> Presumably caused by commit 58876af0436e ("moduleparam: use __UNIQUE_ID
> ()").  This commit removed the "__mod_" prefix that used to be added to
> the front of the "name" passed to module_param_named().  Admittedly, the
> documentation says that "name" must be "a valid C identifier which is the
> parameter name", but the (ab)usage here used to work (the name starts
> with a number).

I prefer not to change module parameters name, since there are users
who use current name in they modprobe config.

Stanislaw


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

* linux-next: build failure after merge of the modules tree
@ 2012-11-26  4:10 Stephen Rothwell
  2012-11-28 11:02 ` Stanislaw Gruszka
  0 siblings, 1 reply; 43+ messages in thread
From: Stephen Rothwell @ 2012-11-26  4:10 UTC (permalink / raw)
  To: Rusty Russell
  Cc: linux-next, linux-kernel, Stanislaw Gruszka, Johannes Berg,
	Wey-Yi Guy, John W. Linville

[-- Attachment #1: Type: text/plain, Size: 1922 bytes --]

Hi Rusty,

After merging the modules tree, today's linux-next build (x86_64
allmodconfig) failed like this:

drivers/net/wireless/iwlwifi/iwl-drv.c:1196:1: error: invalid suffix "n_disabletype__8" on integer constant
drivers/net/wireless/iwlwifi/iwl-drv.c:1196:1: error: expected identifier or '(' before numeric constant
drivers/net/wireless/iwlwifi/iwl-drv.c:1198:1: error: invalid suffix "n_disable__9" on integer constant
drivers/net/wireless/iwlwifi/iwl-drv.c:1198:1: error: expected identifier or '(' before numeric constant
drivers/net/wireless/iwlwifi/iwl-drv.c:1263:1: error: invalid suffix "ghz_disabletype__32" on integer constant
drivers/net/wireless/iwlwifi/iwl-drv.c:1263:1: error: expected identifier or '(' before numeric constant
drivers/net/wireless/iwlwifi/iwl-drv.c:1264:1: error: invalid suffix "ghz_disable__33" on integer constant
drivers/net/wireless/iwlwifi/iwl-drv.c:1264:1: error: expected identifier or '(' before numeric constant
drivers/net/wireless/iwlegacy/4965-mac.c:6825:1: error: invalid suffix "n_disabletype__11" on integer constant
drivers/net/wireless/iwlegacy/4965-mac.c:6825:1: error: expected identifier or '(' before numeric constant
drivers/net/wireless/iwlegacy/4965-mac.c:6826:1: error: invalid suffix "n_disable__12" on integer constant
drivers/net/wireless/iwlegacy/4965-mac.c:6826:1: error: expected identifier or '(' before numeric constant

Presumably caused by commit 58876af0436e ("moduleparam: use __UNIQUE_ID
()").  This commit removed the "__mod_" prefix that used to be added to
the front of the "name" passed to module_param_named().  Admittedly, the
documentation says that "name" must be "a valid C identifier which is the
parameter name", but the (ab)usage here used to work (the name starts
with a number).

I have used the modules tree from 20121115 for today.
-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: linux-next: build failure after merge of the modules tree
  2012-11-02  1:57 Stephen Rothwell
@ 2012-11-02  3:16 ` Rusty Russell
  0 siblings, 0 replies; 43+ messages in thread
From: Rusty Russell @ 2012-11-02  3:16 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: linux-next, linux-kernel, Andrew Morton, Matthew Leach

Stephen Rothwell <sfr@canb.auug.org.au> writes:
> Hi Rusty,
>
> After merging the modules tree, today's linux-next build (powerpc
> ppc64_defconfig) failed like this:

As this is in Andrew's tree, I've reverted it from my modules-next tree.

Thanks,
Rusty.

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

* linux-next: build failure after merge of the modules tree
@ 2012-11-02  1:57 Stephen Rothwell
  2012-11-02  3:16 ` Rusty Russell
  0 siblings, 1 reply; 43+ messages in thread
From: Stephen Rothwell @ 2012-11-02  1:57 UTC (permalink / raw)
  To: Rusty Russell; +Cc: linux-next, linux-kernel, Andrew Morton, Matthew Leach

[-- Attachment #1: Type: text/plain, Size: 943 bytes --]

Hi Rusty,

After merging the modules tree, today's linux-next build (powerpc
ppc64_defconfig) failed like this:

arch/powerpc/platforms/pasemi/idle.c:88:1: error: macro "__define_initcall" passed 3 arguments, but takes just 2
arch/powerpc/platforms/pasemi/idle.c:88:1: error: data definition has no type or storage class [-Werror]
arch/powerpc/platforms/pasemi/idle.c:88:1: error: type defaults to 'int' in declaration of '__define_initcall' [-Werror=implicit-int]
arch/powerpc/platforms/pasemi/idle.c:88:1: error: '__machine_initcall_pasemi_pasemi_idle_init' defined but not used [-Werror=unused-function]

And several more similar.

Caused (again - a fixed version of this patch is in the akpm tree) by
commit 9f859bf82c1d ("init: Use the stringify operator for the
__define_initcall macro").

I have use the modules tree from next-20121101 for today.
-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

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

end of thread, other threads:[~2024-02-02  1:03 UTC | newest]

Thread overview: 43+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-09 10:08 linux-next: build failure after merge of the modules tree Stephen Rothwell
2021-02-09 15:16 ` Jessica Yu
2021-02-09 16:06   ` Christoph Hellwig
2021-02-09 21:50   ` Stephen Rothwell
2021-02-10  8:06     ` Jessica Yu
2021-02-10  8:37       ` Masahiro Yamada
2021-02-11  6:19         ` Masahiro Yamada
2021-02-10 12:21       ` Stephen Rothwell
2021-02-10 16:16         ` Jessica Yu
  -- strict thread matches above, loose matches on Subject: below --
2024-02-02  1:03 Stephen Rothwell
2022-11-14  0:13 Stephen Rothwell
2022-11-14  8:01 ` Jiri Olsa
2022-11-14  9:08   ` Leizhen (ThunderTown)
2022-02-21 16:07 broonie
2022-02-23  0:32 ` Luis Chamberlain
2022-02-28  5:13   ` Stephen Rothwell
2022-02-28 18:16     ` Luis Chamberlain
2019-06-25  4:27 Stephen Rothwell
2015-12-01 20:23 Mark Brown
2015-12-02  3:23 ` Rusty Russell
2015-11-27  1:26 Stephen Rothwell
2015-11-27  2:57 ` Rusty Russell
2015-06-25  6:54 Stephen Rothwell
2015-06-25  9:51 ` Dan Streetman
2015-06-24  1:37 Stephen Rothwell
2015-06-24 18:18 ` Dan Streetman
2015-06-24 22:57   ` Stephen Rothwell
2015-06-25  1:50     ` Stephen Rothwell
2014-12-18  2:05 Stephen Rothwell
2014-08-07  3:20 Stephen Rothwell
2014-08-07 11:37 ` Rusty Russell
2014-08-07 13:03   ` Stephen Rothwell
2014-08-07 13:07     ` Rusty Russell
2014-08-08  1:33       ` Stephen Rothwell
2014-07-28  3:58 Stephen Rothwell
2014-07-28 11:38 ` Rusty Russell
2014-03-25  3:02 Stephen Rothwell
2014-03-31  3:45 ` Rusty Russell
2012-11-26  4:10 Stephen Rothwell
2012-11-28 11:02 ` Stanislaw Gruszka
2012-12-03  0:29   ` Rusty Russell
2012-11-02  1:57 Stephen Rothwell
2012-11-02  3:16 ` Rusty Russell

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).