All of lore.kernel.org
 help / color / mirror / Atom feed
* [mmotm:master 342/391] arch/powerpc/kernel/setup_32.c:176:21: error: redefinition of 'alloc_stack'
@ 2019-02-26  4:24 kbuild test robot
  2019-02-26  6:40 ` Mike Rapoport
  0 siblings, 1 reply; 2+ messages in thread
From: kbuild test robot @ 2019-02-26  4:24 UTC (permalink / raw)
  To: Christophe Leroy
  Cc: kbuild-all, Johannes Weiner, Mike Rapoport, Andrew Morton,
	Linux Memory Management List

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

tree:   git://git.cmpxchg.org/linux-mmotm.git master
head:   896e6c5ee0c0ead9790f7ac202a672132bacbf66
commit: 7b6550d180d48e250049759362b5cc2cf02544c9 [342/391] powerpc: use memblock functions returning virtual address
config: powerpc-allnoconfig (attached as .config)
compiler: powerpc-linux-gnu-gcc (Debian 8.2.0-11) 8.2.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        git checkout 7b6550d180d48e250049759362b5cc2cf02544c9
        # save the attached .config to linux build tree
        GCC_VERSION=8.2.0 make.cross ARCH=powerpc 

All errors (new ones prefixed by >>):

>> arch/powerpc/kernel/setup_32.c:176:21: error: redefinition of 'alloc_stack'
    static void *__init alloc_stack(void)
                        ^~~~~~~~~~~
   arch/powerpc/kernel/setup_32.c:165:21: note: previous definition of 'alloc_stack' was here
    static void *__init alloc_stack(void)
                        ^~~~~~~~~~~
>> arch/powerpc/kernel/setup_32.c:165:21: error: 'alloc_stack' defined but not used [-Werror=unused-function]
   cc1: all warnings being treated as errors

vim +/alloc_stack +176 arch/powerpc/kernel/setup_32.c

   164	
 > 165	static void *__init alloc_stack(void)
   166	{
   167		void *ptr = memblock_alloc(THREAD_SIZE, THREAD_SIZE);
   168	
   169		if (!ptr)
   170			panic("cannot allocate %d bytes for stack at %pS\n",
   171			      THREAD_SIZE, (void *)_RET_IP_);
   172	
   173		return ptr;
   174	}
   175	
 > 176	static void *__init alloc_stack(void)
   177	{
   178		void *ptr = memblock_alloc(THREAD_SIZE, THREAD_SIZE);
   179	
   180		if (!ptr)
   181			panic("cannot allocate %d bytes for stack at %pS\n",
   182			      THREAD_SIZE, (void *)_RET_IP_);
   183	
   184		return ptr;
   185	}
   186	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 5684 bytes --]

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

* Re: [mmotm:master 342/391] arch/powerpc/kernel/setup_32.c:176:21: error: redefinition of 'alloc_stack'
  2019-02-26  4:24 [mmotm:master 342/391] arch/powerpc/kernel/setup_32.c:176:21: error: redefinition of 'alloc_stack' kbuild test robot
@ 2019-02-26  6:40 ` Mike Rapoport
  0 siblings, 0 replies; 2+ messages in thread
From: Mike Rapoport @ 2019-02-26  6:40 UTC (permalink / raw)
  To: Andrew Morton
  Cc: kbuild test robot, Christophe Leroy, kbuild-all, Johannes Weiner,
	Andrew Morton, Linux Memory Management List

On Tue, Feb 26, 2019 at 12:24:17PM +0800, kbuild test robot wrote:
> tree:   git://git.cmpxchg.org/linux-mmotm.git master
> head:   896e6c5ee0c0ead9790f7ac202a672132bacbf66
> commit: 7b6550d180d48e250049759362b5cc2cf02544c9 [342/391] powerpc: use memblock functions returning virtual address
> config: powerpc-allnoconfig (attached as .config)
> compiler: powerpc-linux-gnu-gcc (Debian 8.2.0-11) 8.2.0
> reproduce:
>         wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
>         chmod +x ~/bin/make.cross
>         git checkout 7b6550d180d48e250049759362b5cc2cf02544c9
>         # save the attached .config to linux build tree
>         GCC_VERSION=8.2.0 make.cross ARCH=powerpc 
> 
> All errors (new ones prefixed by >>):
> 
> >> arch/powerpc/kernel/setup_32.c:176:21: error: redefinition of 'alloc_stack'
>     static void *__init alloc_stack(void)
>                         ^~~~~~~~~~~
>    arch/powerpc/kernel/setup_32.c:165:21: note: previous definition of 'alloc_stack' was here
>     static void *__init alloc_stack(void)
>                         ^~~~~~~~~~~
> >> arch/powerpc/kernel/setup_32.c:165:21: error: 'alloc_stack' defined but not used [-Werror=unused-function]
>    cc1: all warnings being treated as errors
> 
> vim +/alloc_stack +176 arch/powerpc/kernel/setup_32.c
> 
>    164	
>  > 165	static void *__init alloc_stack(void)
>    166	{
>    167		void *ptr = memblock_alloc(THREAD_SIZE, THREAD_SIZE);
>    168	
>    169		if (!ptr)
>    170			panic("cannot allocate %d bytes for stack at %pS\n",
>    171			      THREAD_SIZE, (void *)_RET_IP_);
>    172	
>    173		return ptr;
>    174	}
>    175	
>  > 176	static void *__init alloc_stack(void)
>    177	{
>    178		void *ptr = memblock_alloc(THREAD_SIZE, THREAD_SIZE);
>    179	
>    180		if (!ptr)
>    181			panic("cannot allocate %d bytes for stack at %pS\n",
>    182			      THREAD_SIZE, (void *)_RET_IP_);
>    183	
>    184		return ptr;
>    185	}
>    186	

The fix is below: 

From e2228b90baf0b443650c2f391a4acb3beb688bea Mon Sep 17 00:00:00 2001
From: Mike Rapoport <rppt@linux.ibm.com>
Date: Tue, 26 Feb 2019 08:36:20 +0200
Subject: [PATCH] powerpc: remove duplicated alloc_stack() function

The patch "powerpc: use memblock functions returning virtual address" was
applied in both powerpc and mmotm trees and as a result function
alloc_stack() sneaked twice into arch/powerpc/kernel/setup_32.c

Remove one of the copies.

Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
---
 arch/powerpc/kernel/setup_32.c | 11 -----------
 1 file changed, 11 deletions(-)

diff --git a/arch/powerpc/kernel/setup_32.c b/arch/powerpc/kernel/setup_32.c
index 40e9d99..4a65e08 100644
--- a/arch/powerpc/kernel/setup_32.c
+++ b/arch/powerpc/kernel/setup_32.c
@@ -173,17 +173,6 @@ static void *__init alloc_stack(void)
 	return ptr;
 }
 
-static void *__init alloc_stack(void)
-{
-	void *ptr = memblock_alloc(THREAD_SIZE, THREAD_SIZE);
-
-	if (!ptr)
-		panic("cannot allocate %d bytes for stack at %pS\n",
-		      THREAD_SIZE, (void *)_RET_IP_);
-
-	return ptr;
-}
-
 void __init irqstack_early_init(void)
 {
 	unsigned int i;
-- 
2.7.4


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

end of thread, other threads:[~2019-02-26  6:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-26  4:24 [mmotm:master 342/391] arch/powerpc/kernel/setup_32.c:176:21: error: redefinition of 'alloc_stack' kbuild test robot
2019-02-26  6:40 ` Mike Rapoport

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.