Re: [RFC PATCH next-20200930] treewide: Convert macro and uses of __section(foo) to __section("foo")

8 messages, 5 authors, 2020-10-06 · open the first message on its own page

Re: [RFC PATCH next-20200930] treewide: Convert macro and uses of __section(foo) to __section("foo")

From: Miguel Ojeda <hidden>
Date: 2020-10-01 10:15:54

Hi Joe,

On Thu, Oct 1, 2020 at 12:56 AM Joe Perches [off-list ref] wrote:
So I installed the powerpc cross compiler, and
nope, that doesn't work, it makes a mess.
Thanks a lot for reviving the script and sending the treewide cleanup!
So it looks like the best option is to exclude these
2 files from conversion.
Agreed. Nevertheless, is there any reason arch/powerpc/* should not be
compiling cleanly with compiler.h? (CC'ing the rest of the PowerPC
reviewers and ML).

Cheers,
Miguel

Re: [RFC PATCH next-20200930] treewide: Convert macro and uses of __section(foo) to __section("foo")

From: Joe Perches <joe@perches.com>
Date: 2020-10-01 19:05:47

On Thu, 2020-10-01 at 12:15 +0200, Miguel Ojeda wrote:
Hi Joe,
Buenas Miguel.
On Thu, Oct 1, 2020 at 12:56 AM Joe Perches [off-list ref] wrote:
quoted
So I installed the powerpc cross compiler, and
nope, that doesn't work, it makes a mess.
Thanks a lot for reviving the script and sending the treewide cleanup!
No charge...

I think the end result is cleaner and more obvious.
quoted
So it looks like the best option is to exclude these
2 files from conversion.
Agreed. Nevertheless, is there any reason arch/powerpc/* should not be
compiling cleanly with compiler.h? (CC'ing the rest of the PowerPC
reviewers and ML).
That's not a can of worms I care to open.
Perhaps the powerpc folk can do some fishing.

Re: [RFC PATCH next-20200930] treewide: Convert macro and uses of __section(foo) to __section("foo")

From: Segher Boessenkool <hidden>
Date: 2020-10-01 19:49:48

Hi!

On Thu, Oct 01, 2020 at 12:15:39PM +0200, Miguel Ojeda wrote:
quoted
So it looks like the best option is to exclude these
2 files from conversion.
Agreed. Nevertheless, is there any reason arch/powerpc/* should not be
compiling cleanly with compiler.h? (CC'ing the rest of the PowerPC
reviewers and ML).
You need to #include compiler_types.h to get this #define?

(The twice-defined thing is a warning, not an error.  It should be fixed
of course, but it is less important; although it may be pointing to a
deeper problem.)


Segher

Re: [RFC PATCH next-20200930] treewide: Convert macro and uses of __section(foo) to __section("foo")

From: Joe Perches <joe@perches.com>
Date: 2020-10-01 20:19:25

On Thu, 2020-10-01 at 14:39 -0500, Segher Boessenkool wrch/ote:
Hi!

On Thu, Oct 01, 2020 at 12:15:39PM +0200, Miguel Ojeda wrote:
quoted
quoted
So it looks like the best option is to exclude these
2 files from conversion.
Agreed. Nevertheless, is there any reason arch/powerpc/* should not be
compiling cleanly with compiler.h? (CC'ing the rest of the PowerPC
reviewers and ML).
You need to #include compiler_types.h to get this #define?
Actually no, you need to add

#include <linux/compiler_attributes.h>

to both files and then it builds properly.

Ideally though nothing should include this file directly.
(The twice-defined thing is a warning, not an error.  It should be fixed
of course, but it is less important; although it may be pointing to a
deeper problem.)


Segher

Re: [RFC PATCH next-20200930] treewide: Convert macro and uses of __section(foo) to __section("foo")

From: Nick Desaulniers <ndesaulniers@google.com>
Date: 2020-10-05 18:36:19

On Thu, Oct 1, 2020 at 1:19 PM Joe Perches [off-list ref] wrote:
On Thu, 2020-10-01 at 14:39 -0500, Segher Boessenkool wrch/ote:
quoted
Hi!

On Thu, Oct 01, 2020 at 12:15:39PM +0200, Miguel Ojeda wrote:
quoted
quoted
So it looks like the best option is to exclude these
2 files from conversion.
Agreed. Nevertheless, is there any reason arch/powerpc/* should not be
compiling cleanly with compiler.h? (CC'ing the rest of the PowerPC
reviewers and ML).
You need to #include compiler_types.h to get this #define?
Actually no, you need to add

#include <linux/compiler_attributes.h>

to both files and then it builds properly.

Ideally though nothing should include this file directly.
That's because Kbuild injects it via command line flag `-include`.
(Well, it injects compiler_types.h which includes this).  If part of
the tree reset KBUILD_CFLAGS, that `-include` gets dropped.  I don't
think there's anything wrong with manually including it and adding `-I
<path>` (capital i) if needed.
quoted
(The twice-defined thing is a warning, not an error.  It should be fixed
of course, but it is less important; although it may be pointing to a
deeper problem.)


Segher

-- 
Thanks,
~Nick Desaulniers

Re: [RFC PATCH next-20200930] treewide: Convert macro and uses of __section(foo) to __section("foo")

From: Joe Perches <joe@perches.com>
Date: 2020-10-05 18:47:01

On Mon, 2020-10-05 at 11:36 -0700, Nick Desaulniers wrote:
I don't think there's anything wrong with manually including it and adding `-I
<path>` (capital i) if needed.
All of this is secondary to the actual change to use
quoted __section("foo") rather than __section(foo)

I'd rather get that done first and then figure out if
additional changes could be done later.


Re: [RFC PATCH next-20200930] treewide: Convert macro and uses of __section(foo) to __section("foo")

From: Joel Stanley <joel@jms.id.au>
Date: 2020-10-06 00:34:50

On Thu, 1 Oct 2020 at 20:19, Joe Perches [off-list ref] wrote:
On Thu, 2020-10-01 at 14:39 -0500, Segher Boessenkool wrch/ote:
quoted
Hi!

On Thu, Oct 01, 2020 at 12:15:39PM +0200, Miguel Ojeda wrote:
quoted
quoted
So it looks like the best option is to exclude these
2 files from conversion.
Agreed. Nevertheless, is there any reason arch/powerpc/* should not be
compiling cleanly with compiler.h? (CC'ing the rest of the PowerPC
reviewers and ML).
You need to #include compiler_types.h to get this #define?
Actually no, you need to add

#include <linux/compiler_attributes.h>

to both files and then it builds properly.

Ideally though nothing should include this file directly.
arch/powerpc/boot is the powerpc wrapper, and it's not built with the
same includes or flags as the rest of the kernel. It doesn't include
any of the headers in the top level include/ directory for hysterical
raisins.

The straightforward fix would be to exclude this directory from your script.

Cheers,

Joel

Re: [RFC PATCH next-20200930] treewide: Convert macro and uses of __section(foo) to __section("foo")

From: Joe Perches <joe@perches.com>
Date: 2020-10-06 03:23:03

On Tue, 2020-10-06 at 00:34 +0000, Joel Stanley wrote:
arch/powerpc/boot is the powerpc wrapper, and it's not built with the
same includes or flags as the rest of the kernel. It doesn't include
any of the headers in the top level include/ directory for hysterical
raisins.

The straightforward fix would be to exclude this directory from your script.
I agree and that's why I submitted another script
that does just that.

https://lore.kernel.org/lkml/75393e5ddc272dc7403de74d645e6c6e0f4e70eb.camel@perches.com/

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help