Re: linux-next: build failure after merge of the akpm tree

2020-04-22 Thread Haren Myneni


Thanks for fixing. Tested with this patch and 7fe021a3f1c9 ("kernel: better 
document the use_mm/unuse_mm API contract"). 

Acked-by: Haren Myneni 

On 4/21/20 11:39 PM, Stephen Rothwell wrote:
> Hi all,
> 
> After merging the akpm tree, today's linux-next build (powerpc
> ppc64_defconfig) failed like this:
> 
> arch/powerpc/platforms/powernv/vas-fault.c: In function 'update_csb':
> arch/powerpc/platforms/powernv/vas-fault.c:130:2: error: implicit declaration 
> of function 'use_mm' [-Werror=implicit-function-declaration]
>   130 |  use_mm(window->mm);
>   |  ^~
> arch/powerpc/platforms/powernv/vas-fault.c:142:2: error: implicit declaration 
> of function 'unuse_mm' [-Werror=implicit-function-declaration]
>   142 |  unuse_mm(window->mm);
>   |  ^~~~
> 
> Caused by commit
> 
>   7fe021a3f1c9 ("kernel: better document the use_mm/unuse_mm API contract")
> 
> interacting with commit
> 
>   c96c4436aba4 ("powerpc/vas: Update CSB and notify process for fault CRBs")
> 
> from the powerpc tree.
> 
> I added the following patch for today:
> 
> From: Stephen Rothwell 
> Date: Wed, 22 Apr 2020 16:35:23 +1000
> Subject: [PATCH] powerpc/vas: fix up for {un}use_mm() rename
> 
> Signed-off-by: Stephen Rothwell 
> ---
>  arch/powerpc/platforms/powernv/vas-fault.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/powerpc/platforms/powernv/vas-fault.c 
> b/arch/powerpc/platforms/powernv/vas-fault.c
> index 25db70be4c9c..266a6ca5e15e 100644
> --- a/arch/powerpc/platforms/powernv/vas-fault.c
> +++ b/arch/powerpc/platforms/powernv/vas-fault.c
> @@ -127,7 +127,7 @@ static void update_csb(struct vas_window *window,
>   return;
>   }
>  
> - use_mm(window->mm);
> + kthread_use_mm(window->mm);
>   rc = copy_to_user(csb_addr, , sizeof(csb));
>   /*
>* User space polls on csb.flags (first byte). So add barrier
> @@ -139,7 +139,7 @@ static void update_csb(struct vas_window *window,
>   smp_mb();
>   rc = copy_to_user(csb_addr, , sizeof(u8));
>   }
> - unuse_mm(window->mm);
> + kthread_unuse_mm(window->mm);
>   put_task_struct(tsk);
>  
>   /* Success */
> 


linux-next: build failure after merge of the akpm tree

2020-04-22 Thread Stephen Rothwell
Hi all,

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

arch/powerpc/platforms/powernv/vas-fault.c: In function 'update_csb':
arch/powerpc/platforms/powernv/vas-fault.c:130:2: error: implicit declaration 
of function 'use_mm' [-Werror=implicit-function-declaration]
  130 |  use_mm(window->mm);
  |  ^~
arch/powerpc/platforms/powernv/vas-fault.c:142:2: error: implicit declaration 
of function 'unuse_mm' [-Werror=implicit-function-declaration]
  142 |  unuse_mm(window->mm);
  |  ^~~~

Caused by commit

  7fe021a3f1c9 ("kernel: better document the use_mm/unuse_mm API contract")

interacting with commit

  c96c4436aba4 ("powerpc/vas: Update CSB and notify process for fault CRBs")

from the powerpc tree.

I added the following patch for today:

From: Stephen Rothwell 
Date: Wed, 22 Apr 2020 16:35:23 +1000
Subject: [PATCH] powerpc/vas: fix up for {un}use_mm() rename

Signed-off-by: Stephen Rothwell 
---
 arch/powerpc/platforms/powernv/vas-fault.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/platforms/powernv/vas-fault.c 
b/arch/powerpc/platforms/powernv/vas-fault.c
index 25db70be4c9c..266a6ca5e15e 100644
--- a/arch/powerpc/platforms/powernv/vas-fault.c
+++ b/arch/powerpc/platforms/powernv/vas-fault.c
@@ -127,7 +127,7 @@ static void update_csb(struct vas_window *window,
return;
}
 
-   use_mm(window->mm);
+   kthread_use_mm(window->mm);
rc = copy_to_user(csb_addr, , sizeof(csb));
/*
 * User space polls on csb.flags (first byte). So add barrier
@@ -139,7 +139,7 @@ static void update_csb(struct vas_window *window,
smp_mb();
rc = copy_to_user(csb_addr, , sizeof(u8));
}
-   unuse_mm(window->mm);
+   kthread_unuse_mm(window->mm);
put_task_struct(tsk);
 
/* Success */
-- 
2.25.1

-- 
Cheers,
Stephen Rothwell


pgpLsSAuJPkGA.pgp
Description: OpenPGP digital signature


Re: linux-next: build failure after merge of the akpm tree

2019-02-26 Thread Mike Rapoport
On Tue, Feb 26, 2019 at 06:39:15PM +1100, Stephen Rothwell wrote:
> Hi Andrew,
> 
> After merging the akpm tree, today's linux-next build (powerpc
> allnoconfig) failed like this:
> 
> /home/sfr/next/next/arch/powerpc/kernel/setup_32.c:176:21: error: 
> redefinition of 'alloc_stack'
>  static void *__init alloc_stack(void)
>  ^~~
> /home/sfr/next/next/arch/powerpc/kernel/setup_32.c:165:21: note: previous 
> definition of 'alloc_stack' was here
>  static void *__init alloc_stack(void)
>  ^~~
> 
> Caused by patch
> 
>   "powerpc: use memblock functions returning virtual address"
> 
> from the akpm tree interacting with commit
> 
>   c8e409a33cf8 ("powerpc/irq: use memblock functions returning virtual 
> address")
> 
> from the powerpc tree.
> 
> Both patches added the alloc_stack() function and git resolved it by
> adding both. :-(  I have added a patch to remove one of them.

Yeah, me too :)

https://lore.kernel.org/linux-mm/20190226064032.GA5873@rapoport-lnx/
 
Stephen, sorry, should have cc'ed you

> -- 
> Cheers,
> Stephen Rothwell

-- 
Sincerely yours,
Mike.



linux-next: build failure after merge of the akpm tree

2019-02-25 Thread Stephen Rothwell
Hi Andrew,

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

/home/sfr/next/next/arch/powerpc/kernel/setup_32.c:176:21: error: redefinition 
of 'alloc_stack'
 static void *__init alloc_stack(void)
 ^~~
/home/sfr/next/next/arch/powerpc/kernel/setup_32.c:165:21: note: previous 
definition of 'alloc_stack' was here
 static void *__init alloc_stack(void)
 ^~~

Caused by patch

  "powerpc: use memblock functions returning virtual address"

from the akpm tree interacting with commit

  c8e409a33cf8 ("powerpc/irq: use memblock functions returning virtual address")

from the powerpc tree.

Both patches added the alloc_stack() function and git resolved it by
adding both. :-(  I have added a patch to remove one of them.



-- 
Cheers,
Stephen Rothwell


pgp2t3EGRqL8M.pgp
Description: OpenPGP digital signature


Re: linux-next: build failure after merge of the akpm tree

2018-10-06 Thread Michael Ellerman
Stephen Rothwell  writes:
> Hi Michael,
>
> On Fri, 05 Oct 2018 22:02:45 +1000 Michael Ellerman  
> wrote:
>>
>> Ah fudge, what are the chances we add a new include of bootmem.h just as
>> Mike's removing bootmem.
>
> In my experience, it was almost certain ... almost every API removal
> conflicts with new added uses.  :-)

I suppose. Though the last time we added a new include of bootmem.h was
2015, and that should have actually been memblock.h.

>> I could just apply that to my tree. memblock.h is where early_memtest() is
>> actually defined anyway.
>
> However min_low_pfn and max_low_pfn are defined in bootmem.h until
> after it is removed.

OK. I guess I'll leave it for Andrew to squash in to the series.

cheers


Re: linux-next: build failure after merge of the akpm tree

2018-10-05 Thread Stephen Rothwell
Hi Michael,

On Fri, 05 Oct 2018 22:02:45 +1000 Michael Ellerman  wrote:
>
> Ah fudge, what are the chances we add a new include of bootmem.h just as
> Mike's removing bootmem.

In my experience, it was almost certain ... almost every API removal
conflicts with new added uses.  :-)

> I could just apply that to my tree. memblock.h is where early_memtest() is
> actually defined anyway.

However min_low_pfn and max_low_pfn are defined in bootmem.h until
after it is removed.

-- 
Cheers,
Stephen Rothwell


pgpacOy3MxUkP.pgp
Description: OpenPGP digital signature


Re: linux-next: build failure after merge of the akpm tree

2018-10-05 Thread Michael Ellerman
Stephen Rothwell  writes:
> Hi Andrew,
>
> After merging the akpm tree, today's linux-next build (powerpc
> ppc64_defconfig) failed like this:
>
> arch/powerpc/kernel/setup-common.c:36:10: fatal error: linux/bootmem.h: No 
> such file or directory
>  #include 
>   ^
>
> Caused by commit
>
>   49353a51a758 ("mm: remove include/linux/bootmem.h")
>
> interacting with commit
>
>   d90fe2acd9b2 ("powerpc: Wire up memtest")
>
> from the powerpc tree.

Ah fudge, what are the chances we add a new include of bootmem.h just as
Mike's removing bootmem.

> I applied the following patch for today:
>
> From: Stephen Rothwell 
> Date: Fri, 5 Oct 2018 16:09:34 +1000
> Subject: [PATCH] powerpc: fix up for removal of linux/bootmem.h
>
> Signed-off-by: Stephen Rothwell 
> ---
>  arch/powerpc/kernel/setup-common.c | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/arch/powerpc/kernel/setup-common.c 
> b/arch/powerpc/kernel/setup-common.c
> index 2b56d1f30387..93ee3703b42f 100644
> --- a/arch/powerpc/kernel/setup-common.c
> +++ b/arch/powerpc/kernel/setup-common.c
> @@ -33,7 +33,6 @@
>  #include 
>  #include 
>  #include 
> -#include 
>  #include 
>  #include 
>  #include 

I could just apply that to my tree. memblock.h is where early_memtest() is
actually defined anyway.

cheers


linux-next: build failure after merge of the akpm tree

2018-10-05 Thread Stephen Rothwell
Hi Andrew,

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

arch/powerpc/kernel/setup-common.c:36:10: fatal error: linux/bootmem.h: No such 
file or directory
 #include 
  ^

Caused by commit

  49353a51a758 ("mm: remove include/linux/bootmem.h")

interacting with commit

  d90fe2acd9b2 ("powerpc: Wire up memtest")

from the powerpc tree.

I applied the following patch for today:

From: Stephen Rothwell 
Date: Fri, 5 Oct 2018 16:09:34 +1000
Subject: [PATCH] powerpc: fix up for removal of linux/bootmem.h

Signed-off-by: Stephen Rothwell 
---
 arch/powerpc/kernel/setup-common.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/powerpc/kernel/setup-common.c 
b/arch/powerpc/kernel/setup-common.c
index 2b56d1f30387..93ee3703b42f 100644
--- a/arch/powerpc/kernel/setup-common.c
+++ b/arch/powerpc/kernel/setup-common.c
@@ -33,7 +33,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
-- 
2.18.0

-- 
Cheers,
Stephen Rothwell


pgpyQgPytKSZ_.pgp
Description: OpenPGP digital signature


Re: linux-next: build failure after merge of the akpm tree

2013-10-02 Thread Frederic Weisbecker
On Wed, Sep 25, 2013 at 02:43:28PM -0700, Andrew Morton wrote:
 On Wed, 25 Sep 2013 14:32:14 -0700 (PDT) Hugh Dickins hu...@google.com 
 wrote:
 
  On Wed, 25 Sep 2013, Andrew Morton wrote:
   On Wed, 25 Sep 2013 11:06:43 +1000 Stephen Rothwell 
   s...@canb.auug.org.au wrote:
Hi Andrew,

After merging the akpm tree, linux-next builds (powerpc allmodconfig)
fail like this:
   
   I can't get powerpc to build at all at present:
   
 CHK include/config/kernel.release
 CHK include/generated/uapi/linux/version.h
 CHK include/generated/utsrelease.h
 CC  arch/powerpc/kernel/asm-offsets.s
   In file included from include/linux/vtime.h:6,
from include/linux/hardirq.h:7,
from include/linux/memcontrol.h:24,
from include/linux/swap.h:8,
from include/linux/suspend.h:4,
from arch/powerpc/kernel/asm-offsets.c:24:
   arch/powerpc/include/generated/asm/vtime.h:1:31: error: 
   asm-generic/vtime.h: No such file or directory
  
  That caught me too: include/asm-generic/vtime.h is a patch-unfriendly
  0-length file in the git tree;
 
 hm, this?
 
 
 From: Andrew Morton a...@linux-foundation.org
 Subject: include/asm-generic/vtime.h: avoid zero-length file
 
 patch(1) can't handle zero-length files - it appears to simply not create
 the file, so my powerpc build fails.
 
 Put something in here to make life easier.
 
 Cc: Hugh Dickins hu...@google.com
 Signed-off-by: Andrew Morton a...@linux-foundation.org
 ---
 
  include/asm-generic/vtime.h |1 +
  1 file changed, 1 insertion(+)
 
 diff -puN /dev/null include/asm-generic/vtime.h
 --- /dev/null
 +++ a/include/asm-generic/vtime.h
 @@ -0,0 +1 @@
 +/* no content, but patch(1) dislikes empty files */
 _
 
 
 
  I wonder what use it's supposed to have.
 
 Frederic, can you please confirm that include/asm-generic/vtime.h is
 supposed to be empty?

Yep. I use asm/vtime.h to let archs override some CPP symbols. And if they
don't override these, they simply return the generic vtime.h file that is empty
and as such doesn't override anything.

May be that's an ugly way to handle this kind of override scenario but I
couldn't find a better mechanism.

Actually, a Kconfig symbol would do the trick. It just seemed to me like
an overkill at that time. But it may be better.

Thanks.

 
  (And I'm not very keen on the growing trend for symlinks in the git tree.)
 
 ooh, that explains why I lost my arch/microblaze/boot/dts/system.dts.
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: linux-next: build failure after merge of the akpm tree

2013-09-25 Thread Andrew Morton
On Wed, 25 Sep 2013 11:06:43 +1000 Stephen Rothwell s...@canb.auug.org.au 
wrote:

 Hi Andrew,
 
 After merging the akpm tree, linux-next builds (powerpc allmodconfig)
 fail like this:

I can't get powerpc to build at all at present:

  CHK include/config/kernel.release
  CHK include/generated/uapi/linux/version.h
  CHK include/generated/utsrelease.h
  CC  arch/powerpc/kernel/asm-offsets.s
In file included from include/linux/vtime.h:6,
 from include/linux/hardirq.h:7,
 from include/linux/memcontrol.h:24,
 from include/linux/swap.h:8,
 from include/linux/suspend.h:4,
 from arch/powerpc/kernel/asm-offsets.c:24:
arch/powerpc/include/generated/asm/vtime.h:1:31: error: asm-generic/vtime.h: No 
such file or directory

 drivers/tty/ehv_bytechan.c:362:1: error: type defaults to 'int' in 
 declaration of 'console_initcall' [-Werror=implicit-int]
 
 Caused by commit 0f01cf96c2d4 (./Makefile: enable -Werror=implicit-int
 and -Werror=strict-prototypes by default) which has bee in linux-next
 since Aug 16.  This commit exposed that fact that
 drivers/tty/ehv_bytechan.c can be built as a module, but has a
 console_initcall (which is not available to modules).  This was
 originally introduced in commit dcd83aaff1c8 (tty/powerpc: introduce the
 ePAPR embedded hypervisor byte channel driver) in v3.2.
 
 Anyone got a good solution?

console_initcall() is a macro defined in init.h.  But we forgot to
provide a version for #ifdef MODULE.

At include/linux/init.h line 284 we see:

/* Don't use these in loadable modules, but some people do... */
#define early_initcall(fn)  module_init(fn)
#define core_initcall(fn)   module_init(fn)
...

So we *could* add console_initcall() there.  But the problem is that it
won't work as desired - when the driver is loaded as a module,
ehv_bc_console_init() will be called at modprobe time, which is far far
later than console_initcall-time.

So the ehv_bytechan.c developers need to work out what they want to do
here.  Do we disallow building that driver as a module?  Or do we
permit that, and run ehv_bc_console_init() at modprobe time (needs
testing!).

If the latter then I'd be reluctant to add a modular version of
console_initcall() because the thing's very presence is misleading. 
otoh, drivers which use such a console_initcall() _might_ work, and
everyone tests their drivers both built-in and as modules, don't they? 
Don't they?
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: linux-next: build failure after merge of the akpm tree

2013-09-25 Thread Andrew Morton
On Wed, 25 Sep 2013 14:32:14 -0700 (PDT) Hugh Dickins hu...@google.com wrote:

 On Wed, 25 Sep 2013, Andrew Morton wrote:
  On Wed, 25 Sep 2013 11:06:43 +1000 Stephen Rothwell s...@canb.auug.org.au 
  wrote:
   Hi Andrew,
   
   After merging the akpm tree, linux-next builds (powerpc allmodconfig)
   fail like this:
  
  I can't get powerpc to build at all at present:
  
CHK include/config/kernel.release
CHK include/generated/uapi/linux/version.h
CHK include/generated/utsrelease.h
CC  arch/powerpc/kernel/asm-offsets.s
  In file included from include/linux/vtime.h:6,
   from include/linux/hardirq.h:7,
   from include/linux/memcontrol.h:24,
   from include/linux/swap.h:8,
   from include/linux/suspend.h:4,
   from arch/powerpc/kernel/asm-offsets.c:24:
  arch/powerpc/include/generated/asm/vtime.h:1:31: error: 
  asm-generic/vtime.h: No such file or directory
 
 That caught me too: include/asm-generic/vtime.h is a patch-unfriendly
 0-length file in the git tree;

hm, this?


From: Andrew Morton a...@linux-foundation.org
Subject: include/asm-generic/vtime.h: avoid zero-length file

patch(1) can't handle zero-length files - it appears to simply not create
the file, so my powerpc build fails.

Put something in here to make life easier.

Cc: Hugh Dickins hu...@google.com
Signed-off-by: Andrew Morton a...@linux-foundation.org
---

 include/asm-generic/vtime.h |1 +
 1 file changed, 1 insertion(+)

diff -puN /dev/null include/asm-generic/vtime.h
--- /dev/null
+++ a/include/asm-generic/vtime.h
@@ -0,0 +1 @@
+/* no content, but patch(1) dislikes empty files */
_



 I wonder what use it's supposed to have.

Frederic, can you please confirm that include/asm-generic/vtime.h is
supposed to be empty?

 (And I'm not very keen on the growing trend for symlinks in the git tree.)

ooh, that explains why I lost my arch/microblaze/boot/dts/system.dts.
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


linux-next: build failure after merge of the akpm tree

2013-09-24 Thread Stephen Rothwell
Hi Andrew,

After merging the akpm tree, linux-next builds (powerpc allmodconfig)
fail like this:

drivers/tty/ehv_bytechan.c:362:1: error: type defaults to 'int' in declaration 
of 'console_initcall' [-Werror=implicit-int]

Caused by commit 0f01cf96c2d4 (./Makefile: enable -Werror=implicit-int
and -Werror=strict-prototypes by default) which has bee in linux-next
since Aug 16.  This commit exposed that fact that
drivers/tty/ehv_bytechan.c can be built as a module, but has a
console_initcall (which is not available to modules).  This was
originally introduced in commit dcd83aaff1c8 (tty/powerpc: introduce the
ePAPR embedded hypervisor byte channel driver) in v3.2.

Anyone got a good solution?
-- 
Cheers,
Stephen Rothwells...@canb.auug.org.au


pgpNt0jEitsIn.pgp
Description: PGP signature
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: linux-next: build failure after merge of the akpm tree

2013-09-24 Thread Timur Tabi
On Tue, Sep 24, 2013 at 8:06 PM, Stephen Rothwell s...@canb.auug.org.au wrote:
 Hi Andrew,

 After merging the akpm tree, linux-next builds (powerpc allmodconfig)
 fail like this:

 drivers/tty/ehv_bytechan.c:362:1: error: type defaults to 'int' in 
 declaration of 'console_initcall' [-Werror=implicit-int]

 Caused by commit 0f01cf96c2d4 (./Makefile: enable -Werror=implicit-int
 and -Werror=strict-prototypes by default) which has bee in linux-next
 since Aug 16.  This commit exposed that fact that
 drivers/tty/ehv_bytechan.c can be built as a module, but has a
 console_initcall (which is not available to modules).

Is this something new?  This code hasn't changed in over two years, so
I'm surprised it suddenly broke.

 This was
 originally introduced in commit dcd83aaff1c8 (tty/powerpc: introduce the
 ePAPR embedded hypervisor byte channel driver) in v3.2.

 Anyone got a good solution?

How about:

#ifndef MODULE

static int __init ehv_bc_console_init(void)
{
...
}
console_initcall(ehv_bc_console_init);
#endif
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


linux-next: build failure after merge of the akpm tree

2011-09-28 Thread Stephen Rothwell
Hi Andrew,

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

In file included from arch/powerpc/boot/stdio.c:12:0:
arch/powerpc/boot/stdio.h:10:17: error: expected declaration specifiers or 
'...' before numeric constant
arch/powerpc/boot/stdio.h:10:20: error: expected declaration specifiers or 
'...' before numeric constant
arch/powerpc/boot/stdio.h:10:8: warning: return type defaults to 'int'
arch/powerpc/boot/stdio.h:10:8: warning: function declaration isn't a prototype
arch/powerpc/boot/stdio.h: In function '__printf':
arch/powerpc/boot/stdio.h:14:17: error: expected declaration specifiers or 
'...' before numeric constant
arch/powerpc/boot/stdio.h:14:20: error: expected declaration specifiers or 
'...' before numeric constant
arch/powerpc/boot/stdio.h:14:23: error: expected '=', ',', ';', 'asm' or 
'__attribute__' before 'int'
arch/powerpc/boot/stdio.h:16:12: error: storage class specified for parameter 
'vsprintf'

And went down hill from there (it produced hundreds of errors).

Caused by commit a52af697aaeb (treewide: use __printf not __attribute__
((format(printf,....  Maybe because some of these files are part of
the boot wrappers and are built (effectively) independently of the kernel
itself.  Notice that arch/powerpc/boot/stdio.h does not include any
kernel headers ...

I have reverted that commit (and the follup ones b31d03e43e56
treewide-use-__printf-not-__attribute__formatprintf-checkpatch-fixes
and f43c361e2bd9 kernel.h/checkpatch: mark strict_strtofoo and
simple_strtofoo as obsolete) for today.
-- 
Cheers,
Stephen Rothwells...@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/


pgpq6sYKitF1K.pgp
Description: PGP signature
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: linux-next: build failure after merge of the akpm tree

2011-09-28 Thread Andrew Morton
On Wed, 28 Sep 2011 19:22:20 +1000
Stephen Rothwell s...@canb.auug.org.au wrote:

 After merging the akpm tree, today's linux-next build (powerpc
 ppc64_defconfig) failed like this:
 
 In file included from arch/powerpc/boot/stdio.c:12:0:
 arch/powerpc/boot/stdio.h:10:17: error: expected declaration specifiers or 
 '...' before numeric constant
 arch/powerpc/boot/stdio.h:10:20: error: expected declaration specifiers or 
 '...' before numeric constant
 arch/powerpc/boot/stdio.h:10:8: warning: return type defaults to 'int'
 arch/powerpc/boot/stdio.h:10:8: warning: function declaration isn't a 
 prototype
 arch/powerpc/boot/stdio.h: In function '__printf':
 arch/powerpc/boot/stdio.h:14:17: error: expected declaration specifiers or 
 '...' before numeric constant
 arch/powerpc/boot/stdio.h:14:20: error: expected declaration specifiers or 
 '...' before numeric constant
 arch/powerpc/boot/stdio.h:14:23: error: expected '=', ',', ';', 'asm' or 
 '__attribute__' before 'int'
 arch/powerpc/boot/stdio.h:16:12: error: storage class specified for parameter 
 'vsprintf'
 
 And went down hill from there (it produced hundreds of errors).

I could only find two non-kernel files which were modified by that
patch so afaict we just need to revert those two bits.  I'll test the
below..



From: Andrew Morton a...@google.com
Subject: treewide-use-__printf-not-__attribute__formatprintf-fix

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

In file included from arch/powerpc/boot/stdio.c:12:0:
arch/powerpc/boot/stdio.h:10:17: error: expected declaration specifiers or 
'...' before numeric constant
arch/powerpc/boot/stdio.h:10:20: error: expected declaration specifiers or 
'...' before numeric constant
arch/powerpc/boot/stdio.h:10:8: warning: return type defaults to 'int'
arch/powerpc/boot/stdio.h:10:8: warning: function declaration isn't a prototype
arch/powerpc/boot/stdio.h: In function '__printf':
arch/powerpc/boot/stdio.h:14:17: error: expected declaration specifiers or 
'...' before numeric constant
arch/powerpc/boot/stdio.h:14:20: error: expected declaration specifiers or 
'...' before numeric constant
arch/powerpc/boot/stdio.h:14:23: error: expected '=', ',', ';', 'asm' or 
'__attribute__' before 'int'
arch/powerpc/boot/stdio.h:16:12: error: storage class specified for parameter 
'vsprintf'
Reported-by: Stephen Rothwell s...@canb.auug.org.au
Cc: Joe Perches j...@perches.com
Signed-off-by: Andrew Morton a...@google.com
---

 arch/powerpc/boot/ps3.c   |3 ++-
 arch/powerpc/boot/stdio.h |5 +++--
 2 files changed, 5 insertions(+), 3 deletions(-)

diff -puN 
arch/alpha/boot/misc.c~treewide-use-__printf-not-__attribute__formatprintf-fix 
arch/alpha/boot/misc.c
diff -puN 
arch/alpha/include/asm/console.h~treewide-use-__printf-not-__attribute__formatprintf-fix
 arch/alpha/include/asm/console.h
diff -puN 
arch/frv/include/asm/system.h~treewide-use-__printf-not-__attribute__formatprintf-fix
 arch/frv/include/asm/system.h
diff -puN 
arch/ia64/include/asm/mca.h~treewide-use-__printf-not-__attribute__formatprintf-fix
 arch/ia64/include/asm/mca.h
diff -puN 
arch/m68k/include/asm/natfeat.h~treewide-use-__printf-not-__attribute__formatprintf-fix
 arch/m68k/include/asm/natfeat.h
diff -puN 
arch/mn10300/include/asm/gdb-stub.h~treewide-use-__printf-not-__attribute__formatprintf-fix
 arch/mn10300/include/asm/gdb-stub.h
diff -puN 
arch/powerpc/boot/ps3.c~treewide-use-__printf-not-__attribute__formatprintf-fix 
arch/powerpc/boot/ps3.c
--- 
a/arch/powerpc/boot/ps3.c~treewide-use-__printf-not-__attribute__formatprintf-fix
+++ a/arch/powerpc/boot/ps3.c
@@ -36,7 +36,8 @@ extern int lv1_get_repository_node_value
 #ifdef DEBUG
 #define DBG(fmt...) printf(fmt)
 #else
-static inline __printf(1, 2) int DBG(const char *fmt, ...) {return 0;}
+static inline int __attribute__ ((format (printf, 1, 2))) DBG(
+   const char *fmt, ...) {return 0;}
 #endif
 
 BSS_STACK(4096);
diff -puN 
arch/powerpc/boot/stdio.h~treewide-use-__printf-not-__attribute__formatprintf-fix
 arch/powerpc/boot/stdio.h
--- 
a/arch/powerpc/boot/stdio.h~treewide-use-__printf-not-__attribute__formatprintf-fix
+++ a/arch/powerpc/boot/stdio.h
@@ -7,11 +7,12 @@
 #defineEINVAL  22  /* Invalid argument */
 #define ENOSPC 28  /* No space left on device */
 
-extern __printf(1, 2) int printf(const char *fmt, ...);
+extern int printf(const char *fmt, ...) __attribute__((format(printf, 1, 2)));
 
 #define fprintf(fmt, args...)  printf(args)
 
-extern __printf(2, 3) int sprintf(char *buf, const char *fmt, ...);
+extern int sprintf(char *buf, const char *fmt, ...)
+   __attribute__((format(printf, 2, 3)));
 
 extern int vsprintf(char *buf, const char *fmt, va_list args);
 
diff -puN 
arch/powerpc/include/asm/udbg.h~treewide-use-__printf-not-__attribute__formatprintf-fix
 arch/powerpc/include/asm/udbg.h
diff -puN 
arch/s390/include/asm/debug.h~treewide-use-__printf-not-__attribute__formatprintf-fix