Re: [rfc patch script] treewide conversion of __section(foo) to section("foo");

From: Joe Perches
Date: Tue Sep 17 2019 - 18:28:50 EST


On Mon, 2019-09-16 at 12:45 -0700, Nick Desaulniers wrote:
> On Thu, Sep 12, 2019 at 4:50 PM Joe Perches <joe@xxxxxxxxxxx> wrote:
> > On Thu, 2019-09-12 at 15:45 -0700, Nick Desaulniers wrote:
> > > If you want to email me just the patch file (so I don't have to
> > > copy+pasta from an email),
> >
> > Lazy... ;)
> Says the Perl programmer...http://threevirtues.com/ ;)

Everyone here has most of those. You too.

> > > I'd be happy to apply it and compile+boot test a few more arch's
> > > than x86.
>
> Looks like arm defconfig has an error:

Thanks.

> arch/arm/mach-omap2/omap-wakeupgen.c:634:1: error: expected ';' after
> top level declarator
> ./include/linux/irqchip.h:27:43: note: expanded from macro 'IRQCHIP_DECLARE'
> #define IRQCHIP_DECLARE(name, compat, fn) OF_DECLARE_2(irqchip, name,
> compat, fn)
> ^
> ./include/linux/of.h:1304:3: note: expanded from macro 'OF_DECLARE_2'
> _OF_DECLARE(table, name, compat, fn, of_init_fn_2)
> ^
> ./include/linux/of.h:1284:10: note: expanded from macro '_OF_DECLARE'
> __used __section("__" ## table ## "_of_table") \

Thanks, I stuffed up the # concatenation. I'll fix and send the
script again.
>
> and modpost is broken:
> drivers/cpufreq/cpufreq_conservative.mod.c:12:11: error: expected expression
> __section(.gnu.linkonce.this_module) = {
> ^
> 1 error generated.

This one is because:

scripts/mod/modpost.c: buf_printf(b, "__section(.gnu.linkonce.this_module) = {\n");

Easy to add quotes here, I'll add it to the script.

> Same problem (token pasting then concatenation of strings).

right...