Skip to contentSkip to conversation

powerpc/ppc32: make W=1 compilation errors free

PATCH Applied Mathieu Malaterre 4 participants 98 messages Mar 22, 2018 – Aug 13, 2018

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover powerpc/ppc32: make W=1 compilation errors free

Here is another batch for warnings treated as error on ppc32. Tested with:

$ make ARCH=powerpc ppc32_defconfig
$ make -j8 ARCH=powerpc CROSS_COMPILE=powerpc-linux-gnu- W=1

Using:

$ powerpc-linux-gnu-gcc --version
powerpc-linux-gnu-gcc (Debian 6.3.0-18) 6.3.0 20170516

Mathieu Malaterre (19):
powerpc/powermac: Mark variable x as unused powerpc/powermac: Mark variable x as unused
powerpc: Mark variables as unused
powerpc/kvm: Mark variable tmp unused powerpc/chrp/setup: Add attribute unused and make some functions
static
powerpc: Make function btext_initialize static powerpc/powermac: Make some functions static powerpc/tau: Make some function static powerpc/chrp/pci: Make some functions static powerpc/chrp/time: Make some functions static, add missing header
include
powerpc/powermac: Move pmac_pfunc_base_install prototype to header
file
powerpc/powermac: Add missing prototype for note_bootable_part() powerpc/52xx: Add missing functions prototypes powerpc/altivec: Add missing prototypes for altivec
powerpc: Add missing prototype
powerpc/powermac: Add missing include of header pmac.h powerpc/32: Add a missing include header
powerpc: Add a missing include header
powerpc/tau: Synchronize function prototypes and body

 arch/powerpc/include/asm/mpc52xx.h           |  6 +++---
 arch/powerpc/include/asm/pmac_pfunc.h        |  1 +
 arch/powerpc/include/asm/rheap.h             |  3 +++
 arch/powerpc/kernel/btext.c                  |  2 +-
 arch/powerpc/kernel/irq.c                    |  2 +-
 arch/powerpc/kernel/kvm.c                    |  2 +-
 arch/powerpc/kernel/pci_32.c                 |  1 +
 arch/powerpc/kernel/prom_init.c              |  4 ++--
 arch/powerpc/kernel/setup-common.c           |  6 ------
 arch/powerpc/kernel/setup.h                  |  6 ++++++
 arch/powerpc/kernel/tau_6xx.c                | 15 +++++++++------
 arch/powerpc/kernel/vecemu.c                 |  1 +
 arch/powerpc/lib/xor_vmx.h                   | 14 ++++++++++++++
 arch/powerpc/platforms/chrp/pci.c            |  8 ++++----
 arch/powerpc/platforms/chrp/setup.c          | 10 +++++-----
 arch/powerpc/platforms/chrp/time.c           |  6 ++++--
 arch/powerpc/platforms/powermac/bootx_init.c |  2 +-
 arch/powerpc/platforms/powermac/pci.c        | 10 +++++-----
 arch/powerpc/platforms/powermac/setup.c      |  1 +
 arch/powerpc/platforms/powermac/smp.c        |  1 -
 arch/powerpc/platforms/powermac/time.c       |  4 +++-
 arch/powerpc/platforms/powermac/udbg_scc.c   |  2 +-
 22 files changed, 67 insertions(+), 40 deletions(-)
Signature · 1 line
2.11.0
#1 lore raw

PATCH 1/19 powerpc/powermac: Mark variable x as unused

Since the value of x is never intended to be read, declare it with gcc attribute as unused. Fix warning treated as error with W=1:

arch/powerpc/platforms/powermac/bootx_init.c:471:21: error: variable ‘x’ set but not used [-Werror=unused-but-set-variable]

---
 arch/powerpc/platforms/powermac/bootx_init.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/platforms/powermac/bootx_init.c +1 -1
index c3c9bbb3573a..d3ce55dae78f 100644
@@ -468,7 +468,7 @@ void __init bootx_init(unsigned long r3, unsigned long r4)
 	boot_infos_t *bi = (boot_infos_t *) r4;
 	unsigned long hdr;
 	unsigned long space;
-	unsigned long ptr, x;
+	unsigned long ptr, x __maybe_unused;
 	char *model;
 	unsigned long offset = reloc_offset();
 
Signature · 1 line
2.11.0
#2 lore raw

Re: [PATCH 01/19] powerpc/powermac: Mark variable x as unused

Le 22/03/2018 à 21:19, Mathieu Malaterre a écrit :

Quoted 15 lines

Since the value of x is never intended to be read, declare it with gcc attribute as unused. Fix warning treated as error with W=1:

arch/powerpc/platforms/powermac/bootx_init.c:471:21: error: variable ‘x’ set but not used [-Werror=unused-but-set-variable]

---
  arch/powerpc/platforms/powermac/bootx_init.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/platforms/powermac/bootx_init.c +0 -0
index c3c9bbb3573a..d3ce55dae78f 100644

arch/powerpc/platforms/powermac/bootx_init.c void __init bootx_init(unsigned long r3, unsigned long r4) · line 471

Quoted 5 lines
arch/powerpc/platforms/powermac/bootx_init.c +1 -1
@@ -468,7 +468,7 @@ void __init bootx_init(unsigned long r3, unsigned long r4)
  	boot_infos_t *bi = (boot_infos_t *) r4;
  	unsigned long hdr;
  	unsigned long space;
-	unsigned long ptr, x;
+	unsigned long ptr, x __maybe_unused;

Why not use fault_in_pages_readable() instead of the hardcoded part that uses x ?

If you decide to keep it as is, at least x should be declared inside the if (bi->version < 4)

Christophe

arch/powerpc/platforms/powermac/bootx_init.c void __init bootx_init(unsigned long r3, unsigned long r4) · line 474

Quoted 4 lines
arch/powerpc/platforms/powermac/bootx_init.c +0 -0
  	char *model;
  	unsigned long offset = reloc_offset();
 

---
L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast.
https://www.avast.com/antivirus

#3 lore raw

PATCH v2 1/19 powerpc/powermac: Mark variable x as unused

In reply to Mathieu Malaterre

Since the value of x is never intended to be read, declare it with gcc attribute as unused. Fix warning treated as error with W=1:

arch/powerpc/platforms/powermac/bootx_init.c:471:21: error: variable ‘x’ set but not used [-Werror=unused-but-set-variable]

---
v2: move x variable within its local scope

 arch/powerpc/platforms/powermac/bootx_init.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/powerpc/platforms/powermac/bootx_init.c +2 -1
index c3c9bbb3573a..d44e8571c1ec 100644
@@ -468,7 +468,7 @@ void __init bootx_init(unsigned long r3, unsigned long r4)
 	boot_infos_t *bi = (boot_infos_t *) r4;
 	unsigned long hdr;
 	unsigned long space;
-	unsigned long ptr, x;
+	unsigned long ptr;
 	char *model;
 	unsigned long offset = reloc_offset();
 
@@ -562,6 +562,7 @@ void __init bootx_init(unsigned long r3, unsigned long r4)
 	 * MMU switched OFF, so this should not be useful anymore.
 	 */
 	if (bi->version < 4) {
+		unsigned long x __maybe_unused;
 		bootx_printf("Touching pages...\n");
 
 		/*
Signature · 1 line
2.11.0
#4 lore raw

Re: [PATCH v2 01/19] powerpc/powermac: Mark variable x as unused

Mathieu Malaterre <[email protected]> a écrit :

Quoted 28 lines

Since the value of x is never intended to be read, declare it with gcc attribute as unused. Fix warning treated as error with W=1:

arch/powerpc/platforms/powermac/bootx_init.c:471:21: error:
variable ‘x’ set but not used [-Werror=unused-but-set-variable]

---
v2: move x variable within its local scope

 arch/powerpc/platforms/powermac/bootx_init.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/powerpc/platforms/powermac/bootx_init.c +1 -1
index c3c9bbb3573a..d44e8571c1ec 100644
@@ -468,7 +468,7 @@ void __init bootx_init(unsigned long r3,  
 unsigned long r4)
 	boot_infos_t *bi = (boot_infos_t *) r4;
 	unsigned long hdr;
 	unsigned long space;
-	unsigned long ptr, x;
+	unsigned long ptr;
 	char *model;
 	unsigned long offset = reloc_offset();

arch/powerpc/platforms/powermac/bootx_init.c void __init bootx_init(unsigned long r3, · line 567

Quoted 6 lines
arch/powerpc/platforms/powermac/bootx_init.c +1 -0
@@ -562,6 +562,7 @@ void __init bootx_init(unsigned long r3,  
 unsigned long r4)
 	 * MMU switched OFF, so this should not be useful anymore.
 	 */
 	if (bi->version < 4) {
+		unsigned long x __maybe_unused;
 		bootx_printf("Touching pages...\n");

Stylewise, there should be an empty line after your declaration.

But I believe you should remove that ugly loop and replace it by a call to fault_in_pages_readable()

Christophe

Quoted 4 lines
arch/powerpc/platforms/powermac/bootx_init.c +0 -1
 		/*
--

2.11.0

#5 lore raw

Re: [PATCH v2 01/19] powerpc/powermac: Mark variable x as unused

Quoted 7 lines · LEROY Christophe

Mathieu Malaterre <[email protected]> a =C3=A9crit :

Quoted 4 lines

Since the value of x is never intended to be read, declare it with gcc attribute as unused. Fix warning treated as error with W=3D1:

arch/powerpc/platforms/powermac/bootx_init.c:471:21: error: variable =

=E2=80=98x=E2=80=99

Quoted 9 lines
Quoted 9 lines

set but not used [-Werror=3Dunused-but-set-variable]

---
v2: move x variable within its local scope

 arch/powerpc/platforms/powermac/bootx_init.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Quoted 6 lines

arch/powerpc/platforms/powermac/bootx_init.c void __init bootx_init(unsigned long r3, unsigned lo=

Quoted 6 lines
arch/powerpc/platforms/powermac/bootx_init.c +0 -0
index c3c9bbb3573a..d44e8571c1ec 100644
@@ -468,7 +468,7 @@ void __init bootx_init(unsigned long r3, unsigned lo=

ng

Quoted 10 lines

arch/powerpc/platforms/powermac/bootx_init.c void __init bootx_init(unsigned long r3, unsigned lo=

Quoted 10 lines
arch/powerpc/platforms/powermac/bootx_init.c +1 -1
 r4)
        boot_infos_t *bi =3D (boot_infos_t *) r4;
        unsigned long hdr;
        unsigned long space;
-       unsigned long ptr, x;
+       unsigned long ptr;
        char *model;
        unsigned long offset =3D reloc_offset();
@@ -562,6 +562,7 @@ void __init bootx_init(unsigned long r3, unsigned lo=

ng

Quoted 9 lines

arch/powerpc/platforms/powermac/bootx_init.c void __init bootx_init(unsigned long r3, unsigned long r4) · line 566

Quoted 6 lines
arch/powerpc/platforms/powermac/bootx_init.c +1 -0
 r4)
         * MMU switched OFF, so this should not be useful anymore.
         */
        if (bi->version < 4) {
+               unsigned long x __maybe_unused;
                bootx_printf("Touching pages...\n");

Stylewise, there should be an empty line after your declaration.

See v3

Quoted 1 line

But I believe you should remove that ugly loop and replace it by a call t=

o

Quoted 1 line

fault_in_pages_readable()

I have no idea on how to test the the new code, and it did not look straightforward.

Quoted 9 lines

Christophe

Quoted 5 lines
arch/powerpc/platforms/powermac/bootx_init.c +0 -1
                /*
--

2.11.0

#6 lore raw

PATCH v3 1/19 powerpc/powermac: Mark variable x as unused

In reply to Mathieu Malaterre

Since the value of x is never intended to be read, declare it with gcc attribute as unused. Fix warning treated as error with W=1:

arch/powerpc/platforms/powermac/bootx_init.c:471:21: error: variable ‘x’ set but not used [-Werror=unused-but-set-variable]

---
v3: style: add missing empty line after declaration
v2: move x variable within its local scope

 arch/powerpc/platforms/powermac/bootx_init.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
arch/powerpc/platforms/powermac/bootx_init.c +3 -1
index c3c9bbb3573a..ba0964c17620 100644
@@ -468,7 +468,7 @@ void __init bootx_init(unsigned long r3, unsigned long r4)
 	boot_infos_t *bi = (boot_infos_t *) r4;
 	unsigned long hdr;
 	unsigned long space;
-	unsigned long ptr, x;
+	unsigned long ptr;
 	char *model;
 	unsigned long offset = reloc_offset();
 
@@ -562,6 +562,8 @@ void __init bootx_init(unsigned long r3, unsigned long r4)
 	 * MMU switched OFF, so this should not be useful anymore.
 	 */
 	if (bi->version < 4) {
+		unsigned long x __maybe_unused;
+
 		bootx_printf("Touching pages...\n");
 
 		/*
Signature · 1 line
2.11.0
#7 lore raw

Re: [PATCH v3 01/19] powerpc/powermac: Mark variable x as unused

Le 04/04/2018 à 22:07, Mathieu Malaterre a écrit :

Quoted 28 lines

Since the value of x is never intended to be read, declare it with gcc attribute as unused. Fix warning treated as error with W=1:

arch/powerpc/platforms/powermac/bootx_init.c:471:21: error: variable ‘x’ set but not used [-Werror=unused-but-set-variable]

---
v3: style: add missing empty line after declaration
v2: move x variable within its local scope

  arch/powerpc/platforms/powermac/bootx_init.c | 4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)
arch/powerpc/platforms/powermac/bootx_init.c +1 -1
index c3c9bbb3573a..ba0964c17620 100644
@@ -468,7 +468,7 @@ void __init bootx_init(unsigned long r3, unsigned long r4)
  	boot_infos_t *bi = (boot_infos_t *) r4;
  	unsigned long hdr;
  	unsigned long space;
-	unsigned long ptr, x;
+	unsigned long ptr;
  	char *model;
  	unsigned long offset = reloc_offset();
 

arch/powerpc/platforms/powermac/bootx_init.c void __init bootx_init(unsigned long r3, unsigned long r4) · line 566

Quoted 5 lines
arch/powerpc/platforms/powermac/bootx_init.c +2 -0
@@ -562,6 +562,8 @@ void __init bootx_init(unsigned long r3, unsigned long r4)
  	 * MMU switched OFF, so this should not be useful anymore.
  	 */
  	if (bi->version < 4) {
+		unsigned long x __maybe_unused;
+

That's detail, but shouldn't it be marked __always_unused instead ?

Christophe

Quoted 4 lines
arch/powerpc/platforms/powermac/bootx_init.c +0 -0
  		bootx_printf("Touching pages...\n");
 
  		/*
#8 lore raw

Re: [v3,01/19] powerpc/powermac: Mark variable x as unused

In reply to Mathieu Malaterre
Quoted 7 lines · Mathieu Malaterre

Since the value of x is never intended to be read, declare it with gcc attribute as unused. Fix warning treated as error with W=1:

arch/powerpc/platforms/powermac/bootx_init.c:471:21: error: variable ‘x’ set but not used [-Werror=unused-but-set-variable]

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/5a4b475cf8511da721f20ba432c244

cheers

#9 lore raw

PATCH 2/19 powerpc/powermac: Mark variable x as unused

In reply to Mathieu Malaterre

Since the value of x is never intended to be read, declare it with gcc attribute as unused. Fix warning treated as error with W=1:

arch/powerpc/platforms/powermac/udbg_scc.c:76:9: error: variable ‘x’ set but not used [-Werror=unused-but-set-variable]

---
 arch/powerpc/platforms/powermac/udbg_scc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/platforms/powermac/udbg_scc.c +1 -1
index d83135a9830e..c38ca406df1a 100644
@@ -73,7 +73,7 @@ void udbg_scc_init(int force_scc)
 	struct device_node *stdout = NULL, *escc = NULL, *macio = NULL;
 	struct device_node *ch, *ch_def = NULL, *ch_a = NULL;
 	const char *path;
-	int i, x;
+	int i, x __maybe_unused;
 
 	escc = of_find_node_by_name(NULL, "escc");
 	if (escc = NULL)
Signature · 1 line
2.11.0
#10 lore raw

Re: [PATCH 02/19] powerpc/powermac: Mark variable x as unused

Le 22/03/2018 à 21:19, Mathieu Malaterre a écrit :

Quoted 15 lines

Since the value of x is never intended to be read, declare it with gcc attribute as unused. Fix warning treated as error with W=1:

arch/powerpc/platforms/powermac/udbg_scc.c:76:9: error: variable ‘x’ set but not used [-Werror=unused-but-set-variable]

---
  arch/powerpc/platforms/powermac/udbg_scc.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/platforms/powermac/udbg_scc.c +0 -0
index d83135a9830e..c38ca406df1a 100644

arch/powerpc/platforms/powermac/udbg_scc.c void udbg_scc_init(int force_scc) · line 76

Quoted 5 lines
arch/powerpc/platforms/powermac/udbg_scc.c +1 -1
@@ -73,7 +73,7 @@ void udbg_scc_init(int force_scc)
  	struct device_node *stdout = NULL, *escc = NULL, *macio = NULL;
  	struct device_node *ch, *ch_def = NULL, *ch_a = NULL;
  	const char *path;
-	int i, x;
+	int i, x __maybe_unused;

You could just replace 'x = in_8(sccc)' by 'in_8(sccc)' and get rid of the x.

Christophe

arch/powerpc/platforms/powermac/udbg_scc.c void udbg_scc_init(int force_scc)

Quoted 4 lines
arch/powerpc/platforms/powermac/udbg_scc.c +0 -0
  	escc = of_find_node_by_name(NULL, "escc");
  	if (escc = NULL)
 

---
L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast.
https://www.avast.com/antivirus

#11 lore raw

PATCH v2 2/19 powerpc/powermac: Mark variable x as unused

In reply to Mathieu Malaterre

Since the value of x is never intended to be read, remove it. Fix warning treated as error with W=1:

arch/powerpc/platforms/powermac/udbg_scc.c:76:9: error: variable ‘x’ set but not used [-Werror=unused-but-set-variable]

---
v2: remove x completely

 arch/powerpc/platforms/powermac/udbg_scc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/powerpc/platforms/powermac/udbg_scc.c +2 -2
index d83135a9830e..8901973ed683 100644
@@ -73,7 +73,7 @@ void udbg_scc_init(int force_scc)
 	struct device_node *stdout = NULL, *escc = NULL, *macio = NULL;
 	struct device_node *ch, *ch_def = NULL, *ch_a = NULL;
 	const char *path;
-	int i, x;
+	int i;
 
 	escc = of_find_node_by_name(NULL, "escc");
 	if (escc == NULL)
@@ -120,7 +120,7 @@ void udbg_scc_init(int force_scc)
 	mb();
 
 	for (i = 20000; i != 0; --i)
-		x = in_8(sccc);
+		in_8(sccc);
 	out_8(sccc, 0x09);		/* reset A or B side */
 	out_8(sccc, 0xc0);
 
Signature · 1 line
2.11.0
Reviewed-by on v2 2/19
#12 lore raw

Re: [PATCH v2 02/19] powerpc/powermac: Mark variable x as unused

Mathieu Malaterre <[email protected]> a =C3=A9crit=C2=A0:

Quoted 5 lines

Since the value of x is never intended to be read, remove it. Fix warning treated as error with W=3D1:

arch/powerpc/platforms/powermac/udbg_scc.c:76:9: error: variable=20=20
=20=E2=80=98x=E2=80=99 set but not used [-Werror=3Dunused-but-set-variable=

]

Quoted 3 lines
Quoted 31 lines

---
v2: remove x completely

 arch/powerpc/platforms/powermac/udbg_scc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
(quoted diff) +0 -0

=20b/arch/powerpc/platforms/powermac/udbg_scc.c
index d83135a9830e..8901973ed683 100644

arch/powerpc/platforms/powermac/udbg_scc.c +2 -3
@@ -73,7 +73,7 @@ void udbg_scc_init(int force_scc)
 	struct device_node *stdout =3D NULL, *escc =3D NULL, *macio =3D NULL;
 	struct device_node *ch, *ch_def =3D NULL, *ch_a =3D NULL;
 	const char *path;
-	int i, x;
+	int i;
 
 	escc =3D of_find_node_by_name(NULL, "escc");
 	if (escc =3D=3D NULL)
@@ -120,7 +120,7 @@ void udbg_scc_init(int force_scc)
 	mb();
 
 	for (i =3D 20000; i !=3D 0; --i)
-		x =3D in_8(sccc);
+		in_8(sccc);
 	out_8(sccc, 0x09);		/* reset A or B side */
 	out_8(sccc, 0xc0);
 
--

2.11.0

#13 lore raw

Re: [PATCH v2 02/19] powerpc/powermac: Mark variable x as unused

Quoted 4 lines · LEROY Christophe

Mathieu Malaterre <[email protected]> a =C3=A9crit :

Quoted 1 line

Since the value of x is never intended to be read, remove it. Fix warni=

ng

Quoted 4 lines
Quoted 4 lines

treated as error with W=3D1:

arch/powerpc/platforms/powermac/udbg_scc.c:76:9: error: variable
=E2=80=98x=E2=80=99 set but not used [-Werror=3Dunused-but-set-variable=

]

Quoted 5 lines
Quoted 3 lines

Michael, can you take this one ?

Quoted 6 lines
Quoted 6 lines

---
v2: remove x completely

 arch/powerpc/platforms/powermac/udbg_scc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Quoted 7 lines

arch/powerpc/platforms/powermac/udbg_scc.c void udbg_scc_init(int force_scc) · line 73

Quoted 7 lines
arch/powerpc/platforms/powermac/udbg_scc.c +0 -0
index d83135a9830e..8901973ed683 100644
@@ -73,7 +73,7 @@ void udbg_scc_init(int force_scc)
      struct device_node *stdout =3D NULL, *escc =3D NULL, *macio =3D N=

ULL;

Quoted 20 lines
Quoted 18 lines
arch/powerpc/platforms/powermac/udbg_scc.c +2 -3
      struct device_node *ch, *ch_def =3D NULL, *ch_a =3D NULL;
      const char *path;
-     int i, x;
+     int i;
 
      escc =3D of_find_node_by_name(NULL, "escc");
      if (escc =3D=3D NULL)
@@ -120,7 +120,7 @@ void udbg_scc_init(int force_scc)
      mb();
 
      for (i =3D 20000; i !=3D 0; --i)
-             x =3D in_8(sccc);
+             in_8(sccc);
      out_8(sccc, 0x09);              /* reset A or B side */
      out_8(sccc, 0xc0);
 
--

2.11.0

#14 lore raw

Re: [v2,02/19] powerpc/powermac: Mark variable x as unused

In reply to Mathieu Malaterre
Quoted 8 lines · Mathieu Malaterre

Since the value of x is never intended to be read, remove it. Fix warning treated as error with W=1:

arch/powerpc/platforms/powermac/udbg_scc.c:76:9: error: variable ‘x’ set but not used [-Werror=unused-but-set-variable]

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/8921305c1ec9d9ea23e5f8eac30630

cheers

#15 lore raw

PATCH 3/19 powerpc: Mark variables as unused

In reply to Mathieu Malaterre

Add gcc attribute unused for two variables. Fix warnings treated as errors with W=1:

arch/powerpc/kernel/prom_init.c:1388:8: error: variable ‘path’ set but not used [-Werror=unused-but-set-variable]

---
 arch/powerpc/kernel/prom_init.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/powerpc/kernel/prom_init.c +2 -2
index acf4b2e0530c..6a3ac4522144 100644
@@ -603,7 +603,7 @@ static void __init early_cmdline_parse(void)
 	const char *opt;
 
 	char *p;
-	int l = 0;
+	int l __maybe_unused = 0;
 
 	prom_cmd_line[0] = 0;
 	p = prom_cmd_line;
@@ -1385,7 +1385,7 @@ static void __init reserve_mem(u64 base, u64 size)
 static void __init prom_init_mem(void)
 {
 	phandle node;
-	char *path, type[64];
+	char *path __maybe_unused, type[64];
 	unsigned int plen;
 	cell_t *p, *endp;
 	__be32 val;
Signature · 1 line
2.11.0
#16 lore raw

Re: [PATCH 03/19] powerpc: Mark variables as unused

Le 22/03/2018 à 21:19, Mathieu Malaterre a écrit :

Quoted 24 lines

Add gcc attribute unused for two variables. Fix warnings treated as errors with W=1:

arch/powerpc/kernel/prom_init.c:1388:8: error: variable ‘path’ set but not used [-Werror=unused-but-set-variable]

---
  arch/powerpc/kernel/prom_init.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
arch/powerpc/kernel/prom_init.c +1 -1
index acf4b2e0530c..6a3ac4522144 100644
@@ -603,7 +603,7 @@ static void __init early_cmdline_parse(void)
  	const char *opt;
 
  	char *p;
-	int l = 0;
+	int l __maybe_unused = 0;
 
  	prom_cmd_line[0] = 0;
  	p = prom_cmd_line;

arch/powerpc/kernel/prom_init.c static void __init reserve_mem(u64 base, u64 size) · line 1388

Quoted 5 lines
arch/powerpc/kernel/prom_init.c +1 -1
@@ -1385,7 +1385,7 @@ static void __init reserve_mem(u64 base, u64 size)
  static void __init prom_init_mem(void)
  {
  	phandle node;
-	char *path, type[64];
+	char *path __maybe_unused, type[64];

path is only used if DEBUG_PROM is defined, so it should be enclosed into #ifdef DEBUG_PROM

Christophe

arch/powerpc/kernel/prom_init.c static void __init reserve_mem(u64 base, u64 size) · line 1391

Quoted 4 lines
arch/powerpc/kernel/prom_init.c +0 -0
  	unsigned int plen;
  	cell_t *p, *endp;
  	__be32 val;

---
L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast.
https://www.avast.com/antivirus

#17 lore raw

PATCH v2 3/19 powerpc: Mark variables as unused

In reply to Mathieu Malaterre

Add gcc attribute unused for two variables. Fix warnings treated as errors with W=1:

arch/powerpc/kernel/prom_init.c:1388:8: error: variable ‘path’ set but not used [-Werror=unused-but-set-variable]

---
v2: move path within ifdef DEBUG_PROM

 arch/powerpc/kernel/prom_init.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
arch/powerpc/kernel/prom_init.c +3 -3
index acf4b2e0530c..4163b11abb6c 100644
@@ -603,7 +603,7 @@ static void __init early_cmdline_parse(void)
 	const char *opt;
 
 	char *p;
-	int l = 0;
+	int l __maybe_unused = 0;
 
 	prom_cmd_line[0] = 0;
 	p = prom_cmd_line;
@@ -1385,7 +1385,7 @@ static void __init reserve_mem(u64 base, u64 size)
 static void __init prom_init_mem(void)
 {
 	phandle node;
-	char *path, type[64];
+	char *path __maybe_unused, type[64];
 	unsigned int plen;
 	cell_t *p, *endp;
 	__be32 val;
@@ -1406,7 +1406,6 @@ static void __init prom_init_mem(void)
 	prom_debug("root_size_cells: %x\n", rsc);
 
 	prom_debug("scanning memory:\n");
-	path = prom_scratch;
 
 	for (node = 0; prom_next_node(&node); ) {
 		type[0] = 0;
@@ -1431,6 +1430,7 @@ static void __init prom_init_mem(void)
 		endp = p + (plen / sizeof(cell_t));
 
 #ifdef DEBUG_PROM
+		path = prom_scratch;
 		memset(path, 0, PROM_SCRATCH_SIZE);
 		call_prom("package-to-path", 3, 1, node, path, PROM_SCRATCH_SIZE-1);
 		prom_debug("  node %s :\n", path);
Signature · 1 line
2.11.0
#18 lore raw

Re: [PATCH v2 03/19] powerpc: Mark variables as unused

Mathieu Malaterre <[email protected]> a écrit :

Quoted 28 lines

Add gcc attribute unused for two variables. Fix warnings treated as errors with W=1:

arch/powerpc/kernel/prom_init.c:1388:8: error: variable ‘path’ set
but not used [-Werror=unused-but-set-variable]

---
v2: move path within ifdef DEBUG_PROM

 arch/powerpc/kernel/prom_init.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
arch/powerpc/kernel/prom_init.c +1 -1
index acf4b2e0530c..4163b11abb6c 100644
@@ -603,7 +603,7 @@ static void __init early_cmdline_parse(void)
 	const char *opt;
 
 	char *p;
-	int l = 0;
+	int l __maybe_unused = 0;
 
 	prom_cmd_line[0] = 0;
 	p = prom_cmd_line;

arch/powerpc/kernel/prom_init.c static void __init reserve_mem(u64 base, u64 size) · line 1388

Quoted 5 lines
arch/powerpc/kernel/prom_init.c +1 -1
@@ -1385,7 +1385,7 @@ static void __init reserve_mem(u64 base, u64 size)
 static void __init prom_init_mem(void)
 {
 	phandle node;
-	char *path, type[64];
+	char *path __maybe_unused, type[64];

You should enclose that in an ifdef DEBUG_PROM instead of hiding the warning

Christophe

Quoted 21 lines
arch/powerpc/kernel/prom_init.c +1 -2
 	unsigned int plen;
 	cell_t *p, *endp;
 	__be32 val;
@@ -1406,7 +1406,6 @@ static void __init prom_init_mem(void)
 	prom_debug("root_size_cells: %x\n", rsc);
 
 	prom_debug("scanning memory:\n");
-	path = prom_scratch;
 
 	for (node = 0; prom_next_node(&node); ) {
 		type[0] = 0;
@@ -1431,6 +1430,7 @@ static void __init prom_init_mem(void)
 		endp = p + (plen / sizeof(cell_t));
 
 #ifdef DEBUG_PROM
+		path = prom_scratch;
 		memset(path, 0, PROM_SCRATCH_SIZE);
 		call_prom("package-to-path", 3, 1, node, path, PROM_SCRATCH_SIZE-1);
 		prom_debug("  node %s :\n", path);
--

2.11.0

#19 lore raw

Re: [PATCH v2 03/19] powerpc: Mark variables as unused

Quoted 3 lines · LEROY Christophe

Mathieu Malaterre <[email protected]> a =C3=A9crit=C2=A0:

Quoted 1 line

Add gcc attribute unused for two variables. Fix warnings treated as erro=

rs

Quoted 3 lines
Quoted 3 lines

with W=3D1:

arch/powerpc/kernel/prom_init.c:1388:8: error: variable =E2=80=98path=

=E2=80=99 set=20=20

Quoted 22 lines
Quoted 22 lines

but not used [-Werror=3Dunused-but-set-variable]

---
v2: move path within ifdef DEBUG_PROM

 arch/powerpc/kernel/prom_init.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
arch/powerpc/kernel/prom_init.c +1 -1
index acf4b2e0530c..4163b11abb6c 100644
@@ -603,7 +603,7 @@ static void __init early_cmdline_parse(void)
 	const char *opt;
 
 	char *p;
-	int l =3D 0;
+	int l __maybe_unused =3D 0;
 
Quoted 10 lines

arch/powerpc/kernel/prom_init.c static void __init reserve_mem(u64 base, u64 size) · line 1388

Quoted 8 lines
arch/powerpc/kernel/prom_init.c +1 -1
 	prom_cmd_line[0] =3D 0;
 	p =3D prom_cmd_line;
@@ -1385,7 +1385,7 @@ static void __init reserve_mem(u64 base, u64 size)
 static void __init prom_init_mem(void)
 {
 	phandle node;
-	char *path, type[64];
+	char *path __maybe_unused, type[64];

You should enclose that in an ifdef DEBUG_PROM instead of hiding the warn=

ing

I disagree, the result is horrible:

static void __init prom_init_mem(void)

 {
	phandle node;

- char *path, type[64];
+#ifdef DEBUG_PROM
+ char *path;
+#endif

+	char type[64];
	unsigned int plen;
	cell_t *p, *endp;
	__be32 val;

The right fix is to move the debug logic into a helper, and put the path in there, eg. something like (not tested):

arch/powerpc/kernel/prom_ini= renamed from arch/powerpc/kernel/prom_init.c +0 -0

t.c
index f9d6befb55a6..b02fa2ccc70b 100644

arch/powerpc/kernel/prom_init.c +0 -0
@@ -1389,6 +1389,18 @@ static void __init reserve_mem(u64 base, u64 size)
 	mem_reserve_cnt =3D cnt + 1;
 }

=20
+#ifdef DEBUG_PROM
+static void prom_debug_path(phandle node)
+{
+ char *path;
+ path =3D prom_scratch;
+ memset(path, 0, PROM_SCRATCH_SIZE);
+ call_prom("package-to-path", 3, 1, node, path, PROM_SCRATCH_SIZE-1);
+ prom_debug(" node %s :\n", path);
+}
+#else
+static void prom_debug_path(phandle node) { }
+#endif /* DEBUG_PROM */
/*
* Initialize memory allocation mechanism, parse "memory" nodes and
* obtain that way the top of memory and RMO to setup out local allocator
@@ -1441,11 +1453,7 @@ static void __init prom_init_mem(void)
p =3D regbuf;
endp =3D p + (plen / sizeof(cell_t));
=20
-#ifdef DEBUG_PROM
- memset(path, 0, PROM_SCRATCH_SIZE);
- call_prom("package-to-path", 3, 1, node, path, PROM_SCRATCH_SIZE-1);
- prom_debug(" node %s :\n", path);
-#endif /* DEBUG_PROM */
+ prom_debug_path(node);
=20
while ((endp - p) >=3D (rac + rsc)) {
unsigned long base, size;

Although that also begs the question of why the hell do we need path at all, and not just use prom_scratch directly?

cheers

#20 lore raw

Re: [PATCH v2 03/19] powerpc: Mark variables as unused

Michael Ellerman <[email protected]> a =C3=A9crit=C2=A0:

Quoted 5 lines
Quoted 3 lines · LEROY Christophe

Mathieu Malaterre <[email protected]> a =C3=A9crit=C2=A0:

Quoted 1 line

Add gcc attribute unused for two variables. Fix warnings treated as err=

ors

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

with W=3D1:

arch/powerpc/kernel/prom_init.c:1388:8: error: variable =E2=80=98path=

=E2=80=99 set

Quoted 18 lines
Quoted 18 lines
Quoted 18 lines

but not used [-Werror=3Dunused-but-set-variable]

---
v2: move path within ifdef DEBUG_PROM

 arch/powerpc/kernel/prom_init.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
arch/powerpc/kernel/prom_init.c +0 -0
index acf4b2e0530c..4163b11abb6c 100644
@@ -603,7 +603,7 @@ static void __init early_cmdline_parse(void)
 	const char *opt;
 
Quoted 7 lines
Quoted 7 lines

arch/powerpc/kernel/prom_init.c static void __init reserve_mem(u64 base, u64 size=

Quoted 7 lines
arch/powerpc/kernel/prom_init.c +1 -1
 	char *p;
-	int l =3D 0;
+	int l __maybe_unused =3D 0;
 
 	prom_cmd_line[0] =3D 0;
 	p =3D prom_cmd_line;
@@ -1385,7 +1385,7 @@ static void __init reserve_mem(u64 base, u64 size=

)

Quoted 7 lines
Quoted 7 lines

arch/powerpc/kernel/prom_init.c static void __init reserve_mem(u64 base, u64 size= · line 1388

Quoted 5 lines
arch/powerpc/kernel/prom_init.c +1 -1
 static void __init prom_init_mem(void)
 {
 	phandle node;
-	char *path, type[64];
+	char *path __maybe_unused, type[64];

You should enclose that in an ifdef DEBUG_PROM instead of hiding the war=

ning

Quoted 29 lines

I disagree, the result is horrible:

static void __init prom_init_mem(void)

 {
	phandle node;
(quoted diff) +4 -1
-	char *path, type[64];
+#ifdef DEBUG_PROM
+	char *path;
+#endif
+	char type[64];
	unsigned int plen;
	cell_t *p, *endp;
	__be32 val;

The right fix is to move the debug logic into a helper, and put the path in there, eg. something like (not tested):

(quoted diff) +0 -0

=20b/arch/powerpc/kernel/prom_init.c
index f9d6befb55a6..b02fa2ccc70b 100644

arch/powerpc/kernel/prom_init.c +1 -0
@@ -1389,6 +1389,18 @@ static void __init reserve_mem(u64 base, u64 size)
 	mem_reserve_cnt =3D cnt + 1;
 }
 
+#ifdef DEBUG_PROM

arch/powerpc/kernel/prom_init.c static void __init reserve_mem(u64 base, u64 size) · line 1402

Quoted 10 lines
arch/powerpc/kernel/prom_init.c +10 -0
+static void prom_debug_path(phandle node)
+{
+	char *path;
+	path =3D prom_scratch;
+	memset(path, 0, PROM_SCRATCH_SIZE);
+	call_prom("package-to-path", 3, 1, node, path, PROM_SCRATCH_SIZE-1);
+	prom_debug("  node %s :\n", path);
+}
+#else
+static void prom_debug_path(phandle node) { }

Or put the ifdef inside the function to avoid double definition ?

arch/powerpc/kernel/prom_init.c static void __init reserve_mem(u64 base, u64 size) · line 1406

Quoted 4 lines
arch/powerpc/kernel/prom_init.c +1 -0
+#endif /* DEBUG_PROM */
 /*
  * Initialize memory allocation mechanism, parse "memory" nodes and
  * obtain that way the top of memory and RMO to setup out local allocato=

r

Quoted 15 lines
arch/powerpc/kernel/prom_init.c +1 -5
@@ -1441,11 +1453,7 @@ static void __init prom_init_mem(void)
 		p =3D regbuf;
 		endp =3D p + (plen / sizeof(cell_t));
 
-#ifdef DEBUG_PROM
-		memset(path, 0, PROM_SCRATCH_SIZE);
-		call_prom("package-to-path", 3, 1, node, path, PROM_SCRATCH_SIZE-1);
-		prom_debug("  node %s :\n", path);
-#endif /* DEBUG_PROM */
+		prom_debug_path(node);
 
 		while ((endp - p) >=3D (rac + rsc)) {
 			unsigned long base, size;
Quoted 2 lines

Although that also begs the question of why the hell do we need path at all, and not just use prom_scratch directly?

Wondering the same, why not use prom_scratch directly

Christophe

Quoted 2 lines

cheers

#21 lore raw

PATCH v3 3/19 powerpc: Move `path` variable inside DEBUG_PROM

In reply to Mathieu Malaterre

Add gcc attribute unused for two variables. Fix warnings treated as errors with W=1:

arch/powerpc/kernel/prom_init.c:1388:8: error: variable ‘path’ set but not used [-Werror=unused-but-set-variable]

---
v3: really move path within ifdef DEBUG_PROM
v2: move path within ifdef DEBUG_PROM

 arch/powerpc/kernel/prom_init.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
arch/powerpc/kernel/prom_init.c +7 -2
index acf4b2e0530c..223b35acbbdd 100644
@@ -603,7 +603,7 @@ static void __init early_cmdline_parse(void)
 	const char *opt;
 
 	char *p;
-	int l = 0;
+	int l __maybe_unused = 0;
 
 	prom_cmd_line[0] = 0;
 	p = prom_cmd_line;
@@ -1385,7 +1385,10 @@ static void __init reserve_mem(u64 base, u64 size)
 static void __init prom_init_mem(void)
 {
 	phandle node;
-	char *path, type[64];
+#ifdef DEBUG_PROM
+	char *path;
+#endif
+	char type[64];
 	unsigned int plen;
 	cell_t *p, *endp;
 	__be32 val;
@@ -1406,7 +1409,9 @@ static void __init prom_init_mem(void)
 	prom_debug("root_size_cells: %x\n", rsc);
 
 	prom_debug("scanning memory:\n");
+#ifdef DEBUG_PROM
 	path = prom_scratch;
+#endif
 
 	for (node = 0; prom_next_node(&node); ) {
 		type[0] = 0;
Signature · 1 line
2.11.0
#22 lore raw

Re: [PATCH v3 03/19] powerpc: Move `path` variable inside DEBUG_PROM

This one should be ok.

Quoted 2 lines · Mathieu Malaterre

Add gcc attribute unused for two variables. Fix warnings treated as error=

s

Quoted 3 lines

with W=3D1:

arch/powerpc/kernel/prom_init.c:1388:8: error: variable =E2=80=98path=

=E2=80=99 set but not used [-Werror=3Dunused-but-set-variable]

arch/powerpc/kernel/prom_i=

Quoted 11 lines

---
v3: really move path within ifdef DEBUG_PROM
v2: move path within ifdef DEBUG_PROM

 arch/powerpc/kernel/prom_init.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
arch/powerpc/kernel/prom_i= renamed from arch/powerpc/kernel/prom_init.c +0 -0

nit.c

Quoted 37 lines

index acf4b2e0530c..223b35acbbdd 100644

arch/powerpc/kernel/prom_init.c +7 -3
@@ -603,7 +603,7 @@ static void __init early_cmdline_parse(void)
        const char *opt;
 
        char *p;
-       int l =3D 0;
+       int l __maybe_unused =3D 0;
 
        prom_cmd_line[0] =3D 0;
        p =3D prom_cmd_line;
@@ -1385,7 +1385,10 @@ static void __init reserve_mem(u64 base, u64 size)
 static void __init prom_init_mem(void)
 {
        phandle node;
-       char *path, type[64];
+#ifdef DEBUG_PROM
+       char *path;
+#endif
+       char type[64];
        unsigned int plen;
        cell_t *p, *endp;
        __be32 val;
@@ -1406,7 +1409,9 @@ static void __init prom_init_mem(void)
        prom_debug("root_size_cells: %x\n", rsc);
 
        prom_debug("scanning memory:\n");
+#ifdef DEBUG_PROM
        path =3D prom_scratch;
+#endif
 
        for (node =3D 0; prom_next_node(&node); ) {
                type[0] =3D 0;
--

2.11.0

#23 lore raw

Re: [v3,03/19] powerpc: Move `path` variable inside DEBUG_PROM

In reply to Mathieu Malaterre
Quoted 7 lines · Mathieu Malaterre

Add gcc attribute unused for two variables. Fix warnings treated as errors with W=1:

arch/powerpc/kernel/prom_init.c:1388:8: error: variable ‘path’ set but not used [-Werror=unused-but-set-variable]

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/eab00a208eb63d863b6cc0a03f68b4

cheers

#24 lore raw

PATCH v4 3/19 powerpc: Mark variable `l` as unused, remove `path`

In reply to Mathieu Malaterre

Add gcc attribute unused for l variable, replace path variable directly with prom_scratch. Fix warnings treated as errors with W=1:

arch/powerpc/kernel/prom_init.c:607:6: error: variable ‘l’ set but not used [-Werror=unused-but-set-variable] arch/powerpc/kernel/prom_init.c:1388:8: error: variable ‘path’ set but not used [-Werror=unused-but-set-variable]

---
v4: redo v3 since path variable can be avoided
v3: really move path within ifdef DEBUG_PROM
v2: move path within ifdef DEBUG_PROM

 arch/powerpc/kernel/prom_init.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)
arch/powerpc/kernel/prom_init.c +5 -6
index f8a9a50ff9b5..4b223a9470be 100644
@@ -604,7 +604,7 @@ static void __init early_cmdline_parse(void)
 	const char *opt;
 
 	char *p;
-	int l = 0;
+	int l __maybe_unused = 0;
 
 	prom_cmd_line[0] = 0;
 	p = prom_cmd_line;
@@ -1386,7 +1386,7 @@ static void __init reserve_mem(u64 base, u64 size)
 static void __init prom_init_mem(void)
 {
 	phandle node;
-	char *path, type[64];
+	char type[64];
 	unsigned int plen;
 	cell_t *p, *endp;
 	__be32 val;
@@ -1407,7 +1407,6 @@ static void __init prom_init_mem(void)
 	prom_debug("root_size_cells: %x\n", rsc);
 
 	prom_debug("scanning memory:\n");
-	path = prom_scratch;
 
 	for (node = 0; prom_next_node(&node); ) {
 		type[0] = 0;
@@ -1432,9 +1431,9 @@ static void __init prom_init_mem(void)
 		endp = p + (plen / sizeof(cell_t));
 
 #ifdef DEBUG_PROM
-		memset(path, 0, PROM_SCRATCH_SIZE);
-		call_prom("package-to-path", 3, 1, node, path, PROM_SCRATCH_SIZE-1);
-		prom_debug("  node %s :\n", path);
+		memset(prom_scratch, 0, PROM_SCRATCH_SIZE);
+		call_prom("package-to-path", 3, 1, node, prom_scratch, PROM_SCRATCH_SIZE - 1);
+		prom_debug("  node %s :\n", prom_scratch);
 #endif /* DEBUG_PROM */
 
 		while ((endp - p) >= (rac + rsc)) {
Signature · 1 line
2.11.0
#25 lore raw

Re: [PATCH v4 03/19] powerpc: Mark variable `l` as unused, remove `path`

Mathieu Malaterre <[email protected]> a écrit :

Quoted 23 lines

Add gcc attribute unused for l variable, replace path variable directly with prom_scratch. Fix warnings treated as errors with W=1:

arch/powerpc/kernel/prom_init.c:607:6: error: variable ‘l’ set but
not used [-Werror=unused-but-set-variable]
arch/powerpc/kernel/prom_init.c:1388:8: error: variable ‘path’ set
but not used [-Werror=unused-but-set-variable]

---
v4: redo v3 since path variable can be avoided
v3: really move path within ifdef DEBUG_PROM
v2: move path within ifdef DEBUG_PROM

 arch/powerpc/kernel/prom_init.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)
arch/powerpc/kernel/prom_init.c +0 -0
index f8a9a50ff9b5..4b223a9470be 100644

arch/powerpc/kernel/prom_init.c static void __init early_cmdline_parse(void) · line 607

Quoted 5 lines
arch/powerpc/kernel/prom_init.c +1 -1
@@ -604,7 +604,7 @@ static void __init early_cmdline_parse(void)
 	const char *opt;
 
 	char *p;
-	int l = 0;
+	int l __maybe_unused = 0;

Instead of hiding the problem with __maybe_unused, I think we could replace the #ifdef CONFIG_CMDLINE
by a
if (IS_ENABLED(CONFIG_CMDLINE_BOOL))

This is recommanded by Linux codying style

Christophe

Quoted 36 lines
arch/powerpc/kernel/prom_init.c +4 -5
 	prom_cmd_line[0] = 0;
 	p = prom_cmd_line;
@@ -1386,7 +1386,7 @@ static void __init reserve_mem(u64 base, u64 size)
 static void __init prom_init_mem(void)
 {
 	phandle node;
-	char *path, type[64];
+	char type[64];
 	unsigned int plen;
 	cell_t *p, *endp;
 	__be32 val;
@@ -1407,7 +1407,6 @@ static void __init prom_init_mem(void)
 	prom_debug("root_size_cells: %x\n", rsc);
 
 	prom_debug("scanning memory:\n");
-	path = prom_scratch;
 
 	for (node = 0; prom_next_node(&node); ) {
 		type[0] = 0;
@@ -1432,9 +1431,9 @@ static void __init prom_init_mem(void)
 		endp = p + (plen / sizeof(cell_t));
 
 #ifdef DEBUG_PROM
-		memset(path, 0, PROM_SCRATCH_SIZE);
-		call_prom("package-to-path", 3, 1, node, path, PROM_SCRATCH_SIZE-1);
-		prom_debug("  node %s :\n", path);
+		memset(prom_scratch, 0, PROM_SCRATCH_SIZE);
+		call_prom("package-to-path", 3, 1, node, prom_scratch,  
 PROM_SCRATCH_SIZE - 1);
+		prom_debug("  node %s :\n", prom_scratch);
 #endif /* DEBUG_PROM */
 

while ((endp - p) >= (rac + rsc)) {
--
2.11.0

#26 lore raw

Re: [PATCH v4 03/19] powerpc: Mark variable `l` as unused, remove `path`

Quoted 7 lines · LEROY Christophe

Mathieu Malaterre <[email protected]> a =C3=A9crit :

Quoted 5 lines

Add gcc attribute unused for l variable, replace path variable directly
with prom_scratch. Fix warnings treated as errors with W=3D1:

arch/powerpc/kernel/prom_init.c:607:6: error: variable =E2=80=98l=E2=

=80=99 set but not

Quoted 2 lines
Quoted 2 lines

used [-Werror=3Dunused-but-set-variable]
arch/powerpc/kernel/prom_init.c:1388:8: error: variable =E2=80=98path=

=E2=80=99 set but

Quoted 20 lines
Quoted 20 lines

not used [-Werror=3Dunused-but-set-variable]

---
v4: redo v3 since path variable can be avoided
v3: really move path within ifdef DEBUG_PROM
v2: move path within ifdef DEBUG_PROM

 arch/powerpc/kernel/prom_init.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)
arch/powerpc/kernel/prom_init.c +0 -0
index f8a9a50ff9b5..4b223a9470be 100644
@@ -604,7 +604,7 @@ static void __init early_cmdline_parse(void)
        const char *opt;
 
Quoted 6 lines

arch/powerpc/kernel/prom_init.c static void __init early_cmdline_parse(void) · line 607

Quoted 3 lines
arch/powerpc/kernel/prom_init.c +1 -1
        char *p;
-       int l =3D 0;
+       int l __maybe_unused =3D 0;

Instead of hiding the problem with __maybe_unused, I think we could repla=

ce

Quoted 6 lines

the
#ifdef CONFIG_CMDLINE
by a
if (IS_ENABLED(CONFIG_CMDLINE_BOOL))

This is recommanded by Linux codying style

Neat. I was not aware of this trick. Does not work in this case though:

arch/powerpc/kernel/prom_ini= renamed from arch/powerpc/kernel/prom_init.c +0 -0

t.c
index 7925f64fefde..19634739b279 100644

arch/powerpc/kernel/prom_init.c +1 -1
@@ -604,17 +604,16 @@ static void __init early_cmdline_parse(void)
        const char *opt;
 
        char *p;
-       int l __maybe_unused =3D 0;
+       int l =3D 0;
 
        prom_cmd_line[0] =3D 0;
        p =3D prom_cmd_line;
        if ((long)prom.chosen > 0)
                l =3D prom_getprop(prom.chosen, "bootargs", p,

COMMAND_LINE_SIZE-1);
-#ifdef CONFIG_CMDLINE
- if (l <=3D 0 || p[0] =3D=3D '\0') /* dbl check */
- strlcpy(prom_cmd_line,
- CONFIG_CMDLINE, sizeof(prom_cmd_line));
-#endif /* CONFIG_CMDLINE */
+ if (IS_ENABLED(CONFIG_CMDLINE_BOOL))
+ if (l <=3D 0 || p[0] =3D=3D '\0') /* dbl check */
+ strlcpy(prom_cmd_line,

+                               CONFIG_CMDLINE, sizeof(prom_cmd_line));
        prom_printf("command line: %s\n", prom_cmd_line);

#ifdef CONFIG_PPC64

leads to:

CC arch/powerpc/kernel/prom_init.o
../arch/powerpc/kernel/prom_init.c: In function =E2=80=98early_cmdline_pars= e=E2=80=99:
../arch/powerpc/kernel/prom_init.c:616:5: error: =E2=80=98CONFIG_CMDLINE=E2= =80=99
undeclared (first use in this function)

     CONFIG_CMDLINE, sizeof(prom_cmd_line));
     ^~~~~~~~~~~~~~

../arch/powerpc/kernel/prom_init.c:616:5: note: each undeclared identifier is reported only once for each function it appears in ../scripts/Makefile.build:312: recipe for target 'arch/powerpc/kernel/prom_init.o' failed
make[6]: *** [arch/powerpc/kernel/prom_init.o] Error 1

Quoted 43 lines

Christophe

Quoted 37 lines
arch/powerpc/kernel/prom_init.c +4 -5
        prom_cmd_line[0] =3D 0;
        p =3D prom_cmd_line;
@@ -1386,7 +1386,7 @@ static void __init reserve_mem(u64 base, u64 size)
 static void __init prom_init_mem(void)
 {
        phandle node;
-       char *path, type[64];
+       char type[64];
        unsigned int plen;
        cell_t *p, *endp;
        __be32 val;
@@ -1407,7 +1407,6 @@ static void __init prom_init_mem(void)
        prom_debug("root_size_cells: %x\n", rsc);
 
        prom_debug("scanning memory:\n");
-       path =3D prom_scratch;
 
        for (node =3D 0; prom_next_node(&node); ) {
                type[0] =3D 0;
@@ -1432,9 +1431,9 @@ static void __init prom_init_mem(void)
                endp =3D p + (plen / sizeof(cell_t));
 
 #ifdef DEBUG_PROM
-               memset(path, 0, PROM_SCRATCH_SIZE);
-               call_prom("package-to-path", 3, 1, node, path,
 PROM_SCRATCH_SIZE-1);
-               prom_debug("  node %s :\n", path);
+               memset(prom_scratch, 0, PROM_SCRATCH_SIZE);
+               call_prom("package-to-path", 3, 1, node, prom_scratch,
 PROM_SCRATCH_SIZE - 1);
+               prom_debug("  node %s :\n", prom_scratch);
 #endif /* DEBUG_PROM */
                while ((endp - p) >=3D (rac + rsc)) {

--
2.11.0

#27 lore raw

Re: [PATCH v4 03/19] powerpc: Mark variable `l` as unused, remove `path`

Le 06/04/2018 à 20:32, Mathieu Malaterre a écrit :

Quoted 82 lines
Quoted 40 lines · LEROY Christophe
Quoted 25 lines · Mathieu Malaterre

Add gcc attribute unused for l variable, replace path variable directly
with prom_scratch. Fix warnings treated as errors with W=1:

arch/powerpc/kernel/prom_init.c:607:6: error: variable ‘l’ set but not
used [-Werror=unused-but-set-variable]
arch/powerpc/kernel/prom_init.c:1388:8: error: variable ‘path’ set but
not used [-Werror=unused-but-set-variable]

---
v4: redo v3 since path variable can be avoided
v3: really move path within ifdef DEBUG_PROM
v2: move path within ifdef DEBUG_PROM

  arch/powerpc/kernel/prom_init.c | 11 +++++------
  1 file changed, 5 insertions(+), 6 deletions(-)
arch/powerpc/kernel/prom_init.c +0 -0
index f8a9a50ff9b5..4b223a9470be 100644

arch/powerpc/kernel/prom_init.c static void __init early_cmdline_parse(void) · line 607

Quoted 5 lines
arch/powerpc/kernel/prom_init.c +1 -1
@@ -604,7 +604,7 @@ static void __init early_cmdline_parse(void)
         const char *opt;
 
         char *p;
-       int l = 0;
+       int l __maybe_unused = 0;

Instead of hiding the problem with __maybe_unused, I think we could replace the
#ifdef CONFIG_CMDLINE
by a
if (IS_ENABLED(CONFIG_CMDLINE_BOOL))

Quoted 1 line

This is recommanded by Linux codying style

Neat. I was not aware of this trick. Does not work in this case though:

arch/powerpc/kernel/prom_init.c +5 -6
index 7925f64fefde..19634739b279 100644
@@ -604,17 +604,16 @@ static void __init early_cmdline_parse(void)
         const char *opt;
 
         char *p;
-       int l __maybe_unused = 0;
+       int l = 0;
 
         prom_cmd_line[0] = 0;
         p = prom_cmd_line;
         if ((long)prom.chosen > 0)
                 l = prom_getprop(prom.chosen, "bootargs", p,
 COMMAND_LINE_SIZE-1);
-#ifdef CONFIG_CMDLINE
-       if (l <= 0 || p[0] == '\0') /* dbl check */
-               strlcpy(prom_cmd_line,
-                       CONFIG_CMDLINE, sizeof(prom_cmd_line));
-#endif /* CONFIG_CMDLINE */
+       if (IS_ENABLED(CONFIG_CMDLINE_BOOL))
+               if (l <= 0 || p[0] == '\0') /* dbl check */
+                       strlcpy(prom_cmd_line,
+                               CONFIG_CMDLINE, sizeof(prom_cmd_line));
         prom_printf("command line: %s\n", prom_cmd_line);
 
  #ifdef CONFIG_PPC64

leads to:

CC arch/powerpc/kernel/prom_init.o
../arch/powerpc/kernel/prom_init.c: In function ‘early_cmdline_parse’:
../arch/powerpc/kernel/prom_init.c:616:5: error: ‘CONFIG_CMDLINE’ undeclared (first use in this function)

Quoted 7 lines
      CONFIG_CMDLINE, sizeof(prom_cmd_line));
      ^~~~~~~~~~~~~~

../arch/powerpc/kernel/prom_init.c:616:5: note: each undeclared identifier is reported only once for each function it appears in ../scripts/Makefile.build:312: recipe for target 'arch/powerpc/kernel/prom_init.o' failed
make[6]: *** [arch/powerpc/kernel/prom_init.o] Error 1

And what about something like :

+ if (l <= 0 || p[0] == '\0') { /* dbl check */
#ifdef CONFIG_CMDLINE
- if (l <= 0 || p[0] == '\0') /* dbl check */

                strlcpy(prom_cmd_line,
                        CONFIG_CMDLINE, sizeof(prom_cmd_line));
 #endif /* CONFIG_CMDLINE */
+}
         prom_printf("command line: %s\n", prom_cmd_line);

Christophe

Quoted 39 lines
Quoted 39 lines

Christophe

Quoted 34 lines
arch/powerpc/kernel/prom_init.c +4 -5
         prom_cmd_line[0] = 0;
         p = prom_cmd_line;
@@ -1386,7 +1386,7 @@ static void __init reserve_mem(u64 base, u64 size)
  static void __init prom_init_mem(void)
  {
         phandle node;
-       char *path, type[64];
+       char type[64];
         unsigned int plen;
         cell_t *p, *endp;
         __be32 val;
@@ -1407,7 +1407,6 @@ static void __init prom_init_mem(void)
         prom_debug("root_size_cells: %x\n", rsc);
 
         prom_debug("scanning memory:\n");
-       path = prom_scratch;
 
         for (node = 0; prom_next_node(&node); ) {
                 type[0] = 0;
@@ -1432,9 +1431,9 @@ static void __init prom_init_mem(void)
                 endp = p + (plen / sizeof(cell_t));
 
  #ifdef DEBUG_PROM
-               memset(path, 0, PROM_SCRATCH_SIZE);
-               call_prom("package-to-path", 3, 1, node, path,
 PROM_SCRATCH_SIZE-1);
-               prom_debug("  node %s :\n", path);
+               memset(prom_scratch, 0, PROM_SCRATCH_SIZE);
+               call_prom("package-to-path", 3, 1, node, prom_scratch,
 PROM_SCRATCH_SIZE - 1);
+               prom_debug("  node %s :\n", prom_scratch);
  #endif /* DEBUG_PROM */
Quoted 6 lines
Quoted 6 lines
Quoted 3 lines
                 while ((endp - p) >= (rac + rsc)) {

--
2.11.0

---
L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast.
https://www.avast.com/antivirus

#28 lore raw

PATCH 4/19 powerpc/kvm: Mark variable tmp unused

In reply to Mathieu Malaterre

Add gcc attribute unused to variable tmp. Fix warning treated as error with W=1:

arch/powerpc/kernel/kvm.c:675:6: error: variable ‘tmp’ set but not used [-Werror=unused-but-set-variable]

---
 arch/powerpc/kernel/kvm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/kernel/kvm.c +1 -1
index 9ad37f827a97..cd3c088283f9 100644
@@ -672,7 +672,7 @@ static void kvm_use_magic_page(void)
 {
 	u32 *p;
 	u32 *start, *end;
-	u32 tmp;
+	u32 tmp __maybe_unused;
 	u32 features;
 
 	/* Tell the host to map the magic page to -4096 on all CPUs */
Signature · 1 line
2.11.0
#29 lore raw

Re: [PATCH 04/19] powerpc/kvm: Mark variable tmp unused

Le 22/03/2018 à 21:19, Mathieu Malaterre a écrit :

Quoted 16 lines

Add gcc attribute unused to variable tmp. Fix warning treated as error with W=1:

arch/powerpc/kernel/kvm.c:675:6: error: variable ‘tmp’ set but not used [-Werror=unused-but-set-variable]

---
  arch/powerpc/kernel/kvm.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/kernel/kvm.c +0 -0
index 9ad37f827a97..cd3c088283f9 100644

arch/powerpc/kernel/kvm.c static void kvm_use_magic_page(void) · line 678

Quoted 8 lines
arch/powerpc/kernel/kvm.c +1 -1
@@ -672,7 +672,7 @@ static void kvm_use_magic_page(void)
  {
  	u32 *p;
  	u32 *start, *end;
-	u32 tmp;
+	u32 tmp __maybe_unused;
  	u32 features;
 
  	/* Tell the host to map the magic page to -4096 on all CPUs */

This fonction should use fault_in_pages_readable() instead of hardcoding the verification.

Christophe

---
L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast.
https://www.avast.com/antivirus

#30 lore raw

PATCH v2 4/19 powerpc/kvm: Prefer fault_in_pages_readable function

In reply to Mathieu Malaterre

Directly use fault_in_pages_readable instead of manual __get_user code. Fix warning treated as error with W=1:

arch/powerpc/kernel/kvm.c:675:6: error: variable ‘tmp’ set but not used [-Werror=unused-but-set-variable]

---
v2: use fault_in_pages_readable instead

 arch/powerpc/kernel/kvm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/powerpc/kernel/kvm.c +2 -2
index 9ad37f827a97..124c51030b75 100644
@@ -25,6 +25,7 @@
 #include <linux/kvm_para.h>
 #include <linux/slab.h>
 #include <linux/of.h>
+#include <linux/pagemap.h>
 
 #include <asm/reg.h>
 #include <asm/sections.h>
@@ -672,14 +673,13 @@ static void kvm_use_magic_page(void)
 {
 	u32 *p;
 	u32 *start, *end;
-	u32 tmp;
 	u32 features;
 
 	/* Tell the host to map the magic page to -4096 on all CPUs */
 	on_each_cpu(kvm_map_magic_page, &features, 1);
 
 	/* Quick self-test to see if the mapping works */
-	if (__get_user(tmp, (u32*)KVM_MAGIC_PAGE)) {
+	if (!fault_in_pages_readable((const char *)KVM_MAGIC_PAGE, sizeof(u32))) {
 		kvm_patching_worked = false;
 		return;
 	}
Signature · 1 line
2.11.0
Reviewed-by on v2 4/19
#31 lore raw

Re: [PATCH v2 04/19] powerpc/kvm: Prefer fault_in_pages_readable function

Mathieu Malaterre <[email protected]> a écrit :

Quoted 8 lines

Directly use fault_in_pages_readable instead of manual __get_user code. Fix warning treated as error with W=1:

arch/powerpc/kernel/kvm.c:675:6: error: variable ‘tmp’ set but not
used [-Werror=unused-but-set-variable]

Quoted 35 lines

---
v2: use fault_in_pages_readable instead

 arch/powerpc/kernel/kvm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/powerpc/kernel/kvm.c +2 -3
index 9ad37f827a97..124c51030b75 100644
@@ -25,6 +25,7 @@
 #include <linux/kvm_para.h>
 #include <linux/slab.h>
 #include <linux/of.h>
+#include <linux/pagemap.h>
 
 #include <asm/reg.h>
 #include <asm/sections.h>
@@ -672,14 +673,13 @@ static void kvm_use_magic_page(void)
 {
 	u32 *p;
 	u32 *start, *end;
-	u32 tmp;
 	u32 features;
 
 	/* Tell the host to map the magic page to -4096 on all CPUs */
 	on_each_cpu(kvm_map_magic_page, &features, 1);
 
 	/* Quick self-test to see if the mapping works */
-	if (__get_user(tmp, (u32*)KVM_MAGIC_PAGE)) {
+	if (!fault_in_pages_readable((const char *)KVM_MAGIC_PAGE, sizeof(u32))) {
 		kvm_patching_worked = false;
 		return;
 	}
--

2.11.0

#32 lore raw

Re: [v2,04/19] powerpc/kvm: Prefer fault_in_pages_readable function

In reply to Mathieu Malaterre
Quoted 8 lines · Mathieu Malaterre

Directly use fault_in_pages_readable instead of manual __get_user code. Fix warning treated as error with W=1:

arch/powerpc/kernel/kvm.c:675:6: error: variable ‘tmp’ set but not used [-Werror=unused-but-set-variable]

Applied to powerpc topic/ppc-kvm, thanks.

https://git.kernel.org/powerpc/c/9f9eae5ce717f497812dfc1bda5219

cheers

#33 lore raw

PATCH 5/19 powerpc/chrp/setup: Add attribute unused and make some functions static

In reply to Mathieu Malaterre

Add gcc attribute unused to silence a warning.

These functions can all be static, make it so. Fix warnings treated as errors with W=1:

arch/powerpc/platforms/chrp/setup.c:97:6: error: no previous prototype for ‘chrp_show_cpuinfo’ [-Werror=missing-prototypes] arch/powerpc/platforms/chrp/setup.c:302:13: error: no previous prototype for ‘chrp_setup_arch’ [-Werror=missing-prototypes] arch/powerpc/platforms/chrp/setup.c:385:16: error: variable ‘idu_size’ set but not used [-Werror=unused-but-set-variable] arch/powerpc/platforms/chrp/setup.c:526:13: error: no previous prototype for ‘chrp_init_IRQ’ [-Werror=missing-prototypes] arch/powerpc/platforms/chrp/setup.c:559:1: error: no previous prototype for ‘chrp_init2’ [-Werror=missing-prototypes]

---
 arch/powerpc/platforms/chrp/setup.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
arch/powerpc/platforms/chrp/setup.c +5 -5
index 481ed133e04b..85df479fd631 100644
@@ -94,7 +94,7 @@ static const char *chrp_names[] = {
 	"Total Impact Briq"
 };
 
-void chrp_show_cpuinfo(struct seq_file *m)
+static void chrp_show_cpuinfo(struct seq_file *m)
 {
 	int i, sdramen;
 	unsigned int t;
@@ -299,7 +299,7 @@ static __init void chrp_init(void)
 	of_node_put(node);
 }
 
-void __init chrp_setup_arch(void)
+static void __init chrp_setup_arch(void)
 {
 	struct device_node *root = of_find_node_by_path("/");
 	const char *machine = NULL;
@@ -382,7 +382,7 @@ static void __init chrp_find_openpic(void)
 {
 	struct device_node *np, *root;
 	int len, i, j;
-	int isu_size, idu_size;
+	int isu_size, idu_size __maybe_unused;
 	const unsigned int *iranges, *opprop = NULL;
 	int oplen = 0;
 	unsigned long opaddr;
@@ -523,7 +523,7 @@ static void __init chrp_find_8259(void)
 	}
 }
 
-void __init chrp_init_IRQ(void)
+static void __init chrp_init_IRQ(void)
 {
 #if defined(CONFIG_VT) && defined(CONFIG_INPUT_ADBHID) && defined(CONFIG_XMON)
 	struct device_node *kbd;
@@ -555,7 +555,7 @@ void __init chrp_init_IRQ(void)
 #endif
 }
 
-void __init
+static void __init
 chrp_init2(void)
 {
 #ifdef CONFIG_NVRAM
Signature · 1 line
2.11.0
#34 lore raw

Re: [PATCH 05/19] powerpc/chrp/setup: Add attribute unused and make some functions static

Le 22/03/2018 à 21:19, Mathieu Malaterre a écrit :

Quoted 39 lines

Add gcc attribute unused to silence a warning.

These functions can all be static, make it so. Fix warnings treated as errors with W=1:

arch/powerpc/platforms/chrp/setup.c:97:6: error: no previous prototype for ‘chrp_show_cpuinfo’ [-Werror=missing-prototypes] arch/powerpc/platforms/chrp/setup.c:302:13: error: no previous prototype for ‘chrp_setup_arch’ [-Werror=missing-prototypes] arch/powerpc/platforms/chrp/setup.c:385:16: error: variable ‘idu_size’ set but not used [-Werror=unused-but-set-variable] arch/powerpc/platforms/chrp/setup.c:526:13: error: no previous prototype for ‘chrp_init_IRQ’ [-Werror=missing-prototypes] arch/powerpc/platforms/chrp/setup.c:559:1: error: no previous prototype for ‘chrp_init2’ [-Werror=missing-prototypes]

---
  arch/powerpc/platforms/chrp/setup.c | 10 +++++-----
  1 file changed, 5 insertions(+), 5 deletions(-)
arch/powerpc/platforms/chrp/setup.c +2 -2
index 481ed133e04b..85df479fd631 100644
@@ -94,7 +94,7 @@ static const char *chrp_names[] = {
  	"Total Impact Briq"
  };
 
-void chrp_show_cpuinfo(struct seq_file *m)
+static void chrp_show_cpuinfo(struct seq_file *m)
  {
  	int i, sdramen;
  	unsigned int t;
@@ -299,7 +299,7 @@ static __init void chrp_init(void)
  	of_node_put(node);
  }
 
-void __init chrp_setup_arch(void)
+static void __init chrp_setup_arch(void)
  {
  	struct device_node *root = of_find_node_by_path("/");
  	const char *machine = NULL;

arch/powerpc/platforms/chrp/setup.c static void __init chrp_find_openpic(void) · line 385

Quoted 5 lines
arch/powerpc/platforms/chrp/setup.c +1 -1
@@ -382,7 +382,7 @@ static void __init chrp_find_openpic(void)
  {
  	struct device_node *np, *root;
  	int len, i, j;
-	int isu_size, idu_size;
+	int isu_size, idu_size __maybe_unused;

idu_size is never used, you could remove it completely

Christophe

Quoted 14 lines
arch/powerpc/platforms/chrp/setup.c +1 -1
  	const unsigned int *iranges, *opprop = NULL;
  	int oplen = 0;
  	unsigned long opaddr;
@@ -523,7 +523,7 @@ static void __init chrp_find_8259(void)
  	}
  }
 
-void __init chrp_init_IRQ(void)
+static void __init chrp_init_IRQ(void)
  {
  #if defined(CONFIG_VT) && defined(CONFIG_INPUT_ADBHID) && defined(CONFIG_XMON)
  	struct device_node *kbd;

arch/powerpc/platforms/chrp/setup.c void __init chrp_init_IRQ(void) · line 561

Quoted 8 lines
arch/powerpc/platforms/chrp/setup.c +1 -1
@@ -555,7 +555,7 @@ void __init chrp_init_IRQ(void)
  #endif
  }
 
-void __init
+static void __init
  chrp_init2(void)
  {
  #ifdef CONFIG_NVRAM

---
L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast.
https://www.avast.com/antivirus

#35 lore raw

PATCH v2 5/19 powerpc/chrp/setup: Add attribute unused and make some functions static

In reply to Mathieu Malaterre

Remove variable declaration idu_size and associated code since not used.

These functions can all be static, make it so. Fix warnings treated as errors with W=1:

arch/powerpc/platforms/chrp/setup.c:97:6: error: no previous prototype for ‘chrp_show_cpuinfo’ [-Werror=missing-prototypes] arch/powerpc/platforms/chrp/setup.c:302:13: error: no previous prototype for ‘chrp_setup_arch’ [-Werror=missing-prototypes] arch/powerpc/platforms/chrp/setup.c:385:16: error: variable ‘idu_size’ set but not used [-Werror=unused-but-set-variable] arch/powerpc/platforms/chrp/setup.c:526:13: error: no previous prototype for ‘chrp_init_IRQ’ [-Werror=missing-prototypes] arch/powerpc/platforms/chrp/setup.c:559:1: error: no previous prototype for ‘chrp_init2’ [-Werror=missing-prototypes]

---
v2: Remove totally variable idu_size

 arch/powerpc/platforms/chrp/setup.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)
arch/powerpc/platforms/chrp/setup.c +5 -7
index 481ed133e04b..d6d8ffc0271e 100644
@@ -94,7 +94,7 @@ static const char *chrp_names[] = {
 	"Total Impact Briq"
 };
 
-void chrp_show_cpuinfo(struct seq_file *m)
+static void chrp_show_cpuinfo(struct seq_file *m)
 {
 	int i, sdramen;
 	unsigned int t;
@@ -299,7 +299,7 @@ static __init void chrp_init(void)
 	of_node_put(node);
 }
 
-void __init chrp_setup_arch(void)
+static void __init chrp_setup_arch(void)
 {
 	struct device_node *root = of_find_node_by_path("/");
 	const char *machine = NULL;
@@ -382,7 +382,7 @@ static void __init chrp_find_openpic(void)
 {
 	struct device_node *np, *root;
 	int len, i, j;
-	int isu_size, idu_size;
+	int isu_size;
 	const unsigned int *iranges, *opprop = NULL;
 	int oplen = 0;
 	unsigned long opaddr;
@@ -427,11 +427,9 @@ static void __init chrp_find_openpic(void)
 	}
 
 	isu_size = 0;
-	idu_size = 0;
 	if (len > 0 && iranges[1] != 0) {
 		printk(KERN_INFO "OpenPIC irqs %d..%d in IDU\n",
 		       iranges[0], iranges[0] + iranges[1] - 1);
-		idu_size = iranges[1];
 	}
 	if (len > 1)
 		isu_size = iranges[3];
@@ -523,7 +521,7 @@ static void __init chrp_find_8259(void)
 	}
 }
 
-void __init chrp_init_IRQ(void)
+static void __init chrp_init_IRQ(void)
 {
 #if defined(CONFIG_VT) && defined(CONFIG_INPUT_ADBHID) && defined(CONFIG_XMON)
 	struct device_node *kbd;
@@ -555,7 +553,7 @@ void __init chrp_init_IRQ(void)
 #endif
 }
 
-void __init
+static void __init
 chrp_init2(void)
 {
 #ifdef CONFIG_NVRAM
Signature · 1 line
2.11.0
#36 lore raw

Re: [PATCH v2 05/19] powerpc/chrp/setup: Add attribute unused and make some functions static

The subject of the patch should be updated as well

Christophe

Mathieu Malaterre <[email protected]> a écrit :

Quoted 87 lines

Remove variable declaration idu_size and associated code since not used.

These functions can all be static, make it so. Fix warnings treated as errors with W=1:

arch/powerpc/platforms/chrp/setup.c:97:6: error: no previous
prototype for ‘chrp_show_cpuinfo’ [-Werror=missing-prototypes]
arch/powerpc/platforms/chrp/setup.c:302:13: error: no previous
prototype for ‘chrp_setup_arch’ [-Werror=missing-prototypes]
arch/powerpc/platforms/chrp/setup.c:385:16: error: variable
‘idu_size’ set but not used [-Werror=unused-but-set-variable]
arch/powerpc/platforms/chrp/setup.c:526:13: error: no previous
prototype for ‘chrp_init_IRQ’ [-Werror=missing-prototypes]
arch/powerpc/platforms/chrp/setup.c:559:1: error: no previous
prototype for ‘chrp_init2’ [-Werror=missing-prototypes]

---
v2: Remove totally variable idu_size

 arch/powerpc/platforms/chrp/setup.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)
arch/powerpc/platforms/chrp/setup.c +4 -6
index 481ed133e04b..d6d8ffc0271e 100644
@@ -94,7 +94,7 @@ static const char *chrp_names[] = {
 	"Total Impact Briq"
 };
 
-void chrp_show_cpuinfo(struct seq_file *m)
+static void chrp_show_cpuinfo(struct seq_file *m)
 {
 	int i, sdramen;
 	unsigned int t;
@@ -299,7 +299,7 @@ static __init void chrp_init(void)
 	of_node_put(node);
 }
 
-void __init chrp_setup_arch(void)
+static void __init chrp_setup_arch(void)
 {
 	struct device_node *root = of_find_node_by_path("/");
 	const char *machine = NULL;
@@ -382,7 +382,7 @@ static void __init chrp_find_openpic(void)
 {
 	struct device_node *np, *root;
 	int len, i, j;
-	int isu_size, idu_size;
+	int isu_size;
 	const unsigned int *iranges, *opprop = NULL;
 	int oplen = 0;
 	unsigned long opaddr;
@@ -427,11 +427,9 @@ static void __init chrp_find_openpic(void)
 	}
 
 	isu_size = 0;
-	idu_size = 0;
 	if (len > 0 && iranges[1] != 0) {
 		printk(KERN_INFO "OpenPIC irqs %d..%d in IDU\n",
 		       iranges[0], iranges[0] + iranges[1] - 1);
-		idu_size = iranges[1];
 	}
 	if (len > 1)
 		isu_size = iranges[3];
@@ -523,7 +521,7 @@ static void __init chrp_find_8259(void)
 	}
 }
 
-void __init chrp_init_IRQ(void)
+static void __init chrp_init_IRQ(void)
 {
 #if defined(CONFIG_VT) && defined(CONFIG_INPUT_ADBHID) &&  
 defined(CONFIG_XMON)
arch/powerpc/platforms/chrp/setup.c +1 -2
 	struct device_node *kbd;
@@ -555,7 +553,7 @@ void __init chrp_init_IRQ(void)
 #endif
 }
 
-void __init
+static void __init
 chrp_init2(void)
 {
 #ifdef CONFIG_NVRAM
--

2.11.0

#37 lore raw

PATCH v3 5/19 powerpc/chrp/setup: Remove idu_size variable and make some functions static

In reply to Mathieu Malaterre

Remove variable declaration idu_size and associated code since not used.

These functions can all be static, make it so. Fix warnings treated as errors with W=1:

arch/powerpc/platforms/chrp/setup.c:97:6: error: no previous prototype for ‘chrp_show_cpuinfo’ [-Werror=missing-prototypes] arch/powerpc/platforms/chrp/setup.c:302:13: error: no previous prototype for ‘chrp_setup_arch’ [-Werror=missing-prototypes] arch/powerpc/platforms/chrp/setup.c:385:16: error: variable ‘idu_size’ set but not used [-Werror=unused-but-set-variable] arch/powerpc/platforms/chrp/setup.c:526:13: error: no previous prototype for ‘chrp_init_IRQ’ [-Werror=missing-prototypes] arch/powerpc/platforms/chrp/setup.c:559:1: error: no previous prototype for ‘chrp_init2’ [-Werror=missing-prototypes]

---
v3: update subject line after v2 change
v2: Remove totally variable idu_size

 arch/powerpc/platforms/chrp/setup.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)
arch/powerpc/platforms/chrp/setup.c +5 -7
index 481ed133e04b..d6d8ffc0271e 100644
@@ -94,7 +94,7 @@ static const char *chrp_names[] = {
 	"Total Impact Briq"
 };
 
-void chrp_show_cpuinfo(struct seq_file *m)
+static void chrp_show_cpuinfo(struct seq_file *m)
 {
 	int i, sdramen;
 	unsigned int t;
@@ -299,7 +299,7 @@ static __init void chrp_init(void)
 	of_node_put(node);
 }
 
-void __init chrp_setup_arch(void)
+static void __init chrp_setup_arch(void)
 {
 	struct device_node *root = of_find_node_by_path("/");
 	const char *machine = NULL;
@@ -382,7 +382,7 @@ static void __init chrp_find_openpic(void)
 {
 	struct device_node *np, *root;
 	int len, i, j;
-	int isu_size, idu_size;
+	int isu_size;
 	const unsigned int *iranges, *opprop = NULL;
 	int oplen = 0;
 	unsigned long opaddr;
@@ -427,11 +427,9 @@ static void __init chrp_find_openpic(void)
 	}
 
 	isu_size = 0;
-	idu_size = 0;
 	if (len > 0 && iranges[1] != 0) {
 		printk(KERN_INFO "OpenPIC irqs %d..%d in IDU\n",
 		       iranges[0], iranges[0] + iranges[1] - 1);
-		idu_size = iranges[1];
 	}
 	if (len > 1)
 		isu_size = iranges[3];
@@ -523,7 +521,7 @@ static void __init chrp_find_8259(void)
 	}
 }
 
-void __init chrp_init_IRQ(void)
+static void __init chrp_init_IRQ(void)
 {
 #if defined(CONFIG_VT) && defined(CONFIG_INPUT_ADBHID) && defined(CONFIG_XMON)
 	struct device_node *kbd;
@@ -555,7 +553,7 @@ void __init chrp_init_IRQ(void)
 #endif
 }
 
-void __init
+static void __init
 chrp_init2(void)
 {
 #ifdef CONFIG_NVRAM
Signature · 1 line
2.11.0
#38 lore raw

Re: [v3, 05/19] powerpc/chrp/setup: Remove idu_size variable and make some functions static

Quoted 5 lines · Mathieu Malaterre

Remove variable declaration idu_size and associated code since not used.

These functions can all be static, make it so. Fix warnings treated as errors with W=1:

Quoted 8 lines

arch/powerpc/platforms/chrp/setup.c:97:6: error: no previous prototype for ‘chrp_show_cpuinfo’ [-Werror=missing-prototypes] arch/powerpc/platforms/chrp/setup.c:302:13: error: no previous prototype for ‘chrp_setup_arch’ [-Werror=missing-prototypes] arch/powerpc/platforms/chrp/setup.c:385:16: error: variable ‘idu_size’ set but not used [-Werror=unused-but-set-variable] arch/powerpc/platforms/chrp/setup.c:526:13: error: no previous prototype for ‘chrp_init_IRQ’ [-Werror=missing-prototypes] arch/powerpc/platforms/chrp/setup.c:559:1: error: no previous prototype for ‘chrp_init2’ [-Werror=missing-prototypes]

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/f0e0b86638e9df6731b1d61c71ae18

cheers

#39 lore raw

PATCH 6/19 powerpc: Make function btext_initialize static

In reply to Mathieu Malaterre

This function can be static, make it so, this fix a warning treated as error with W=1:

arch/powerpc/kernel/btext.c:173:5: error: no previous prototype for ‘btext_initialize’ [-Werror=missing-prototypes]

---
 arch/powerpc/kernel/btext.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/kernel/btext.c +1 -1
index 6537cba1a758..38ae3ffe44f6 100644
@@ -170,7 +170,7 @@ void btext_map(void)
 	boot_text_mapped = 1;
 }
 
-int btext_initialize(struct device_node *np)
+static int btext_initialize(struct device_node *np)
 {
 	unsigned int width, height, depth, pitch;
 	unsigned long address = 0;
Signature · 1 line
2.11.0
#40 lore raw

Re: [06/19] powerpc: Make function btext_initialize static

Quoted 6 lines · Mathieu Malaterre

This function can be static, make it so, this fix a warning treated as error with W=1:

arch/powerpc/kernel/btext.c:173:5: error: no previous prototype for ‘btext_initialize’ [-Werror=missing-prototypes]

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/86e11b6e9c56e605475462bf9ba7c1

cheers

#41 lore raw

PATCH 7/19 powerpc/powermac: Make some functions static

In reply to Mathieu Malaterre

These functions can all be static, make it so. Fix warnings treated as errors with W=1:

arch/powerpc/platforms/powermac/pci.c:1022:6: error: no previous prototype for ‘pmac_pci_fixup_ohci’ [-Werror=missing-prototypes] arch/powerpc/platforms/powermac/pci.c:1057:6: error: no previous prototype for ‘pmac_pci_fixup_cardbus’ [-Werror=missing-prototypes] arch/powerpc/platforms/powermac/pci.c:1094:6: error: no previous prototype for ‘pmac_pci_fixup_pciata’ [-Werror=missing-prototypes]

Also add gcc attribute unused to fix a warning treated as error with W=1:

arch/powerpc/platforms/powermac/pci.c:784:19: error: variable ‘has_address’ set but not used [-Werror=unused-but-set-variable] arch/powerpc/platforms/powermac/pci.c:907:22: error: variable ‘ht’ set but not used [-Werror=unused-but-set-variable]

---
 arch/powerpc/platforms/powermac/pci.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
arch/powerpc/platforms/powermac/pci.c +5 -5
index 0b8174a79993..d3b9818dd880 100644
@@ -781,7 +781,7 @@ static int __init pmac_add_bridge(struct device_node *dev)
 	struct resource rsrc;
 	char *disp_name;
 	const int *bus_range;
-	int primary = 1, has_address = 0;
+	int primary = 1, has_address __maybe_unused = 0;
 
 	DBG("Adding PCI host bridge %pOF\n", dev);
 
@@ -904,7 +904,7 @@ static int pmac_pci_root_bridge_prepare(struct pci_host_bridge *bridge)
 void __init pmac_pci_init(void)
 {
 	struct device_node *np, *root;
-	struct device_node *ht = NULL;
+	struct device_node *ht __maybe_unused = NULL;
 
 	pci_set_flags(PCI_CAN_SKIP_ISA_ALIGN);
 
@@ -1019,7 +1019,7 @@ static bool pmac_pci_enable_device_hook(struct pci_dev *dev)
 	return true;
 }
 
-void pmac_pci_fixup_ohci(struct pci_dev *dev)
+static void pmac_pci_fixup_ohci(struct pci_dev *dev)
 {
 	struct device_node *node = pci_device_to_OF_node(dev);
 
@@ -1054,7 +1054,7 @@ void __init pmac_pcibios_after_init(void)
 	}
 }
 
-void pmac_pci_fixup_cardbus(struct pci_dev* dev)
+static void pmac_pci_fixup_cardbus(struct pci_dev *dev)
 {
 	if (!machine_is(powermac))
 		return;
@@ -1091,7 +1091,7 @@ void pmac_pci_fixup_cardbus(struct pci_dev* dev)
 
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_TI, PCI_ANY_ID, pmac_pci_fixup_cardbus);
 
-void pmac_pci_fixup_pciata(struct pci_dev* dev)
+static void pmac_pci_fixup_pciata(struct pci_dev *dev)
 {
        u8 progif = 0;
 
Signature · 1 line
2.11.0
#42 lore raw

Re: [PATCH 07/19] powerpc/powermac: Make some functions static

Le 22/03/2018 à 21:19, Mathieu Malaterre a écrit :

Quoted 22 lines

These functions can all be static, make it so. Fix warnings treated as errors with W=1:

arch/powerpc/platforms/powermac/pci.c:1022:6: error: no previous prototype for ‘pmac_pci_fixup_ohci’ [-Werror=missing-prototypes] arch/powerpc/platforms/powermac/pci.c:1057:6: error: no previous prototype for ‘pmac_pci_fixup_cardbus’ [-Werror=missing-prototypes] arch/powerpc/platforms/powermac/pci.c:1094:6: error: no previous prototype for ‘pmac_pci_fixup_pciata’ [-Werror=missing-prototypes]

Also add gcc attribute unused to fix a warning treated as error with W=1:

arch/powerpc/platforms/powermac/pci.c:784:19: error: variable ‘has_address’ set but not used [-Werror=unused-but-set-variable] arch/powerpc/platforms/powermac/pci.c:907:22: error: variable ‘ht’ set but not used [-Werror=unused-but-set-variable]

---
  arch/powerpc/platforms/powermac/pci.c | 10 +++++-----
  1 file changed, 5 insertions(+), 5 deletions(-)
arch/powerpc/platforms/powermac/pci.c +0 -0
index 0b8174a79993..d3b9818dd880 100644

arch/powerpc/platforms/powermac/pci.c static int __init pmac_add_bridge(struct device_node *dev) · line 784

Quoted 5 lines
arch/powerpc/platforms/powermac/pci.c +1 -1
@@ -781,7 +781,7 @@ static int __init pmac_add_bridge(struct device_node *dev)
  	struct resource rsrc;
  	char *disp_name;
  	const int *bus_range;
-	int primary = 1, has_address = 0;
+	int primary = 1, has_address __maybe_unused = 0;

YOu could remove it completely, it is never used

arch/powerpc/platforms/powermac/pci.c static int pmac_pci_root_bridge_prepare(struct pci_host_bridge *bridge) · line 907

Quoted 9 lines
arch/powerpc/platforms/powermac/pci.c +1 -1
  	DBG("Adding PCI host bridge %pOF\n", dev);
 
@@ -904,7 +904,7 @@ static int pmac_pci_root_bridge_prepare(struct pci_host_bridge *bridge)
  void __init pmac_pci_init(void)
  {
  	struct device_node *np, *root;
-	struct device_node *ht = NULL;
+	struct device_node *ht __maybe_unused = NULL;

Shouldn't ht be enclosed into #ifdef CONFIG_PPC64 instead ?

Christophe

Quoted 23 lines
arch/powerpc/platforms/powermac/pci.c +2 -2
  	pci_set_flags(PCI_CAN_SKIP_ISA_ALIGN);
 
@@ -1019,7 +1019,7 @@ static bool pmac_pci_enable_device_hook(struct pci_dev *dev)
  	return true;
  }
 
-void pmac_pci_fixup_ohci(struct pci_dev *dev)
+static void pmac_pci_fixup_ohci(struct pci_dev *dev)
  {
  	struct device_node *node = pci_device_to_OF_node(dev);
 
@@ -1054,7 +1054,7 @@ void __init pmac_pcibios_after_init(void)
  	}
  }
 
-void pmac_pci_fixup_cardbus(struct pci_dev* dev)
+static void pmac_pci_fixup_cardbus(struct pci_dev *dev)
  {
  	if (!machine_is(powermac))
  		return;

arch/powerpc/platforms/powermac/pci.c void pmac_pci_fixup_cardbus(struct pci_dev* dev) · line 1097

Quoted 8 lines
arch/powerpc/platforms/powermac/pci.c +1 -1
@@ -1091,7 +1091,7 @@ void pmac_pci_fixup_cardbus(struct pci_dev* dev)
 
  DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_TI, PCI_ANY_ID, pmac_pci_fixup_cardbus);
 
-void pmac_pci_fixup_pciata(struct pci_dev* dev)
+static void pmac_pci_fixup_pciata(struct pci_dev *dev)
  {
         u8 progif = 0;
 

---
L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast.
https://www.avast.com/antivirus

#43 lore raw

PATCH v2 7/19 powerpc/powermac: Make some functions static

In reply to Mathieu Malaterre

These functions can all be static, make it so. Fix warnings treated as errors with W=1:

arch/powerpc/platforms/powermac/pci.c:1022:6: error: no previous prototype for ‘pmac_pci_fixup_ohci’ [-Werror=missing-prototypes] arch/powerpc/platforms/powermac/pci.c:1057:6: error: no previous prototype for ‘pmac_pci_fixup_cardbus’ [-Werror=missing-prototypes] arch/powerpc/platforms/powermac/pci.c:1094:6: error: no previous prototype for ‘pmac_pci_fixup_pciata’ [-Werror=missing-prototypes]

Remove has_address declaration and assignment since not used. Also add gcc attribute unused to fix a warning treated as error with W=1:

arch/powerpc/platforms/powermac/pci.c:784:19: error: variable ‘has_address’ set but not used [-Werror=unused-but-set-variable] arch/powerpc/platforms/powermac/pci.c:907:22: error: variable ‘ht’ set but not used [-Werror=unused-but-set-variable]

---
v2: remove has_address variable since not used

 arch/powerpc/platforms/powermac/pci.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
arch/powerpc/platforms/powermac/pci.c +6 -6
index 0b8174a79993..67c497093e0a 100644
@@ -781,12 +781,12 @@ static int __init pmac_add_bridge(struct device_node *dev)
 	struct resource rsrc;
 	char *disp_name;
 	const int *bus_range;
-	int primary = 1, has_address = 0;
+	int primary = 1;
 
 	DBG("Adding PCI host bridge %pOF\n", dev);
 
 	/* Fetch host bridge registers address */
-	has_address = (of_address_to_resource(dev, 0, &rsrc) == 0);
+	of_address_to_resource(dev, 0, &rsrc);
 
 	/* Get bus range if any */
 	bus_range = of_get_property(dev, "bus-range", &len);
@@ -904,7 +904,7 @@ static int pmac_pci_root_bridge_prepare(struct pci_host_bridge *bridge)
 void __init pmac_pci_init(void)
 {
 	struct device_node *np, *root;
-	struct device_node *ht = NULL;
+	struct device_node *ht __maybe_unused = NULL;
 
 	pci_set_flags(PCI_CAN_SKIP_ISA_ALIGN);
 
@@ -1019,7 +1019,7 @@ static bool pmac_pci_enable_device_hook(struct pci_dev *dev)
 	return true;
 }
 
-void pmac_pci_fixup_ohci(struct pci_dev *dev)
+static void pmac_pci_fixup_ohci(struct pci_dev *dev)
 {
 	struct device_node *node = pci_device_to_OF_node(dev);
 
@@ -1054,7 +1054,7 @@ void __init pmac_pcibios_after_init(void)
 	}
 }
 
-void pmac_pci_fixup_cardbus(struct pci_dev* dev)
+static void pmac_pci_fixup_cardbus(struct pci_dev *dev)
 {
 	if (!machine_is(powermac))
 		return;
@@ -1091,7 +1091,7 @@ void pmac_pci_fixup_cardbus(struct pci_dev* dev)
 
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_TI, PCI_ANY_ID, pmac_pci_fixup_cardbus);
 
-void pmac_pci_fixup_pciata(struct pci_dev* dev)
+static void pmac_pci_fixup_pciata(struct pci_dev *dev)
 {
        u8 progif = 0;
 
Signature · 1 line
2.11.0
#44 lore raw

Re: [PATCH v2 07/19] powerpc/powermac: Make some functions static

This one should also be good to go.

Quoted 5 lines · Mathieu Malaterre

These functions can all be static, make it so. Fix warnings treated as errors with W=3D1:

arch/powerpc/platforms/powermac/pci.c:1022:6: error: no previous protot=

ype for =E2=80=98pmac_pci_fixup_ohci=E2=80=99 [-Werror=3Dmissing-prototypes= ]

Quoted 1 line

arch/powerpc/platforms/powermac/pci.c:1057:6: error: no previous protot=

ype for =E2=80=98pmac_pci_fixup_cardbus=E2=80=99 [-Werror=3Dmissing-prototy= pes]

Quoted 1 line

arch/powerpc/platforms/powermac/pci.c:1094:6: error: no previous protot=

ype for =E2=80=98pmac_pci_fixup_pciata=E2=80=99 [-Werror=3Dmissing-prototyp= es]

Quoted 2 lines

Remove has_address declaration and assignment since not used. Also add gc=

c

Quoted 3 lines

attribute unused to fix a warning treated as error with W=3D1:

arch/powerpc/platforms/powermac/pci.c:784:19: error: variable =E2=80=98=

has_address=E2=80=99 set but not used [-Werror=3Dunused-but-set-variable]

Quoted 1 line

arch/powerpc/platforms/powermac/pci.c:907:22: error: variable =E2=80=98=

ht=E2=80=99 set but not used [-Werror=3Dunused-but-set-variable]

arch/powerpc/platfor=

Quoted 9 lines

---
v2: remove has_address variable since not used

 arch/powerpc/platforms/powermac/pci.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
arch/powerpc/platfor= renamed from arch/powerpc/platforms/powermac/pci.c +0 -0

ms/powermac/pci.c

arch/powerpc/platforms/powermac/pci.c static int __init pmac_add_bridge(struct device_nod=

Quoted 4 lines

index 0b8174a79993..67c497093e0a 100644

arch/powerpc/platforms/powermac/pci.c +0 -0
@@ -781,12 +781,12 @@ static int __init pmac_add_bridge(struct device_nod=

e *dev)

arch/powerpc/platforms/powermac/pci.c static int pmac_pci_root_bridge_prepare(struct pci_ho=

Quoted 15 lines
arch/powerpc/platforms/powermac/pci.c +2 -2
        struct resource rsrc;
        char *disp_name;
        const int *bus_range;
-       int primary =3D 1, has_address =3D 0;
+       int primary =3D 1;
 
        DBG("Adding PCI host bridge %pOF\n", dev);
 
        /* Fetch host bridge registers address */
-       has_address =3D (of_address_to_resource(dev, 0, &rsrc) =3D=3D 0);
+       of_address_to_resource(dev, 0, &rsrc);
 
        /* Get bus range if any */
        bus_range =3D of_get_property(dev, "bus-range", &len);
@@ -904,7 +904,7 @@ static int pmac_pci_root_bridge_prepare(struct pci_ho=

st_bridge *bridge)

arch/powerpc/platforms/powermac/pci.c static bool pmac_pci_enable_device_hook(struct pci_=

Quoted 9 lines
arch/powerpc/platforms/powermac/pci.c +1 -1
 void __init pmac_pci_init(void)
 {
        struct device_node *np, *root;
-       struct device_node *ht =3D NULL;
+       struct device_node *ht __maybe_unused =3D NULL;
 
        pci_set_flags(PCI_CAN_SKIP_ISA_ALIGN);
 
@@ -1019,7 +1019,7 @@ static bool pmac_pci_enable_device_hook(struct pci_=

dev *dev)

Quoted 18 lines
arch/powerpc/platforms/powermac/pci.c +2 -2
        return true;
 }
 
-void pmac_pci_fixup_ohci(struct pci_dev *dev)
+static void pmac_pci_fixup_ohci(struct pci_dev *dev)
 {
        struct device_node *node =3D pci_device_to_OF_node(dev);
 
@@ -1054,7 +1054,7 @@ void __init pmac_pcibios_after_init(void)
        }
 }
 
-void pmac_pci_fixup_cardbus(struct pci_dev* dev)
+static void pmac_pci_fixup_cardbus(struct pci_dev *dev)
 {
        if (!machine_is(powermac))
                return;

arch/powerpc/platforms/powermac/pci.c void pmac_pci_fixup_cardbus(struct pci_dev* dev) · line 1092

Quoted 2 lines
arch/powerpc/platforms/powermac/pci.c +0 -0
@@ -1091,7 +1091,7 @@ void pmac_pci_fixup_cardbus(struct pci_dev* dev)
 
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_TI, PCI_ANY_ID, pmac_pci_fixup_car=

dbus);

Quoted 9 lines
arch/powerpc/platforms/powermac/pci.c +1 -2
-void pmac_pci_fixup_pciata(struct pci_dev* dev)
+static void pmac_pci_fixup_pciata(struct pci_dev *dev)
 {
        u8 progif =3D 0;
 
--

2.11.0

#45 lore raw

Re: [v2,07/19] powerpc/powermac: Make some functions static

In reply to Mathieu Malaterre
Quoted 7 lines · Mathieu Malaterre

These functions can all be static, make it so. Fix warnings treated as errors with W=1:

arch/powerpc/platforms/powermac/pci.c:1022:6: error: no previous prototype for ‘pmac_pci_fixup_ohci’ [-Werror=missing-prototypes] arch/powerpc/platforms/powermac/pci.c:1057:6: error: no previous prototype for ‘pmac_pci_fixup_cardbus’ [-Werror=missing-prototypes] arch/powerpc/platforms/powermac/pci.c:1094:6: error: no previous prototype for ‘pmac_pci_fixup_pciata’ [-Werror=missing-prototypes]

Quoted 8 lines

Remove has_address declaration and assignment since not used. Also add gcc attribute unused to fix a warning treated as error with W=1:

arch/powerpc/platforms/powermac/pci.c:784:19: error: variable ‘has_address’ set but not used [-Werror=unused-but-set-variable] arch/powerpc/platforms/powermac/pci.c:907:22: error: variable ‘ht’ set but not used [-Werror=unused-but-set-variable]

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/618a89d738fdd97f6fc58b7b666c7a

cheers

#46 lore raw

PATCH 8/19 powerpc/tau: Make some function static

In reply to Mathieu Malaterre

These functions can all be static, make it so. Fix warnings treated as errors with W=1:

arch/powerpc/kernel/tau_6xx.c:53:6: error: no previous prototype for ‘set_thresholds’ [-Werror=missing-prototypes] arch/powerpc/kernel/tau_6xx.c:73:6: error: no previous prototype for ‘TAUupdate’ [-Werror=missing-prototypes] arch/powerpc/kernel/tau_6xx.c:208:13: error: no previous prototype for ‘TAU_init_smp’ [-Werror=missing-prototypes] arch/powerpc/kernel/tau_6xx.c:220:12: error: no previous prototype for ‘TAU_init’ [-Werror=missing-prototypes] arch/powerpc/kernel/tau_6xx.c:126:6: error: no previous prototype for ‘TAUException’ [-Werror=missing-prototypes]

---
 arch/powerpc/kernel/tau_6xx.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
arch/powerpc/kernel/tau_6xx.c +4 -4
index 8cdd852aedd1..1fc6a89a978e 100644
@@ -50,7 +50,7 @@ struct timer_list tau_timer;
 #define shrink_timer	2*HZ	/* period between shrinking the window */
 #define min_window	2	/* minimum window size, degrees C */
 
-void set_thresholds(unsigned long cpu)
+static void set_thresholds(unsigned long cpu)
 {
 #ifdef CONFIG_TAU_INT
 	/*
@@ -70,7 +70,7 @@ void set_thresholds(unsigned long cpu)
 #endif
 }
 
-void TAUupdate(int cpu)
+static void TAUupdate(int cpu)
 {
 	unsigned thrm;
 
@@ -205,7 +205,7 @@ static void tau_timeout_smp(struct timer_list *unused)
 
 int tau_initialized = 0;
 
-void __init TAU_init_smp(void * info)
+static void __init TAU_init_smp(void *info)
 {
 	unsigned long cpu = smp_processor_id();
 
@@ -217,7 +217,7 @@ void __init TAU_init_smp(void * info)
 	set_thresholds(cpu);
 }
 
-int __init TAU_init(void)
+static int __init TAU_init(void)
 {
 	/* We assume in SMP that if one CPU has TAU support, they
 	 * all have it --BenH
Signature · 1 line
2.11.0
#47 lore raw

Re: [08/19] powerpc/tau: Make some function static

Quoted 10 lines · Mathieu Malaterre

These functions can all be static, make it so. Fix warnings treated as errors with W=1:

arch/powerpc/kernel/tau_6xx.c:53:6: error: no previous prototype for ‘set_thresholds’ [-Werror=missing-prototypes] arch/powerpc/kernel/tau_6xx.c:73:6: error: no previous prototype for ‘TAUupdate’ [-Werror=missing-prototypes] arch/powerpc/kernel/tau_6xx.c:208:13: error: no previous prototype for ‘TAU_init_smp’ [-Werror=missing-prototypes] arch/powerpc/kernel/tau_6xx.c:220:12: error: no previous prototype for ‘TAU_init’ [-Werror=missing-prototypes] arch/powerpc/kernel/tau_6xx.c:126:6: error: no previous prototype for ‘TAUException’ [-Werror=missing-prototypes]

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/9e0d86cd2d749998c3792059221cef

cheers

#48 lore raw

PATCH 9/19 powerpc/chrp/pci: Make some functions static

In reply to Mathieu Malaterre

These functions can all be static, make it so. Fix warnings treated as errors with W=1:

arch/powerpc/platforms/chrp/pci.c:34:5: error: no previous prototype for ‘gg2_read_config’ [-Werror=missing-prototypes] arch/powerpc/platforms/chrp/pci.c:61:5: error: no previous prototype for ‘gg2_write_config’ [-Werror=missing-prototypes] arch/powerpc/platforms/chrp/pci.c:97:5: error: no previous prototype for ‘rtas_read_config’ [-Werror=missing-prototypes] arch/powerpc/platforms/chrp/pci.c:112:5: error: no previous prototype for ‘rtas_write_config’ [-Werror=missing-prototypes]

---
 arch/powerpc/platforms/chrp/pci.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
arch/powerpc/platforms/chrp/pci.c +4 -4
index 0f512d35f7c5..84e1fedb3796 100644
@@ -31,7 +31,7 @@ void __iomem *gg2_pci_config_base;
  * limit the bus number to 3 bits
  */
 
-int gg2_read_config(struct pci_bus *bus, unsigned int devfn, int off,
+static int gg2_read_config(struct pci_bus *bus, unsigned int devfn, int off,
 			   int len, u32 *val)
 {
 	volatile void __iomem *cfg_data;
@@ -58,7 +58,7 @@ int gg2_read_config(struct pci_bus *bus, unsigned int devfn, int off,
 	return PCIBIOS_SUCCESSFUL;
 }
 
-int gg2_write_config(struct pci_bus *bus, unsigned int devfn, int off,
+static int gg2_write_config(struct pci_bus *bus, unsigned int devfn, int off,
 			    int len, u32 val)
 {
 	volatile void __iomem *cfg_data;
@@ -94,7 +94,7 @@ static struct pci_ops gg2_pci_ops  /*
  * Access functions for PCI config space using RTAS calls.
  */
-int rtas_read_config(struct pci_bus *bus, unsigned int devfn, int offset,
+static int rtas_read_config(struct pci_bus *bus, unsigned int devfn, int offset,
 		     int len, u32 *val)
 {
 	struct pci_controller *hose = pci_bus_to_host(bus);
@@ -109,7 +109,7 @@ int rtas_read_config(struct pci_bus *bus, unsigned int devfn, int offset,
 	return rval? PCIBIOS_DEVICE_NOT_FOUND: PCIBIOS_SUCCESSFUL;
 }
 
-int rtas_write_config(struct pci_bus *bus, unsigned int devfn, int offset,
+static int rtas_write_config(struct pci_bus *bus, unsigned int devfn, int offset,
 		      int len, u32 val)
 {
 	struct pci_controller *hose = pci_bus_to_host(bus);
Signature · 1 line
2.11.0
#49 lore raw

PATCH v3 9/19 powerpc/chrp/pci: Make some functions static

These functions can all be static, make it so. Fix warnings treated as errors with W=1:

arch/powerpc/platforms/chrp/pci.c:34:5: error: no previous prototype for ‘gg2_read_config’ [-Werror=missing-prototypes] arch/powerpc/platforms/chrp/pci.c:61:5: error: no previous prototype for ‘gg2_write_config’ [-Werror=missing-prototypes] arch/powerpc/platforms/chrp/pci.c:97:5: error: no previous prototype for ‘rtas_read_config’ [-Werror=missing-prototypes] arch/powerpc/platforms/chrp/pci.c:112:5: error: no previous prototype for ‘rtas_write_config’ [-Werror=missing-prototypes]

---
v3: style: fix alignement issue (checkpatch --strict)
v2: no change

 arch/powerpc/platforms/chrp/pci.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
arch/powerpc/platforms/chrp/pci.c +6 -6
index 0f512d35f7c5..5ddb57b82921 100644
@@ -31,7 +31,7 @@ void __iomem *gg2_pci_config_base;
  * limit the bus number to 3 bits
  */
 
-int gg2_read_config(struct pci_bus *bus, unsigned int devfn, int off,
+static int gg2_read_config(struct pci_bus *bus, unsigned int devfn, int off,
 			   int len, u32 *val)
 {
 	volatile void __iomem *cfg_data;
@@ -58,7 +58,7 @@ int gg2_read_config(struct pci_bus *bus, unsigned int devfn, int off,
 	return PCIBIOS_SUCCESSFUL;
 }
 
-int gg2_write_config(struct pci_bus *bus, unsigned int devfn, int off,
+static int gg2_write_config(struct pci_bus *bus, unsigned int devfn, int off,
 			    int len, u32 val)
 {
 	volatile void __iomem *cfg_data;
@@ -94,8 +94,8 @@ static struct pci_ops gg2_pci_ops =
 /*
  * Access functions for PCI config space using RTAS calls.
  */
-int rtas_read_config(struct pci_bus *bus, unsigned int devfn, int offset,
-		     int len, u32 *val)
+static int rtas_read_config(struct pci_bus *bus, unsigned int devfn, int offset,
+			    int len, u32 *val)
 {
 	struct pci_controller *hose = pci_bus_to_host(bus);
 	unsigned long addr = (offset & 0xff) | ((devfn & 0xff) << 8)
@@ -109,8 +109,8 @@ int rtas_read_config(struct pci_bus *bus, unsigned int devfn, int offset,
 	return rval? PCIBIOS_DEVICE_NOT_FOUND: PCIBIOS_SUCCESSFUL;
 }
 
-int rtas_write_config(struct pci_bus *bus, unsigned int devfn, int offset,
-		      int len, u32 val)
+static int rtas_write_config(struct pci_bus *bus, unsigned int devfn, int offset,
+			     int len, u32 val)
 {
 	struct pci_controller *hose = pci_bus_to_host(bus);
 	unsigned long addr = (offset & 0xff) | ((devfn & 0xff) << 8)
Signature · 1 line
2.11.0
#50 lore raw

Re: [v3,09/19] powerpc/chrp/pci: Make some functions static

Quoted 9 lines · Mathieu Malaterre

These functions can all be static, make it so. Fix warnings treated as errors with W=1:

arch/powerpc/platforms/chrp/pci.c:34:5: error: no previous prototype for ‘gg2_read_config’ [-Werror=missing-prototypes] arch/powerpc/platforms/chrp/pci.c:61:5: error: no previous prototype for ‘gg2_write_config’ [-Werror=missing-prototypes] arch/powerpc/platforms/chrp/pci.c:97:5: error: no previous prototype for ‘rtas_read_config’ [-Werror=missing-prototypes] arch/powerpc/platforms/chrp/pci.c:112:5: error: no previous prototype for ‘rtas_write_config’ [-Werror=missing-prototypes]

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/910be6be6c00e6d33d47985586c392

cheers

#51 lore raw

PATCH 10/19 powerpc/chrp/time: Make some functions static, add missing header include

In reply to Mathieu Malaterre

Add a missing include <platforms/chrp/chrp.h>.

These functions can all be static, make it so. Fix warnings treated as errors with W=1:

arch/powerpc/platforms/chrp/time.c:41:13: error: no previous prototype for ‘chrp_time_init’ [-Werror=missing-prototypes] arch/powerpc/platforms/chrp/time.c:66:5: error: no previous prototype for ‘chrp_cmos_clock_read’ [-Werror=missing-prototypes] arch/powerpc/platforms/chrp/time.c:74:6: error: no previous prototype for ‘chrp_cmos_clock_write’ [-Werror=missing-prototypes] arch/powerpc/platforms/chrp/time.c:86:5: error: no previous prototype for ‘chrp_set_rtc_time’ [-Werror=missing-prototypes] arch/powerpc/platforms/chrp/time.c:130:6: error: no previous prototype for ‘chrp_get_rtc_time’ [-Werror=missing-prototypes]

---
 arch/powerpc/platforms/chrp/time.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
arch/powerpc/platforms/chrp/time.c +4 -2
index 03d115aaa191..acde7bbe0716 100644
@@ -28,6 +28,8 @@
 #include <asm/sections.h>
 #include <asm/time.h>
 
+#include <platforms/chrp/chrp.h>
+
 extern spinlock_t rtc_lock;
 
 #define NVRAM_AS0  0x74
@@ -63,7 +65,7 @@ long __init chrp_time_init(void)
 	return 0;
 }
 
-int chrp_cmos_clock_read(int addr)
+static int chrp_cmos_clock_read(int addr)
 {
 	if (nvram_as1 != 0)
 		outb(addr>>8, nvram_as1);
@@ -71,7 +73,7 @@ int chrp_cmos_clock_read(int addr)
 	return (inb(nvram_data));
 }
 
-void chrp_cmos_clock_write(unsigned long val, int addr)
+static void chrp_cmos_clock_write(unsigned long val, int addr)
 {
 	if (nvram_as1 != 0)
 		outb(addr>>8, nvram_as1);
Signature · 1 line
2.11.0
#52 lore raw

Re: [10/19] powerpc/chrp/time: Make some functions static, add missing header include

Quoted 5 lines · Mathieu Malaterre

Add a missing include <platforms/chrp/chrp.h>.

These functions can all be static, make it so. Fix warnings treated as errors with W=1:

Quoted 7 lines

arch/powerpc/platforms/chrp/time.c:41:13: error: no previous prototype for ‘chrp_time_init’ [-Werror=missing-prototypes] arch/powerpc/platforms/chrp/time.c:66:5: error: no previous prototype for ‘chrp_cmos_clock_read’ [-Werror=missing-prototypes] arch/powerpc/platforms/chrp/time.c:74:6: error: no previous prototype for ‘chrp_cmos_clock_write’ [-Werror=missing-prototypes] arch/powerpc/platforms/chrp/time.c:86:5: error: no previous prototype for ‘chrp_set_rtc_time’ [-Werror=missing-prototypes] arch/powerpc/platforms/chrp/time.c:130:6: error: no previous prototype for ‘chrp_get_rtc_time’ [-Werror=missing-prototypes]

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/b87a358b4a1421abd544c0b554b1b7

cheers

#53 lore raw

PATCH 11/19 powerpc/powermac: Move pmac_pfunc_base_install prototype to header file

In reply to Mathieu Malaterre

The pmac_pfunc_base_install prototype was declared in powermac/smp.c since function was used there, move it to pmac_pfunc.h header to be visible in pfunc_base.c. Fix a warning treated as error with W=1:

arch/powerpc/platforms/powermac/pfunc_base.c:330:12: error: no previous prototype for ‘pmac_pfunc_base_install’ [-Werror=missing-prototypes]

---
 arch/powerpc/include/asm/pmac_pfunc.h | 1 +
 arch/powerpc/platforms/powermac/smp.c | 1 -
 2 files changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/include/asm/pmac_pfunc.h +1 -0
index 73bd8f28f2a8..99f7a288789a 100644
@@ -245,6 +245,7 @@ extern void pmf_put_function(struct pmf_function *func);
 
 extern int pmf_call_one(struct pmf_function *func, struct pmf_args *args);
 
+extern int pmac_pfunc_base_install(void);
 
 /* Suspend/resume code called by via-pmu directly for now */
 extern void pmac_pfunc_base_suspend(void);
arch/powerpc/platforms/powermac/smp.c +0 -1
index 95275e0e2efa..447da6db450a 100644
@@ -65,7 +65,6 @@
 #endif
 
 extern void __secondary_start_pmac_0(void);
-extern int pmac_pfunc_base_install(void);
 
 static void (*pmac_tb_freeze)(int freeze);
 static u64 timebase;
Signature · 1 line
2.11.0
#54 lore raw

Re: [PATCH 11/19] powerpc/powermac: Move pmac_pfunc_base_install prototype to header file

Le 22/03/2018 à 21:19, Mathieu Malaterre a écrit :

Quoted 17 lines

The pmac_pfunc_base_install prototype was declared in powermac/smp.c since function was used there, move it to pmac_pfunc.h header to be visible in pfunc_base.c. Fix a warning treated as error with W=1:

arch/powerpc/platforms/powermac/pfunc_base.c:330:12: error: no previous prototype for ‘pmac_pfunc_base_install’ [-Werror=missing-prototypes]

---
  arch/powerpc/include/asm/pmac_pfunc.h | 1 +
  arch/powerpc/platforms/powermac/smp.c | 1 -
  2 files changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/include/asm/pmac_pfunc.h +0 -0
index 73bd8f28f2a8..99f7a288789a 100644

arch/powerpc/include/asm/pmac_pfunc.h extern void pmf_put_function(struct pmf_function *func); · line 248

Quoted 4 lines
arch/powerpc/include/asm/pmac_pfunc.h +1 -0
@@ -245,6 +245,7 @@ extern void pmf_put_function(struct pmf_function *func);
 
  extern int pmf_call_one(struct pmf_function *func, struct pmf_args *args);
 
+extern int pmac_pfunc_base_install(void);

extern keyword is not needed

Christophe

Quoted 9 lines
arch/powerpc/include/asm/pmac_pfunc.h +0 -0
  /* Suspend/resume code called by via-pmu directly for now */
  extern void pmac_pfunc_base_suspend(void);
arch/powerpc/platforms/powermac/smp.c +0 -0
index 95275e0e2efa..447da6db450a 100644

arch/powerpc/platforms/powermac/smp.c line 70

Quoted 7 lines
arch/powerpc/platforms/powermac/smp.c +0 -1
@@ -65,7 +65,6 @@
  #endif
 
  extern void __secondary_start_pmac_0(void);
-extern int pmac_pfunc_base_install(void);
 
  static void (*pmac_tb_freeze)(int freeze);
  static u64 timebase;

---
L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast.
https://www.avast.com/antivirus

#55 lore raw

Re: [PATCH 11/19] powerpc/powermac: Move pmac_pfunc_base_install prototype to header file

Quoted 5 lines · christophe leroy

Le 22/03/2018 =C3=A0 21:19, Mathieu Malaterre a =C3=A9crit :

Quoted 2 lines

The pmac_pfunc_base_install prototype was declared in powermac/smp.c sin=

ce

Quoted 4 lines
Quoted 4 lines

function was used there, move it to pmac_pfunc.h header to be visible in pfunc_base.c. Fix a warning treated as error with W=3D1:

arch/powerpc/platforms/powermac/pfunc_base.c:330:12: error: no previo=

us

Quoted 1 line
Quoted 1 line

prototype for =E2=80=98pmac_pfunc_base_install=E2=80=99 [-Werror=3Dmissi=

ng-prototypes]

Quoted 7 lines
Quoted 7 lines
---
  arch/powerpc/include/asm/pmac_pfunc.h | 1 +
  arch/powerpc/platforms/powermac/smp.c | 1 -
  2 files changed, 1 insertion(+), 1 deletion(-)
Quoted 14 lines

arch/powerpc/include/asm/pmac_pfunc.h extern void pmf_put_function(struct pmf_function · line 248

Quoted 10 lines
arch/powerpc/include/asm/pmac_pfunc.h +0 -0
index 73bd8f28f2a8..99f7a288789a 100644
@@ -245,6 +245,7 @@ extern void pmf_put_function(struct pmf_function
 *func);
    extern int pmf_call_one(struct pmf_function *func, struct pmf_args
 *args);
  +extern int pmac_pfunc_base_install(void);

extern keyword is not needed

I understand; but for consistency every single protoypes in this header file actually use the extern keyword. Is there a guide/best practice to refer to in this case ?

Quoted 11 lines

Christophe

Quoted 9 lines
arch/powerpc/include/asm/pmac_pfunc.h +0 -0
    /* Suspend/resume code called by via-pmu directly for now */
  extern void pmac_pfunc_base_suspend(void);
arch/powerpc/platforms/powermac/smp.c +0 -0
index 95275e0e2efa..447da6db450a 100644
@@ -65,7 +65,6 @@
  #endif
Quoted 8 lines

arch/powerpc/platforms/powermac/smp.c

Quoted 5 lines
arch/powerpc/platforms/powermac/smp.c +0 -1
    extern void __secondary_start_pmac_0(void);
-extern int pmac_pfunc_base_install(void);
    static void (*pmac_tb_freeze)(int freeze);
  static u64 timebase;
 

---
L'absence de virus dans ce courrier =C3=A9lectronique a =C3=A9t=C3=A9 v=

=C3=A9rifi=C3=A9e par le

Quoted 3 lines

logiciel antivirus Avast.
https://www.avast.com/antivirus

#56 lore raw

Re: [PATCH 11/19] powerpc/powermac: Move pmac_pfunc_base_install prototype to header file

Mathieu Malaterre <[email protected]> a écrit :

Quoted 34 lines
Quoted 17 lines · christophe leroy
Quoted 14 lines · Mathieu Malaterre

The pmac_pfunc_base_install prototype was declared in powermac/smp.c since function was used there, move it to pmac_pfunc.h header to be visible in pfunc_base.c. Fix a warning treated as error with W=1:

arch/powerpc/platforms/powermac/pfunc_base.c:330:12: error: no previous
prototype for ‘pmac_pfunc_base_install’ [-Werror=missing-prototypes]

---
  arch/powerpc/include/asm/pmac_pfunc.h | 1 +
  arch/powerpc/platforms/powermac/smp.c | 1 -
  2 files changed, 1 insertion(+), 1 deletion(-)
Quoted 14 lines

arch/powerpc/include/asm/pmac_pfunc.h extern void pmf_put_function(struct pmf_function · line 248

Quoted 10 lines
arch/powerpc/include/asm/pmac_pfunc.h +0 -0
index 73bd8f28f2a8..99f7a288789a 100644
@@ -245,6 +245,7 @@ extern void pmf_put_function(struct pmf_function
 *func);
    extern int pmf_call_one(struct pmf_function *func, struct pmf_args
 *args);
  +extern int pmac_pfunc_base_install(void);

extern keyword is not needed

Quoted 3 lines

I understand; but for consistency every single protoypes in this header file actually use the extern keyword. Is there a guide/best practice to refer to in this case ?

Consistancy is not a valid reason to continue bad practice. Every single modufication is an opportunity to clean things up

You should run script/checkpatch.pl --strict on all your patches before submitting. And follow as much as possible the linux codying style

Christophe

Quoted 23 lines
Quoted 23 lines

Christophe

Quoted 8 lines
arch/powerpc/include/asm/pmac_pfunc.h +0 -0
    /* Suspend/resume code called by via-pmu directly for now */
  extern void pmac_pfunc_base_suspend(void);
arch/powerpc/platforms/powermac/smp.c +0 -0
index 95275e0e2efa..447da6db450a 100644

arch/powerpc/platforms/powermac/smp.c line 69

Quoted 6 lines
arch/powerpc/platforms/powermac/smp.c +0 -1
@@ -65,7 +65,6 @@
  #endif
    extern void __secondary_start_pmac_0(void);
-extern int pmac_pfunc_base_install(void);
    static void (*pmac_tb_freeze)(int freeze);
  static u64 timebase;
 

---
L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast.
https://www.avast.com/antivirus

#57 lore raw

PATCH v3 11/19 powerpc/powermac: Move pmac_pfunc_base_install prototype to header file

In reply to Mathieu Malaterre

The pmac_pfunc_base_install prototype was declared in powermac/smp.c since function was used there, move it to pmac_pfunc.h header to be visible in pfunc_base.c. Fix a warning treated as error with W=1:

arch/powerpc/platforms/powermac/pfunc_base.c:330:12: error: no previous prototype for ‘pmac_pfunc_base_install’ [-Werror=missing-prototypes]

---
v3: remove extern keyword
v2: no change

 arch/powerpc/include/asm/pmac_pfunc.h | 1 +
 arch/powerpc/platforms/powermac/smp.c | 1 -
 2 files changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/include/asm/pmac_pfunc.h +1 -0
index 73bd8f28f2a8..cee4e9f5b8cf 100644
@@ -245,6 +245,7 @@ extern void pmf_put_function(struct pmf_function *func);
 
 extern int pmf_call_one(struct pmf_function *func, struct pmf_args *args);
 
+int pmac_pfunc_base_install(void);
 
 /* Suspend/resume code called by via-pmu directly for now */
 extern void pmac_pfunc_base_suspend(void);
arch/powerpc/platforms/powermac/smp.c +0 -1
index 95275e0e2efa..447da6db450a 100644
@@ -65,7 +65,6 @@
 #endif
 
 extern void __secondary_start_pmac_0(void);
-extern int pmac_pfunc_base_install(void);
 
 static void (*pmac_tb_freeze)(int freeze);
 static u64 timebase;
Signature · 1 line
2.11.0
#58 lore raw

Re: [v3, 11/19] powerpc/powermac: Move pmac_pfunc_base_install prototype to header file

Quoted 8 lines · Mathieu Malaterre

The pmac_pfunc_base_install prototype was declared in powermac/smp.c since function was used there, move it to pmac_pfunc.h header to be visible in pfunc_base.c. Fix a warning treated as error with W=1:

arch/powerpc/platforms/powermac/pfunc_base.c:330:12: error: no previous prototype for ‘pmac_pfunc_base_install’ [-Werror=missing-prototypes]

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/f91d5998996819eaf194ff48e00d49

cheers

#59 lore raw

PATCH 12/19 powerpc/powermac: Add missing prototype for note_bootable_part()

In reply to Mathieu Malaterre

Add a missing prototype for function note_bootable_part to silence a warning treated as error with W=1:

arch/powerpc/platforms/powermac/setup.c:361:12: error: no previous prototype for ‘note_bootable_part’ [-Werror=missing-prototypes]

---
 arch/powerpc/platforms/powermac/setup.c | 1 +
 1 file changed, 1 insertion(+)
arch/powerpc/platforms/powermac/setup.c +1 -0
index ab668cb72263..e3d00f8af441 100644
@@ -352,6 +352,7 @@ static int pmac_late_init(void)
 }
 machine_late_initcall(powermac, pmac_late_init);
 
+extern void note_bootable_part(dev_t dev, int part, int goodness);
 /*
  * This is __ref because we check for "initializing" before
  * touching any of the __init sensitive things and "initializing"
Signature · 1 line
2.11.0
#60 lore raw

Re: [PATCH 12/19] powerpc/powermac: Add missing prototype for note_bootable_part()

Le 22/03/2018 à 21:19, Mathieu Malaterre a écrit :

Quoted 15 lines

Add a missing prototype for function note_bootable_part to silence a warning treated as error with W=1:

arch/powerpc/platforms/powermac/setup.c:361:12: error: no previous prototype for ‘note_bootable_part’ [-Werror=missing-prototypes]

---
  arch/powerpc/platforms/powermac/setup.c | 1 +
  1 file changed, 1 insertion(+)
arch/powerpc/platforms/powermac/setup.c +0 -0
index ab668cb72263..e3d00f8af441 100644

arch/powerpc/platforms/powermac/setup.c static int pmac_late_init(void) · line 355

Quoted 4 lines
arch/powerpc/platforms/powermac/setup.c +1 -0
@@ -352,6 +352,7 @@ static int pmac_late_init(void)
  }
  machine_late_initcall(powermac, pmac_late_init);
 
+extern void note_bootable_part(dev_t dev, int part, int goodness);

extern keyword is not needed

Christophe

arch/powerpc/platforms/powermac/setup.c static int pmac_late_init(void) · line 358

Quoted 4 lines
arch/powerpc/platforms/powermac/setup.c +0 -0
  /*
   * This is __ref because we check for "initializing" before
   * touching any of the __init sensitive things and "initializing"

---
L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast.
https://www.avast.com/antivirus

#61 lore raw

PATCH v3 12/19 powerpc/powermac: Add missing prototype for note_bootable_part()

In reply to Mathieu Malaterre

Add a missing prototype for function note_bootable_part to silence a warning treated as error with W=1:

arch/powerpc/platforms/powermac/setup.c:361:12: error: no previous prototype for ‘note_bootable_part’ [-Werror=missing-prototypes]

---
v3: remove extern keyword
v2: no change

 arch/powerpc/platforms/powermac/setup.c | 1 +
 1 file changed, 1 insertion(+)
arch/powerpc/platforms/powermac/setup.c +1 -0
index ab668cb72263..8b2eab1340f4 100644
@@ -352,6 +352,7 @@ static int pmac_late_init(void)
 }
 machine_late_initcall(powermac, pmac_late_init);
 
+void note_bootable_part(dev_t dev, int part, int goodness);
 /*
  * This is __ref because we check for "initializing" before
  * touching any of the __init sensitive things and "initializing"
Signature · 1 line
2.11.0
#62 lore raw

Re: [v3, 12/19] powerpc/powermac: Add missing prototype for note_bootable_part()

Quoted 7 lines · Mathieu Malaterre

Add a missing prototype for function note_bootable_part to silence a warning treated as error with W=1:

arch/powerpc/platforms/powermac/setup.c:361:12: error: no previous prototype for ‘note_bootable_part’ [-Werror=missing-prototypes]

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/f72cf3f1d49f2c35d6cb682af2e8c9

cheers

#63 lore raw

PATCH 13/19 powerpc/52xx: Add missing functions prototypes

In reply to Mathieu Malaterre

The function prototypes were declared within a #ifdef CONFIG_PPC_LITE5200 block which would prevent them from being visible when compiling mpc52xx_pm.c. Move the prototypes outside of the #ifdef block to fix the following warnings treated as errors with W=1:

arch/powerpc/platforms/52xx/mpc52xx_pm.c:58:5: error: no previous prototype for ‘mpc52xx_pm_prepare’ [-Werror=missing-prototypes] arch/powerpc/platforms/52xx/mpc52xx_pm.c:113:5: error: no previous prototype for ‘mpc52xx_pm_enter’ [-Werror=missing-prototypes] arch/powerpc/platforms/52xx/mpc52xx_pm.c:181:6: error: no previous prototype for ‘mpc52xx_pm_finish’ [-Werror=missing-prototypes]

---
 arch/powerpc/include/asm/mpc52xx.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
arch/powerpc/include/asm/mpc52xx.h +3 -3
index e94cede14522..0f6b3cbb119f 100644
@@ -350,14 +350,14 @@ extern struct mpc52xx_suspend mpc52xx_suspend;
 extern int __init mpc52xx_pm_init(void);
 extern int mpc52xx_set_wakeup_gpio(u8 pin, u8 level);
 
-#ifdef CONFIG_PPC_LITE5200
-extern int __init lite5200_pm_init(void);
-
 /* lite5200 calls mpc5200 suspend functions, so here they are */
 extern int mpc52xx_pm_prepare(void);
 extern int mpc52xx_pm_enter(suspend_state_t);
 extern void mpc52xx_pm_finish(void);
 extern char saved_sram[0x4000]; /* reuse buffer from mpc52xx suspend */
+
+#ifdef CONFIG_PPC_LITE5200
+extern int __init lite5200_pm_init(void);
 #endif
 #endif /* CONFIG_PM */
 
Signature · 1 line
2.11.0
#64 lore raw

Re: [PATCH 13/19] powerpc/52xx: Add missing functions prototypes

Le 22/03/2018 à 21:19, Mathieu Malaterre a écrit :

Quoted 23 lines

The function prototypes were declared within a #ifdef CONFIG_PPC_LITE5200 block which would prevent them from being visible when compiling mpc52xx_pm.c. Move the prototypes outside of the #ifdef block to fix the following warnings treated as errors with W=1:

arch/powerpc/platforms/52xx/mpc52xx_pm.c:58:5: error: no previous prototype for ‘mpc52xx_pm_prepare’ [-Werror=missing-prototypes] arch/powerpc/platforms/52xx/mpc52xx_pm.c:113:5: error: no previous prototype for ‘mpc52xx_pm_enter’ [-Werror=missing-prototypes] arch/powerpc/platforms/52xx/mpc52xx_pm.c:181:6: error: no previous prototype for ‘mpc52xx_pm_finish’ [-Werror=missing-prototypes]

---
  arch/powerpc/include/asm/mpc52xx.h | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)
arch/powerpc/include/asm/mpc52xx.h +0 -1
index e94cede14522..0f6b3cbb119f 100644
@@ -350,14 +350,14 @@ extern struct mpc52xx_suspend mpc52xx_suspend;
  extern int __init mpc52xx_pm_init(void);
  extern int mpc52xx_set_wakeup_gpio(u8 pin, u8 level);
 
-#ifdef CONFIG_PPC_LITE5200

arch/powerpc/include/asm/mpc52xx.h extern struct mpc52xx_suspend mpc52xx_suspend; · line 360

Quoted 10 lines
arch/powerpc/include/asm/mpc52xx.h +3 -2
-extern int __init lite5200_pm_init(void);
-
  /* lite5200 calls mpc5200 suspend functions, so here they are */
  extern int mpc52xx_pm_prepare(void);
  extern int mpc52xx_pm_enter(suspend_state_t);
  extern void mpc52xx_pm_finish(void);
  extern char saved_sram[0x4000]; /* reuse buffer from mpc52xx suspend */
+
+#ifdef CONFIG_PPC_LITE5200
+extern int __init lite5200_pm_init(void);

extern keyword is not needed

Christophe

arch/powerpc/include/asm/mpc52xx.h extern struct mpc52xx_suspend mpc52xx_suspend; · line 363

Quoted 4 lines
arch/powerpc/include/asm/mpc52xx.h +0 -0
  #endif
  #endif /* CONFIG_PM */
 

---
L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast.
https://www.avast.com/antivirus

#65 lore raw

PATCH v3 13/19 powerpc/52xx: Add missing functions prototypes

In reply to Mathieu Malaterre

The function prototypes were declared within a #ifdef CONFIG_PPC_LITE5200 block which would prevent them from being visible when compiling mpc52xx_pm.c. Move the prototypes outside of the #ifdef block to fix the following warnings treated as errors with W=1:

arch/powerpc/platforms/52xx/mpc52xx_pm.c:58:5: error: no previous prototype for ‘mpc52xx_pm_prepare’ [-Werror=missing-prototypes] arch/powerpc/platforms/52xx/mpc52xx_pm.c:113:5: error: no previous prototype for ‘mpc52xx_pm_enter’ [-Werror=missing-prototypes] arch/powerpc/platforms/52xx/mpc52xx_pm.c:181:6: error: no previous prototype for ‘mpc52xx_pm_finish’ [-Werror=missing-prototypes]

---
v3: remove extern keyword
v2: no change

 arch/powerpc/include/asm/mpc52xx.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
arch/powerpc/include/asm/mpc52xx.h +3 -3
index e94cede14522..ce1e0aabaa64 100644
@@ -350,14 +350,14 @@ extern struct mpc52xx_suspend mpc52xx_suspend;
 extern int __init mpc52xx_pm_init(void);
 extern int mpc52xx_set_wakeup_gpio(u8 pin, u8 level);
 
-#ifdef CONFIG_PPC_LITE5200
-extern int __init lite5200_pm_init(void);
-
 /* lite5200 calls mpc5200 suspend functions, so here they are */
 extern int mpc52xx_pm_prepare(void);
 extern int mpc52xx_pm_enter(suspend_state_t);
 extern void mpc52xx_pm_finish(void);
 extern char saved_sram[0x4000]; /* reuse buffer from mpc52xx suspend */
+
+#ifdef CONFIG_PPC_LITE5200
+int __init lite5200_pm_init(void);
 #endif
 #endif /* CONFIG_PM */
 
Signature · 1 line
2.11.0
#66 lore raw

Re: [v3,13/19] powerpc/52xx: Add missing functions prototypes

Quoted 11 lines · Mathieu Malaterre

The function prototypes were declared within a #ifdef CONFIG_PPC_LITE5200 block which would prevent them from being visible when compiling mpc52xx_pm.c. Move the prototypes outside of the #ifdef block to fix the following warnings treated as errors with W=1:

arch/powerpc/platforms/52xx/mpc52xx_pm.c:58:5: error: no previous prototype for ‘mpc52xx_pm_prepare’ [-Werror=missing-prototypes] arch/powerpc/platforms/52xx/mpc52xx_pm.c:113:5: error: no previous prototype for ‘mpc52xx_pm_enter’ [-Werror=missing-prototypes] arch/powerpc/platforms/52xx/mpc52xx_pm.c:181:6: error: no previous prototype for ‘mpc52xx_pm_finish’ [-Werror=missing-prototypes]

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/c3f0515ea1277558e7c0c3240d17c7

cheers

#67 lore raw

PATCH 14/19 powerpc/altivec: Add missing prototypes for altivec

In reply to Mathieu Malaterre

Some functions prototypes were missing for the non-altivec code. Add the missing prototypes directly in xor_vmx, fix warnings treated as errors with W=1:

arch/powerpc/lib/xor_vmx_glue.c:18:6: error: no previous prototype for ‘xor_altivec_2’ [-Werror=missing-prototypes] arch/powerpc/lib/xor_vmx_glue.c:29:6: error: no previous prototype for ‘xor_altivec_3’ [-Werror=missing-prototypes] arch/powerpc/lib/xor_vmx_glue.c:40:6: error: no previous prototype for ‘xor_altivec_4’ [-Werror=missing-prototypes] arch/powerpc/lib/xor_vmx_glue.c:52:6: error: no previous prototype for ‘xor_altivec_5’ [-Werror=missing-prototypes]

---
 arch/powerpc/lib/xor_vmx.h | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
arch/powerpc/lib/xor_vmx.h +14 -0
index 5c2b0839b179..2173e3c84151 100644
@@ -19,3 +19,17 @@ void __xor_altivec_4(unsigned long bytes, unsigned long *v1_in,
 void __xor_altivec_5(unsigned long bytes, unsigned long *v1_in,
 			     unsigned long *v2_in, unsigned long *v3_in,
 			     unsigned long *v4_in, unsigned long *v5_in);
+
+void xor_altivec_2(unsigned long bytes, unsigned long *v1_in,
+			     unsigned long *v2_in);
+
+void xor_altivec_3(unsigned long bytes, unsigned long *v1_in,
+			     unsigned long *v2_in, unsigned long *v3_in);
+
+void xor_altivec_4(unsigned long bytes, unsigned long *v1_in,
+			     unsigned long *v2_in, unsigned long *v3_in,
+			     unsigned long *v4_in);
+
+void xor_altivec_5(unsigned long bytes, unsigned long *v1_in,
+			     unsigned long *v2_in, unsigned long *v3_in,
+			     unsigned long *v4_in, unsigned long *v5_in);
Signature · 1 line
2.11.0
#68 lore raw

Re: [PATCH 14/19] powerpc/altivec: Add missing prototypes for altivec

Le 22/03/2018 à 21:20, Mathieu Malaterre a écrit :

Quoted 19 lines

Some functions prototypes were missing for the non-altivec code. Add the missing prototypes directly in xor_vmx, fix warnings treated as errors with W=1:

arch/powerpc/lib/xor_vmx_glue.c:18:6: error: no previous prototype for ‘xor_altivec_2’ [-Werror=missing-prototypes] arch/powerpc/lib/xor_vmx_glue.c:29:6: error: no previous prototype for ‘xor_altivec_3’ [-Werror=missing-prototypes] arch/powerpc/lib/xor_vmx_glue.c:40:6: error: no previous prototype for ‘xor_altivec_4’ [-Werror=missing-prototypes] arch/powerpc/lib/xor_vmx_glue.c:52:6: error: no previous prototype for ‘xor_altivec_5’ [-Werror=missing-prototypes]

---
  arch/powerpc/lib/xor_vmx.h | 14 ++++++++++++++
  1 file changed, 14 insertions(+)
arch/powerpc/lib/xor_vmx.h +0 -0
index 5c2b0839b179..2173e3c84151 100644

arch/powerpc/lib/xor_vmx.h void __xor_altivec_4(unsigned long bytes, unsigned long *v1_in, · line 25

Quoted 7 lines
arch/powerpc/lib/xor_vmx.h +4 -0
@@ -19,3 +19,17 @@ void __xor_altivec_4(unsigned long bytes, unsigned long *v1_in,
  void __xor_altivec_5(unsigned long bytes, unsigned long *v1_in,
  			     unsigned long *v2_in, unsigned long *v3_in,
  			     unsigned long *v4_in, unsigned long *v5_in);
+
+void xor_altivec_2(unsigned long bytes, unsigned long *v1_in,
+			     unsigned long *v2_in);
+

Only used in one place, should be static instead of adding it in a .h

Same for the other ones.

Christophe

arch/powerpc/lib/xor_vmx.h void __xor_altivec_4(unsigned long bytes, unsigned long *v1_in, · line 35

Quoted 11 lines
arch/powerpc/lib/xor_vmx.h +10 -0
+void xor_altivec_3(unsigned long bytes, unsigned long *v1_in,
+			     unsigned long *v2_in, unsigned long *v3_in);
+
+void xor_altivec_4(unsigned long bytes, unsigned long *v1_in,
+			     unsigned long *v2_in, unsigned long *v3_in,
+			     unsigned long *v4_in);
+
+void xor_altivec_5(unsigned long bytes, unsigned long *v1_in,
+			     unsigned long *v2_in, unsigned long *v3_in,
+			     unsigned long *v4_in, unsigned long *v5_in);

---
L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast.
https://www.avast.com/antivirus

#69 lore raw

Re: [PATCH 14/19] powerpc/altivec: Add missing prototypes for altivec

Quoted 40 lines · christophe leroy
Quoted 25 lines · Mathieu Malaterre

Some functions prototypes were missing for the non-altivec code. Add the missing prototypes directly in xor_vmx, fix warnings treated as errors with
W=1:

arch/powerpc/lib/xor_vmx_glue.c:18:6: error: no previous prototype for
‘xor_altivec_2’ [-Werror=missing-prototypes]
arch/powerpc/lib/xor_vmx_glue.c:29:6: error: no previous prototype for
‘xor_altivec_3’ [-Werror=missing-prototypes]
arch/powerpc/lib/xor_vmx_glue.c:40:6: error: no previous prototype for
‘xor_altivec_4’ [-Werror=missing-prototypes]
arch/powerpc/lib/xor_vmx_glue.c:52:6: error: no previous prototype for
‘xor_altivec_5’ [-Werror=missing-prototypes]

---
  arch/powerpc/lib/xor_vmx.h | 14 ++++++++++++++
  1 file changed, 14 insertions(+)
arch/powerpc/lib/xor_vmx.h +0 -0
index 5c2b0839b179..2173e3c84151 100644

arch/powerpc/lib/xor_vmx.h void __xor_altivec_4(unsigned long bytes, unsigned long · line 25

Quoted 8 lines
arch/powerpc/lib/xor_vmx.h +4 -0
@@ -19,3 +19,17 @@ void __xor_altivec_4(unsigned long bytes, unsigned long
 *v1_in,
  void __xor_altivec_5(unsigned long bytes, unsigned long *v1_in,
                             unsigned long *v2_in, unsigned long *v3_in,
                             unsigned long *v4_in, unsigned long *v5_in);
+
+void xor_altivec_2(unsigned long bytes, unsigned long *v1_in,
+                            unsigned long *v2_in);
+

Only used in one place, should be static instead of adding it in a .h

Quoted 1 line

Same for the other ones.

$ git grep xor_altivec_2
[...]
arch/powerpc/lib/xor_vmx_glue.c:EXPORT_SYMBOL(xor_altivec_2);

Are you sure I can change this function to static ?

Quoted 20 lines

Christophe

arch/powerpc/lib/xor_vmx.h void __xor_altivec_4(unsigned long bytes, unsigned long *v1_in, · line 35

Quoted 11 lines
arch/powerpc/lib/xor_vmx.h +10 -0
+void xor_altivec_3(unsigned long bytes, unsigned long *v1_in,
+                            unsigned long *v2_in, unsigned long *v3_in);
+
+void xor_altivec_4(unsigned long bytes, unsigned long *v1_in,
+                            unsigned long *v2_in, unsigned long *v3_in,
+                            unsigned long *v4_in);
+
+void xor_altivec_5(unsigned long bytes, unsigned long *v1_in,
+                            unsigned long *v2_in, unsigned long *v3_in,
+                            unsigned long *v4_in, unsigned long *v5_in);

---
L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast.
https://www.avast.com/antivirus

#70 lore raw

Re: [PATCH 14/19] powerpc/altivec: Add missing prototypes for altivec

Mathieu Malaterre <[email protected]> a écrit :

Quoted 42 lines
Quoted 40 lines · christophe leroy
Quoted 25 lines · Mathieu Malaterre

Some functions prototypes were missing for the non-altivec code. Add the missing prototypes directly in xor_vmx, fix warnings treated as errors with
W=1:

arch/powerpc/lib/xor_vmx_glue.c:18:6: error: no previous prototype for
‘xor_altivec_2’ [-Werror=missing-prototypes]
arch/powerpc/lib/xor_vmx_glue.c:29:6: error: no previous prototype for
‘xor_altivec_3’ [-Werror=missing-prototypes]
arch/powerpc/lib/xor_vmx_glue.c:40:6: error: no previous prototype for
‘xor_altivec_4’ [-Werror=missing-prototypes]
arch/powerpc/lib/xor_vmx_glue.c:52:6: error: no previous prototype for
‘xor_altivec_5’ [-Werror=missing-prototypes]

---
  arch/powerpc/lib/xor_vmx.h | 14 ++++++++++++++
  1 file changed, 14 insertions(+)
arch/powerpc/lib/xor_vmx.h +0 -0
index 5c2b0839b179..2173e3c84151 100644

arch/powerpc/lib/xor_vmx.h void __xor_altivec_4(unsigned long bytes, unsigned long · line 25

Quoted 8 lines
arch/powerpc/lib/xor_vmx.h +4 -0
@@ -19,3 +19,17 @@ void __xor_altivec_4(unsigned long bytes, unsigned long
 *v1_in,
  void __xor_altivec_5(unsigned long bytes, unsigned long *v1_in,
                             unsigned long *v2_in, unsigned long *v3_in,
                             unsigned long *v4_in, unsigned long *v5_in);
+
+void xor_altivec_2(unsigned long bytes, unsigned long *v1_in,
+                            unsigned long *v2_in);
+

Only used in one place, should be static instead of adding it in a .h

Quoted 7 lines
Quoted 1 line

Same for the other ones.

$ git grep xor_altivec_2
[...]
arch/powerpc/lib/xor_vmx_glue.c:EXPORT_SYMBOL(xor_altivec_2);

Are you sure I can change this function to static ?

Yes you are right. But in fact those fonctions are already defined in asm/xor. h
So you just need to add the missing #include

Christophe

Quoted 21 lines
Quoted 21 lines

Christophe

arch/powerpc/lib/xor_vmx.h void __xor_altivec_4(unsigned long bytes, unsigned long *v1_in, · line 35

Quoted 11 lines
arch/powerpc/lib/xor_vmx.h +10 -0
+void xor_altivec_3(unsigned long bytes, unsigned long *v1_in,
+                            unsigned long *v2_in, unsigned long *v3_in);
+
+void xor_altivec_4(unsigned long bytes, unsigned long *v1_in,
+                            unsigned long *v2_in, unsigned long *v3_in,
+                            unsigned long *v4_in);
+
+void xor_altivec_5(unsigned long bytes, unsigned long *v1_in,
+                            unsigned long *v2_in, unsigned long *v3_in,
+                            unsigned long *v4_in, unsigned long *v5_in);

---
L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast.
https://www.avast.com/antivirus

#71 lore raw

Re: [PATCH 14/19] powerpc/altivec: Add missing prototypes for altivec

Christophe,

Quoted 61 lines · LEROY Christophe
Quoted 58 lines · Mathieu Malaterre
Quoted 49 lines · christophe leroy
Quoted 36 lines · Mathieu Malaterre

Some functions prototypes were missing for the non-altivec code. Add the missing prototypes directly in xor_vmx, fix warnings treated as errors with
W=1:

arch/powerpc/lib/xor_vmx_glue.c:18:6: error: no previous prototype
for
‘xor_altivec_2’ [-Werror=missing-prototypes]
arch/powerpc/lib/xor_vmx_glue.c:29:6: error: no previous prototype
for
‘xor_altivec_3’ [-Werror=missing-prototypes]
arch/powerpc/lib/xor_vmx_glue.c:40:6: error: no previous prototype
for
‘xor_altivec_4’ [-Werror=missing-prototypes]
arch/powerpc/lib/xor_vmx_glue.c:52:6: error: no previous prototype
for
‘xor_altivec_5’ [-Werror=missing-prototypes]

---
  arch/powerpc/lib/xor_vmx.h | 14 ++++++++++++++
  1 file changed, 14 insertions(+)
arch/powerpc/lib/xor_vmx.h +0 -0
index 5c2b0839b179..2173e3c84151 100644
@@ -19,3 +19,17 @@ void __xor_altivec_4(unsigned long bytes, unsigned

long
*v1_in,
void __xor_altivec_5(unsigned long bytes, unsigned long *v1_in,
unsigned long *v2_in, unsigned long *v3_in, unsigned long *v4_in, unsigned long
*v5_in);

arch/powerpc/lib/xor_vmx.h void __xor_altivec_4(unsigned long bytes, unsigned long *v1_in, · line 25

Quoted 4 lines
arch/powerpc/lib/xor_vmx.h +4 -0
+
+void xor_altivec_2(unsigned long bytes, unsigned long *v1_in,
+                            unsigned long *v2_in);
+

Only used in one place, should be static instead of adding it in a .h

Quoted 1 line

Same for the other ones.

$ git grep xor_altivec_2
[...]
arch/powerpc/lib/xor_vmx_glue.c:EXPORT_SYMBOL(xor_altivec_2);
Quoted 6 lines
Quoted 1 line

Are you sure I can change this function to static ?

Yes you are right. But in fact those fonctions are already defined in asm/xor. h
So you just need to add the missing #include

I originally tried it, but this leads to:

CC arch/powerpc/lib/xor_vmx_glue.o
In file included from arch/powerpc/lib/xor_vmx_glue.c:16:0:
./arch/powerpc/include/asm/xor.h:39:15: error: variable ‘xor_block_altivec’ has initializer but incomplete type

 static struct xor_block_template xor_block_altivec = {
               ^~~~~~~~~~~~~~~~~~

./arch/powerpc/include/asm/xor.h:40:2: error: unknown field ‘name’ specified in initializer
.name = "altivec",
^
[...]

The file <asm/xor.h> (powerpc) is pretty much expected to be included after <include/linux/raid/xor.h>.

I did not want to tweak <asm/xor.h> to test for #ifdef _XOR_H just before

#ifdef _XOR_H
static struct xor_block_template xor_block_altivec = { [...]

since this seems like a hack to me.

Is this ok to test for #ifdef _XOR_H in <arch/powerpc/include/asm/xor.h> ?

Quoted 28 lines

Christophe

Quoted 23 lines
Quoted 23 lines

Christophe

Quoted 11 lines
arch/powerpc/lib/xor_vmx.h +2 -0
+void xor_altivec_3(unsigned long bytes, unsigned long *v1_in,
+                            unsigned long *v2_in, unsigned long

*v3_in);

arch/powerpc/lib/xor_vmx.h +8 -0
+
+void xor_altivec_4(unsigned long bytes, unsigned long *v1_in,
+                            unsigned long *v2_in, unsigned long *v3_in,
+                            unsigned long *v4_in);
+
+void xor_altivec_5(unsigned long bytes, unsigned long *v1_in,
+                            unsigned long *v2_in, unsigned long *v3_in,
+                            unsigned long *v4_in, unsigned long
Quoted 2 lines

*v5_in);

---
L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast.
https://www.avast.com/antivirus

#72 lore raw

Re: [PATCH 14/19] powerpc/altivec: Add missing prototypes for altivec

Mathieu Malaterre <[email protected]> a écrit :

Quoted 91 lines

Christophe,

Quoted 61 lines · LEROY Christophe
Quoted 58 lines · Mathieu Malaterre
Quoted 49 lines · christophe leroy
Quoted 36 lines · Mathieu Malaterre

Some functions prototypes were missing for the non-altivec code. Add the missing prototypes directly in xor_vmx, fix warnings treated as errors with
W=1:

arch/powerpc/lib/xor_vmx_glue.c:18:6: error: no previous prototype
for
‘xor_altivec_2’ [-Werror=missing-prototypes]
arch/powerpc/lib/xor_vmx_glue.c:29:6: error: no previous prototype
for
‘xor_altivec_3’ [-Werror=missing-prototypes]
arch/powerpc/lib/xor_vmx_glue.c:40:6: error: no previous prototype
for
‘xor_altivec_4’ [-Werror=missing-prototypes]
arch/powerpc/lib/xor_vmx_glue.c:52:6: error: no previous prototype
for
‘xor_altivec_5’ [-Werror=missing-prototypes]

---
  arch/powerpc/lib/xor_vmx.h | 14 ++++++++++++++
  1 file changed, 14 insertions(+)
arch/powerpc/lib/xor_vmx.h +0 -0
index 5c2b0839b179..2173e3c84151 100644
@@ -19,3 +19,17 @@ void __xor_altivec_4(unsigned long bytes, unsigned

long
*v1_in,
void __xor_altivec_5(unsigned long bytes, unsigned long *v1_in,
unsigned long *v2_in, unsigned long *v3_in, unsigned long *v4_in, unsigned long
*v5_in);

arch/powerpc/lib/xor_vmx.h void __xor_altivec_4(unsigned long bytes, unsigned long *v1_in, · line 25

Quoted 4 lines
arch/powerpc/lib/xor_vmx.h +4 -0
+
+void xor_altivec_2(unsigned long bytes, unsigned long *v1_in,
+                            unsigned long *v2_in);
+

Only used in one place, should be static instead of adding it in a .h

Quoted 1 line

Same for the other ones.

$ git grep xor_altivec_2
[...]
arch/powerpc/lib/xor_vmx_glue.c:EXPORT_SYMBOL(xor_altivec_2);
Quoted 6 lines
Quoted 1 line

Are you sure I can change this function to static ?

Yes you are right. But in fact those fonctions are already defined in asm/xor. h
So you just need to add the missing #include

I originally tried it, but this leads to:

CC arch/powerpc/lib/xor_vmx_glue.o
In file included from arch/powerpc/lib/xor_vmx_glue.c:16:0:
./arch/powerpc/include/asm/xor.h:39:15: error: variable ‘xor_block_altivec’ has initializer but incomplete type

 static struct xor_block_template xor_block_altivec = {
               ^~~~~~~~~~~~~~~~~~

./arch/powerpc/include/asm/xor.h:40:2: error: unknown field ‘name’ specified in initializer
.name = "altivec",
^
[...]

The file <asm/xor.h> (powerpc) is pretty much expected to be included after <include/linux/raid/xor.h>.

I did not want to tweak <asm/xor.h> to test for #ifdef _XOR_H just before

Quoted 7 lines

#ifdef _XOR_H
static struct xor_block_template xor_block_altivec = { [...]

since this seems like a hack to me.

Is this ok to test for #ifdef _XOR_H in <arch/powerpc/include/asm/xor.h> ?

What about including linux/raid/xor.h in asm/xor.h ?

Christophe

Quoted 29 lines
Quoted 29 lines

Christophe

Quoted 23 lines
Quoted 23 lines

Christophe

Quoted 11 lines
arch/powerpc/lib/xor_vmx.h +2 -0
+void xor_altivec_3(unsigned long bytes, unsigned long *v1_in,
+                            unsigned long *v2_in, unsigned long

*v3_in);

arch/powerpc/lib/xor_vmx.h +8 -0
+
+void xor_altivec_4(unsigned long bytes, unsigned long *v1_in,
+                            unsigned long *v2_in, unsigned long *v3_in,
+                            unsigned long *v4_in);
+
+void xor_altivec_5(unsigned long bytes, unsigned long *v1_in,
+                            unsigned long *v2_in, unsigned long *v3_in,
+                            unsigned long *v4_in, unsigned long
Quoted 2 lines

*v5_in);

---
L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast.
https://www.avast.com/antivirus

#73 lore raw

Re: [PATCH 14/19] powerpc/altivec: Add missing prototypes for altivec

LEROY Christophe <[email protected]> a écrit :

Quoted 97 lines

Mathieu Malaterre <[email protected]> a écrit :

Quoted 95 lines

Christophe,

Quoted 61 lines · LEROY Christophe
Quoted 58 lines · Mathieu Malaterre
Quoted 49 lines · christophe leroy
Quoted 36 lines · Mathieu Malaterre

Some functions prototypes were missing for the non-altivec code. Add the missing prototypes directly in xor_vmx, fix warnings treated as errors with
W=1:

arch/powerpc/lib/xor_vmx_glue.c:18:6: error: no previous prototype
for
‘xor_altivec_2’ [-Werror=missing-prototypes]
arch/powerpc/lib/xor_vmx_glue.c:29:6: error: no previous prototype
for
‘xor_altivec_3’ [-Werror=missing-prototypes]
arch/powerpc/lib/xor_vmx_glue.c:40:6: error: no previous prototype
for
‘xor_altivec_4’ [-Werror=missing-prototypes]
arch/powerpc/lib/xor_vmx_glue.c:52:6: error: no previous prototype
for
‘xor_altivec_5’ [-Werror=missing-prototypes]

---
 arch/powerpc/lib/xor_vmx.h | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
arch/powerpc/lib/xor_vmx.h +0 -0
index 5c2b0839b179..2173e3c84151 100644
@@ -19,3 +19,17 @@ void __xor_altivec_4(unsigned long bytes, unsigned

long
*v1_in,
void __xor_altivec_5(unsigned long bytes, unsigned long *v1_in,
unsigned long *v2_in, unsigned long *v3_in, unsigned long *v4_in, unsigned long
*v5_in);

arch/powerpc/lib/xor_vmx.h void __xor_altivec_4(unsigned long bytes, unsigned long *v1_in, · line 25

Quoted 4 lines
arch/powerpc/lib/xor_vmx.h +4 -0
+
+void xor_altivec_2(unsigned long bytes, unsigned long *v1_in,
+                            unsigned long *v2_in);
+

Only used in one place, should be static instead of adding it in a .h

Quoted 1 line

Same for the other ones.

$ git grep xor_altivec_2
[...]
arch/powerpc/lib/xor_vmx_glue.c:EXPORT_SYMBOL(xor_altivec_2);
Quoted 6 lines
Quoted 1 line

Are you sure I can change this function to static ?

Yes you are right. But in fact those fonctions are already defined in asm/xor. h
So you just need to add the missing #include

I originally tried it, but this leads to:

CC arch/powerpc/lib/xor_vmx_glue.o
In file included from arch/powerpc/lib/xor_vmx_glue.c:16:0:
./arch/powerpc/include/asm/xor.h:39:15: error: variable ‘xor_block_altivec’ has initializer but incomplete type

static struct xor_block_template xor_block_altivec = {
              ^~~~~~~~~~~~~~~~~~

./arch/powerpc/include/asm/xor.h:40:2: error: unknown field ‘name’ specified in initializer
.name = "altivec",
^
[...]

The file <asm/xor.h> (powerpc) is pretty much expected to be included after <include/linux/raid/xor.h>.

I did not want to tweak <asm/xor.h> to test for #ifdef _XOR_H just before

#ifdef _XOR_H
static struct xor_block_template xor_block_altivec = { [...]

Quoted 5 lines
Quoted 3 lines

since this seems like a hack to me.

Is this ok to test for #ifdef _XOR_H in <arch/powerpc/include/asm/xor.h> ?

What about including linux/raid/xor.h in asm/xor.h ?

Or better: including linux/raid/xor.h then asm/xor.h in xor_vmx_glue.c ?

Christophe

Quoted 31 lines

Christophe

Quoted 29 lines
Quoted 29 lines

Christophe

Quoted 23 lines
Quoted 23 lines

Christophe

Quoted 11 lines
arch/powerpc/lib/xor_vmx.h +2 -0
+void xor_altivec_3(unsigned long bytes, unsigned long *v1_in,
+                            unsigned long *v2_in, unsigned long

*v3_in);

arch/powerpc/lib/xor_vmx.h +8 -0
+
+void xor_altivec_4(unsigned long bytes, unsigned long *v1_in,
+                            unsigned long *v2_in, unsigned long *v3_in,
+                            unsigned long *v4_in);
+
+void xor_altivec_5(unsigned long bytes, unsigned long *v1_in,
+                            unsigned long *v2_in, unsigned long *v3_in,
+                            unsigned long *v4_in, unsigned long
Quoted 2 lines

*v5_in);

---
L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast.
https://www.avast.com/antivirus

#74 lore raw

Re: [PATCH 14/19] powerpc/altivec: Add missing prototypes for altivec

Quoted 110 lines · LEROY Christophe
Quoted 107 lines · LEROY Christophe
Quoted 105 lines · Mathieu Malaterre

Christophe,

Quoted 69 lines · LEROY Christophe
Quoted 65 lines · Mathieu Malaterre
Quoted 55 lines · christophe leroy
Quoted 40 lines · Mathieu Malaterre

Some functions prototypes were missing for the non-altivec code. Add the
missing prototypes directly in xor_vmx, fix warnings treated as errors
with
W=1:

arch/powerpc/lib/xor_vmx_glue.c:18:6: error: no previous prototype
for
‘xor_altivec_2’ [-Werror=missing-prototypes]
arch/powerpc/lib/xor_vmx_glue.c:29:6: error: no previous prototype
for
‘xor_altivec_3’ [-Werror=missing-prototypes]
arch/powerpc/lib/xor_vmx_glue.c:40:6: error: no previous prototype
for
‘xor_altivec_4’ [-Werror=missing-prototypes]
arch/powerpc/lib/xor_vmx_glue.c:52:6: error: no previous prototype
for
‘xor_altivec_5’ [-Werror=missing-prototypes]

---
 arch/powerpc/lib/xor_vmx.h | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
arch/powerpc/lib/xor_vmx.h +0 -0
index 5c2b0839b179..2173e3c84151 100644
@@ -19,3 +19,17 @@ void __xor_altivec_4(unsigned long bytes, unsigned

long
*v1_in,
void __xor_altivec_5(unsigned long bytes, unsigned long *v1_in,
unsigned long *v2_in, unsigned long
*v3_in,
unsigned long *v4_in, unsigned long
*v5_in);

arch/powerpc/lib/xor_vmx.h

Quoted 4 lines
arch/powerpc/lib/xor_vmx.h +4 -0
+
+void xor_altivec_2(unsigned long bytes, unsigned long *v1_in,
+                            unsigned long *v2_in);
+

Only used in one place, should be static instead of adding it in a .h

Quoted 1 line

Same for the other ones.

$ git grep xor_altivec_2
[...]
arch/powerpc/lib/xor_vmx_glue.c:EXPORT_SYMBOL(xor_altivec_2);
Quoted 7 lines
Quoted 1 line

Are you sure I can change this function to static ?

Yes you are right. But in fact those fonctions are already defined in asm/xor. h
So you just need to add the missing #include

I originally tried it, but this leads to:

CC arch/powerpc/lib/xor_vmx_glue.o
In file included from arch/powerpc/lib/xor_vmx_glue.c:16:0:
./arch/powerpc/include/asm/xor.h:39:15: error: variable ‘xor_block_altivec’ has initializer but incomplete type

static struct xor_block_template xor_block_altivec = {
              ^~~~~~~~~~~~~~~~~~

./arch/powerpc/include/asm/xor.h:40:2: error: unknown field ‘name’ specified in initializer
.name = "altivec",
^
[...]

The file <asm/xor.h> (powerpc) is pretty much expected to be included after <include/linux/raid/xor.h>.

I did not want to tweak <asm/xor.h> to test for #ifdef _XOR_H just before

#ifdef _XOR_H
static struct xor_block_template xor_block_altivec = { [...]

Quoted 7 lines
Quoted 7 lines
Quoted 4 lines

since this seems like a hack to me.

Is this ok to test for #ifdef _XOR_H in <arch/powerpc/include/asm/xor.h> ?

What about including linux/raid/xor.h in asm/xor.h ?

This leads to:

CALL ../arch/powerpc/kernel/systbl_chk.sh
In file included from ../arch/powerpc/include/asm/xor.h:57:0,

                 from ../arch/powerpc/lib/xor_vmx_glue.c:17:
../include/asm-generic/xor.h:688:34: error: ‘xor_block_32regs’ defined
but not used [-Werror=unused-variable]
 static struct xor_block_template xor_block_32regs = {
                                  ^~~~~~~~~~~~~~~~
../include/asm-generic/xor.h:680:34: error: ‘xor_block_8regs’ defined
but not used [-Werror=unused-variable]
 static struct xor_block_template xor_block_8regs = {
                                  ^~~~~~~~~~~~~~~
In file included from ../arch/powerpc/lib/xor_vmx_glue.c:17:0:
../arch/powerpc/include/asm/xor.h:39:34: error: ‘xor_block_altivec’
defined but not used [-Werror=unused-variable]
 static struct xor_block_template xor_block_altivec = {
                                  ^~~~~~~~~~~~~~~~~

CALL ../arch/powerpc/kernel/prom_init_check.sh

Quoted 41 lines

Or better: including linux/raid/xor.h then asm/xor.h in xor_vmx_glue.c ?

Christophe

Quoted 34 lines

Christophe

Quoted 32 lines
Quoted 32 lines

Christophe

Quoted 25 lines
Quoted 25 lines

Christophe

Quoted 11 lines
arch/powerpc/lib/xor_vmx.h +2 -0
+void xor_altivec_3(unsigned long bytes, unsigned long *v1_in,
+                            unsigned long *v2_in, unsigned long

*v3_in);

arch/powerpc/lib/xor_vmx.h +3 -0
+
+void xor_altivec_4(unsigned long bytes, unsigned long *v1_in,
+                            unsigned long *v2_in, unsigned long

*v3_in,

arch/powerpc/lib/xor_vmx.h +4 -0
+                            unsigned long *v4_in);
+
+void xor_altivec_5(unsigned long bytes, unsigned long *v1_in,
+                            unsigned long *v2_in, unsigned long
Quoted 4 lines

*v3_in,
+ unsigned long *v4_in, unsigned long
*v5_in);

---
L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast.
https://www.avast.com/antivirus

#75 lore raw

Re: [PATCH 14/19] powerpc/altivec: Add missing prototypes for altivec

On Wed, Mar 28, 2018 at 9:26 AM, Mathieu Malaterre <[email protected]> wrote= :

Quoted 21 lines
Quoted 19 lines · LEROY Christophe

LEROY Christophe <[email protected]> a =C3=A9crit :

Quoted 16 lines

Mathieu Malaterre <[email protected]> a =C3=A9crit :

Quoted 14 lines

Christophe,

Quoted 10 lines · LEROY Christophe

Mathieu Malaterre <[email protected]> a =C3=A9crit :

Quoted 6 lines
Quoted 4 lines · christophe leroy
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

Le 22/03/2018 =C3=A0 21:20, Mathieu Malaterre a =C3=A9crit :

Quoted 4 lines

Some functions prototypes were missing for the non-altivec code. A=

dd

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

the
missing prototypes directly in xor_vmx, fix warnings treated as errors
with
W=3D1:

arch/powerpc/lib/xor_vmx_glue.c:18:6: error: no previous prototy=

pe

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

for
=E2=80=98xor_altivec_2=E2=80=99 [-Werror=3Dmissing-prototypes]
arch/powerpc/lib/xor_vmx_glue.c:29:6: error: no previous prototy=

pe

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

for
=E2=80=98xor_altivec_3=E2=80=99 [-Werror=3Dmissing-prototypes]
arch/powerpc/lib/xor_vmx_glue.c:40:6: error: no previous prototy=

pe

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

for
=E2=80=98xor_altivec_4=E2=80=99 [-Werror=3Dmissing-prototypes]
arch/powerpc/lib/xor_vmx_glue.c:52:6: error: no previous prototy=

pe

Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines

arch/powerpc/lib/xor_vmx=

Quoted 9 lines

for
=E2=80=98xor_altivec_5=E2=80=99 [-Werror=3Dmissing-prototypes]

---
 arch/powerpc/lib/xor_vmx.h | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
arch/powerpc/lib/xor_vmx= renamed from arch/powerpc/lib/xor_vmx.h +0 -0

.h

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

arch/powerpc/lib/xor_vmx.h void __xor_altivec_4(unsigned long bytes, unsig=

Quoted 4 lines

index 5c2b0839b179..2173e3c84151 100644

arch/powerpc/lib/xor_vmx.h +0 -0
@@ -19,3 +19,17 @@ void __xor_altivec_4(unsigned long bytes, unsig=

ned

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

long
*v1_in,
void __xor_altivec_5(unsigned long bytes, unsigned long *v1_in,
unsigned long *v2_in, unsigned long
*v3_in,
unsigned long *v4_in, unsigned long
*v5_in);
+

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

arch/powerpc/lib/xor_vmx.h

Quoted 3 lines
arch/powerpc/lib/xor_vmx.h +3 -0
+void xor_altivec_2(unsigned long bytes, unsigned long *v1_in,
+                            unsigned long *v2_in);
+

Only used in one place, should be static instead of adding it in a =

.h

Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 2 lines

Same for the other ones.

$ git grep xor_altivec_2
[...]
arch/powerpc/lib/xor_vmx_glue.c:EXPORT_SYMBOL(xor_altivec_2);
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 1 line

Are you sure I can change this function to static ?

Yes you are right. But in fact those fonctions are already defined i=

n

Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 2 lines

asm/xor. h
So you just need to add the missing #include

I originally tried it, but this leads to:

CC arch/powerpc/lib/xor_vmx_glue.o
In file included from arch/powerpc/lib/xor_vmx_glue.c:16:0:
./arch/powerpc/include/asm/xor.h:39:15: error: variable =E2=80=98xor_block_altivec=E2=80=99 has initializer but incomplete typ=

e

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
static struct xor_block_template xor_block_altivec =3D {
              ^~~~~~~~~~~~~~~~~~

./arch/powerpc/include/asm/xor.h:40:2: error: unknown field =E2=80=98n=

ame=E2=80=99

Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines

specified in initializer
.name =3D "altivec",
^
[...]

The file <asm/xor.h> (powerpc) is pretty much expected to be included after <include/linux/raid/xor.h>.

I did not want to tweak <asm/xor.h> to test for #ifdef _XOR_H just bef=

ore

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

#ifdef _XOR_H
static struct xor_block_template xor_block_altivec =3D { [...]

since this seems like a hack to me.

Is this ok to test for #ifdef _XOR_H in <arch/powerpc/include/asm/xor.=

h>

Quoted 11 lines
Quoted 4 lines
Quoted 4 lines
Quoted 1 line

?

What about including linux/raid/xor.h in asm/xor.h ?

This leads to:

CALL ../arch/powerpc/kernel/systbl_chk.sh
In file included from ../arch/powerpc/include/asm/xor.h:57:0,

                 from ../arch/powerpc/lib/xor_vmx_glue.c:17:

../include/asm-generic/xor.h:688:34: error: =E2=80=98xor_block_32regs=E2=

=80=99 defined

Quoted 4 lines

but not used [-Werror=3Dunused-variable]

 static struct xor_block_template xor_block_32regs =3D {
                                  ^~~~~~~~~~~~~~~~

../include/asm-generic/xor.h:680:34: error: =E2=80=98xor_block_8regs=E2=

=80=99 defined

Quoted 5 lines

but not used [-Werror=3Dunused-variable]

 static struct xor_block_template xor_block_8regs =3D {
                                  ^~~~~~~~~~~~~~~

In file included from ../arch/powerpc/lib/xor_vmx_glue.c:17:0:
../arch/powerpc/include/asm/xor.h:39:34: error: =E2=80=98xor_block_altive=

c=E2=80=99

Quoted 5 lines

defined but not used [-Werror=3Dunused-variable]

 static struct xor_block_template xor_block_altivec =3D {
                                  ^~~~~~~~~~~~~~~~~

CALL ../arch/powerpc/kernel/prom_init_check.sh

I'll prepare a patch which moves the prototypes from arch/powerpc/include/asm/xor.h to arch/powerpc/include/asm/xor_altivec.h (new file). I believe this should be the simplest path.

Quoted 26 lines
Quoted 26 lines

Or better: including linux/raid/xor.h then asm/xor.h in xor_vmx_glue.c ?

Christophe

Quoted 21 lines

Christophe

Quoted 19 lines
Quoted 19 lines

Christophe

Quoted 14 lines
Quoted 14 lines

Christophe

Quoted 10 lines
arch/powerpc/lib/xor_vmx.h +2 -0
+void xor_altivec_3(unsigned long bytes, unsigned long *v1_in,
+                            unsigned long *v2_in, unsigned long

*v3_in);

arch/powerpc/lib/xor_vmx.h +3 -0
+
+void xor_altivec_4(unsigned long bytes, unsigned long *v1_in,
+                            unsigned long *v2_in, unsigned long

*v3_in,

arch/powerpc/lib/xor_vmx.h +3 -0
+                            unsigned long *v4_in);
+
+void xor_altivec_5(unsigned long bytes, unsigned long *v1_in,
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 5 lines

+ unsigned long *v2_in, unsigned long
*v3_in,
+ unsigned long *v4_in, unsigned long
*v5_in);

---
L'absence de virus dans ce courrier =C3=A9lectronique a =C3=A9t=C3=

=A9 v=C3=A9rifi=C3=A9e par le

Quoted 7 lines
Quoted 7 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 3 lines
Quoted 3 lines

logiciel antivirus Avast.
https://www.avast.com/antivirus

#76 lore raw

PATCH v2 1/1 powerpc/altivec: Add missing prototypes for altivec

In reply to Mathieu Malaterre

Some functions prototypes were missing for the non-altivec code. Add the missing prototypes in a new header file, fix warnings treated as errors with W=1:

arch/powerpc/lib/xor_vmx_glue.c:18:6: error: no previous prototype for ‘xor_altivec_2’ [-Werror=missing-prototypes] arch/powerpc/lib/xor_vmx_glue.c:29:6: error: no previous prototype for ‘xor_altivec_3’ [-Werror=missing-prototypes] arch/powerpc/lib/xor_vmx_glue.c:40:6: error: no previous prototype for ‘xor_altivec_4’ [-Werror=missing-prototypes] arch/powerpc/lib/xor_vmx_glue.c:52:6: error: no previous prototype for ‘xor_altivec_5’ [-Werror=missing-prototypes]

The prototypes were already present in <asm/xor.h> but this header file is meant to be included after <include/linux/raid/xor.h>. Trying to re-use <asm/xor.h> directly would lead to warnings such as:

arch/powerpc/include/asm/xor.h:39:15: error: variable ‘xor_block_altivec’ has initializer but incomplete type

Trying to re-use <asm/xor.h> after <include/linux/raid/xor.h> in xor_vmx_glue.c would in turn trigger the following warnings:

include/asm-generic/xor.h:688:34: error: ‘xor_block_32regs’ defined but not used [-Werror=unused-variable]

---
 arch/powerpc/include/asm/xor.h         | 12 +-----------
 arch/powerpc/include/asm/xor_altivec.h | 19 +++++++++++++++++++
 arch/powerpc/lib/xor_vmx_glue.c        |  1 +
 3 files changed, 21 insertions(+), 11 deletions(-)
 create mode 100644 arch/powerpc/include/asm/xor_altivec.h
arch/powerpc/include/asm/xor.h +1 -11
index a36c2069d8ed..7d6dc503349d 100644
@@ -24,17 +24,7 @@
 
 #include <asm/cputable.h>
 #include <asm/cpu_has_feature.h>
-
-void xor_altivec_2(unsigned long bytes, unsigned long *v1_in,
-		   unsigned long *v2_in);
-void xor_altivec_3(unsigned long bytes, unsigned long *v1_in,
-		   unsigned long *v2_in, unsigned long *v3_in);
-void xor_altivec_4(unsigned long bytes, unsigned long *v1_in,
-		   unsigned long *v2_in, unsigned long *v3_in,
-		   unsigned long *v4_in);
-void xor_altivec_5(unsigned long bytes, unsigned long *v1_in,
-		   unsigned long *v2_in, unsigned long *v3_in,
-		   unsigned long *v4_in, unsigned long *v5_in);
+#include <asm/xor_altivec.h>
 
 static struct xor_block_template xor_block_altivec = {
 	.name = "altivec",
arch/powerpc/include/asm/xor_altivec.h new file +19 -0
new file mode 100644
index 000000000000..6ca923510b59
@@ -0,0 +1,19 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef _ASM_POWERPC_XOR_ALTIVEC_H
+#define _ASM_POWERPC_XOR_ALTIVEC_H
+
+#ifdef CONFIG_ALTIVEC
+
+void xor_altivec_2(unsigned long bytes, unsigned long *v1_in,
+		   unsigned long *v2_in);
+void xor_altivec_3(unsigned long bytes, unsigned long *v1_in,
+		   unsigned long *v2_in, unsigned long *v3_in);
+void xor_altivec_4(unsigned long bytes, unsigned long *v1_in,
+		   unsigned long *v2_in, unsigned long *v3_in,
+		   unsigned long *v4_in);
+void xor_altivec_5(unsigned long bytes, unsigned long *v1_in,
+		   unsigned long *v2_in, unsigned long *v3_in,
+		   unsigned long *v4_in, unsigned long *v5_in);
+
+#endif
+#endif /* _ASM_POWERPC_XOR_ALTIVEC_H */
arch/powerpc/lib/xor_vmx_glue.c +1 -0
index 6521fe5e8cef..dab2b6bfcf36 100644
@@ -13,6 +13,7 @@
 #include <linux/export.h>
 #include <linux/sched.h>
 #include <asm/switch_to.h>
+#include <asm/xor_altivec.h>
 #include "xor_vmx.h"
 
 void xor_altivec_2(unsigned long bytes, unsigned long *v1_in,
Signature · 1 line
2.11.0
#77 lore raw

PATCH v3 1/1 powerpc/altivec: Add missing prototypes for altivec

In reply to Mathieu Malaterre

Some functions prototypes were missing for the non-altivec code. Add the missing prototypes in a new header file, fix warnings treated as errors with W=1:

arch/powerpc/lib/xor_vmx_glue.c:18:6: error: no previous prototype for ‘xor_altivec_2’ [-Werror=missing-prototypes] arch/powerpc/lib/xor_vmx_glue.c:29:6: error: no previous prototype for ‘xor_altivec_3’ [-Werror=missing-prototypes] arch/powerpc/lib/xor_vmx_glue.c:40:6: error: no previous prototype for ‘xor_altivec_4’ [-Werror=missing-prototypes] arch/powerpc/lib/xor_vmx_glue.c:52:6: error: no previous prototype for ‘xor_altivec_5’ [-Werror=missing-prototypes]

The prototypes were already present in <asm/xor.h> but this header file is meant to be included after <include/linux/raid/xor.h>. Trying to re-use <asm/xor.h> directly would lead to warnings such as:

arch/powerpc/include/asm/xor.h:39:15: error: variable ‘xor_block_altivec’ has initializer but incomplete type

Trying to re-use <asm/xor.h> after <include/linux/raid/xor.h> in xor_vmx_glue.c would in turn trigger the following warnings:

include/asm-generic/xor.h:688:34: error: ‘xor_block_32regs’ defined but not used [-Werror=unused-variable]

---
v3: missing changelog, no other change
v2: new version where a separate header was introduced. Also update commit message explaining history.

 arch/powerpc/include/asm/xor.h         | 12 +-----------
 arch/powerpc/include/asm/xor_altivec.h | 19 +++++++++++++++++++
 arch/powerpc/lib/xor_vmx_glue.c        |  1 +
 3 files changed, 21 insertions(+), 11 deletions(-)
 create mode 100644 arch/powerpc/include/asm/xor_altivec.h
arch/powerpc/include/asm/xor.h +1 -11
index a36c2069d8ed..7d6dc503349d 100644
@@ -24,17 +24,7 @@
 
 #include <asm/cputable.h>
 #include <asm/cpu_has_feature.h>
-
-void xor_altivec_2(unsigned long bytes, unsigned long *v1_in,
-		   unsigned long *v2_in);
-void xor_altivec_3(unsigned long bytes, unsigned long *v1_in,
-		   unsigned long *v2_in, unsigned long *v3_in);
-void xor_altivec_4(unsigned long bytes, unsigned long *v1_in,
-		   unsigned long *v2_in, unsigned long *v3_in,
-		   unsigned long *v4_in);
-void xor_altivec_5(unsigned long bytes, unsigned long *v1_in,
-		   unsigned long *v2_in, unsigned long *v3_in,
-		   unsigned long *v4_in, unsigned long *v5_in);
+#include <asm/xor_altivec.h>
 
 static struct xor_block_template xor_block_altivec = {
 	.name = "altivec",
arch/powerpc/include/asm/xor_altivec.h new file +19 -0
new file mode 100644
index 000000000000..6ca923510b59
@@ -0,0 +1,19 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef _ASM_POWERPC_XOR_ALTIVEC_H
+#define _ASM_POWERPC_XOR_ALTIVEC_H
+
+#ifdef CONFIG_ALTIVEC
+
+void xor_altivec_2(unsigned long bytes, unsigned long *v1_in,
+		   unsigned long *v2_in);
+void xor_altivec_3(unsigned long bytes, unsigned long *v1_in,
+		   unsigned long *v2_in, unsigned long *v3_in);
+void xor_altivec_4(unsigned long bytes, unsigned long *v1_in,
+		   unsigned long *v2_in, unsigned long *v3_in,
+		   unsigned long *v4_in);
+void xor_altivec_5(unsigned long bytes, unsigned long *v1_in,
+		   unsigned long *v2_in, unsigned long *v3_in,
+		   unsigned long *v4_in, unsigned long *v5_in);
+
+#endif
+#endif /* _ASM_POWERPC_XOR_ALTIVEC_H */
arch/powerpc/lib/xor_vmx_glue.c +1 -0
index 6521fe5e8cef..dab2b6bfcf36 100644
@@ -13,6 +13,7 @@
 #include <linux/export.h>
 #include <linux/sched.h>
 #include <asm/switch_to.h>
+#include <asm/xor_altivec.h>
 #include "xor_vmx.h"
 
 void xor_altivec_2(unsigned long bytes, unsigned long *v1_in,
Signature · 1 line
2.11.0
#78 lore raw

Re: [v3] powerpc/altivec: Add missing prototypes for altivec

Quoted 13 lines · Mathieu Malaterre

Some functions prototypes were missing for the non-altivec code. Add the missing prototypes in a new header file, fix warnings treated as errors with W=1:

arch/powerpc/lib/xor_vmx_glue.c:18:6: error: no previous prototype for ‘xor_altivec_2’ [-Werror=missing-prototypes] arch/powerpc/lib/xor_vmx_glue.c:29:6: error: no previous prototype for ‘xor_altivec_3’ [-Werror=missing-prototypes] arch/powerpc/lib/xor_vmx_glue.c:40:6: error: no previous prototype for ‘xor_altivec_4’ [-Werror=missing-prototypes] arch/powerpc/lib/xor_vmx_glue.c:52:6: error: no previous prototype for ‘xor_altivec_5’ [-Werror=missing-prototypes]

The prototypes were already present in <asm/xor.h> but this header file is meant to be included after <include/linux/raid/xor.h>. Trying to re-use <asm/xor.h> directly would lead to warnings such as:

Quoted 8 lines

arch/powerpc/include/asm/xor.h:39:15: error: variable ‘xor_block_altivec’ has initializer but incomplete type

Trying to re-use <asm/xor.h> after <include/linux/raid/xor.h> in xor_vmx_glue.c would in turn trigger the following warnings:

include/asm-generic/xor.h:688:34: error: ‘xor_block_32regs’ defined but not used [-Werror=unused-variable]

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/7cf76a68f1bcf69214da2812e8f615

cheers

#79 lore raw

PATCH 15/19 powerpc: Add missing prototype

In reply to Mathieu Malaterre

Add one missing prototype for function rh_dump_blk. Fix warning treated as error in W=1:

arch/powerpc/lib/rheap.c:740:6: error: no previous prototype for ‘rh_dump_blk’ [-Werror=missing-prototypes]

---
 arch/powerpc/include/asm/rheap.h | 3 +++
 1 file changed, 3 insertions(+)
arch/powerpc/include/asm/rheap.h +3 -0
index 172381769cfc..e75d96de19a0 100644
@@ -83,6 +83,9 @@ extern int rh_get_stats(rh_info_t * info, int what, int max_stats,
 /* Simple dump of remote heap info */
 extern void rh_dump(rh_info_t * info);
 
+/* Simple dump of remote info block */
+extern void rh_dump_blk(rh_info_t *info, rh_block_t *blk);
+
 /* Set owner of taken block */
 extern int rh_set_owner(rh_info_t * info, unsigned long start, const char *owner);
 
Signature · 1 line
2.11.0
#80 lore raw

Re: [PATCH 15/19] powerpc: Add missing prototype

Le 22/03/2018 à 21:20, Mathieu Malaterre a écrit :

Quoted 15 lines

Add one missing prototype for function rh_dump_blk. Fix warning treated as error in W=1:

arch/powerpc/lib/rheap.c:740:6: error: no previous prototype for ‘rh_dump_blk’ [-Werror=missing-prototypes]

---
  arch/powerpc/include/asm/rheap.h | 3 +++
  1 file changed, 3 insertions(+)
arch/powerpc/include/asm/rheap.h +0 -0
index 172381769cfc..e75d96de19a0 100644

arch/powerpc/include/asm/rheap.h extern int rh_get_stats(rh_info_t * info, int what, int max_stats, · line 88

Quoted 6 lines
arch/powerpc/include/asm/rheap.h +3 -0
@@ -83,6 +83,9 @@ extern int rh_get_stats(rh_info_t * info, int what, int max_stats,
  /* Simple dump of remote heap info */
  extern void rh_dump(rh_info_t * info);
 
+/* Simple dump of remote info block */
+extern void rh_dump_blk(rh_info_t *info, rh_block_t *blk);
+

Only used in one place, should be static

Christophe

arch/powerpc/include/asm/rheap.h extern int rh_get_stats(rh_info_t * info, int what, int max_stats, · line 91

Quoted 4 lines
arch/powerpc/include/asm/rheap.h +0 -0
  /* Set owner of taken block */
  extern int rh_set_owner(rh_info_t * info, unsigned long start, const char *owner);
 

---
L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast.
https://www.avast.com/antivirus

#81 lore raw

Re: [PATCH 15/19] powerpc: Add missing prototype

Quoted 5 lines · christophe leroy

Le 22/03/2018 =C3=A0 21:20, Mathieu Malaterre a =C3=A9crit :

Quoted 2 lines

Add one missing prototype for function rh_dump_blk. Fix warning treated =

as

Quoted 10 lines
Quoted 10 lines

error in W=3D1:

arch/powerpc/lib/rheap.c:740:6: error: no previous prototype for
=E2=80=98rh_dump_blk=E2=80=99 [-Werror=3Dmissing-prototypes]

---
  arch/powerpc/include/asm/rheap.h | 3 +++
  1 file changed, 3 insertions(+)
Quoted 6 lines

arch/powerpc/include/asm/rheap.h extern int rh_get_stats(rh_info_t * info, int what, in=

Quoted 6 lines
arch/powerpc/include/asm/rheap.h +0 -0
index 172381769cfc..e75d96de19a0 100644
@@ -83,6 +83,9 @@ extern int rh_get_stats(rh_info_t * info, int what, in=

t

Quoted 9 lines

arch/powerpc/include/asm/rheap.h extern int rh_get_stats(rh_info_t * info, int what, int max_stats, · line 88

Quoted 6 lines
arch/powerpc/include/asm/rheap.h +2 -0
 max_stats,
  /* Simple dump of remote heap info */
  extern void rh_dump(rh_info_t * info);
  +/* Simple dump of remote info block */
+extern void rh_dump_blk(rh_info_t *info, rh_block_t *blk);
+

Only used in one place, should be static

Well here is what I see over here:

$ git grep rh_dump_blk
...
arch/powerpc/lib/rheap.c:EXPORT_SYMBOL_GPL(rh_dump_blk);
Quoted 10 lines

Christophe

Quoted 4 lines
arch/powerpc/include/asm/rheap.h +0 -0
  /* Set owner of taken block */
  extern int rh_set_owner(rh_info_t * info, unsigned long start, const

char *owner);

---
L'absence de virus dans ce courrier =C3=A9lectronique a =C3=A9t=C3=A9 v=

=C3=A9rifi=C3=A9e par le

Quoted 3 lines

logiciel antivirus Avast.
https://www.avast.com/antivirus

#82 lore raw

Re: [PATCH 15/19] powerpc: Add missing prototype

Mathieu Malaterre <[email protected]> a =C3=A9crit=C2=A0:

Quoted 7 lines
Quoted 5 lines · christophe leroy

Le 22/03/2018 =C3=A0 21:20, Mathieu Malaterre a =C3=A9crit :

Quoted 2 lines

Add one missing prototype for function rh_dump_blk. Fix warning treated=

as

Quoted 10 lines
Quoted 10 lines
Quoted 10 lines

error in W=3D1:

arch/powerpc/lib/rheap.c:740:6: error: no previous prototype for
=E2=80=98rh_dump_blk=E2=80=99 [-Werror=3Dmissing-prototypes]

---
  arch/powerpc/include/asm/rheap.h | 3 +++
  1 file changed, 3 insertions(+)
Quoted 6 lines
Quoted 6 lines

arch/powerpc/include/asm/rheap.h extern int rh_get_stats(rh_info_t * info, int what, i=

Quoted 6 lines
arch/powerpc/include/asm/rheap.h +0 -0
index 172381769cfc..e75d96de19a0 100644
@@ -83,6 +83,9 @@ extern int rh_get_stats(rh_info_t * info, int what, i=

nt

Quoted 10 lines
Quoted 9 lines

arch/powerpc/include/asm/rheap.h extern int rh_get_stats(rh_info_t * info, int what, int max_stats, · line 88

Quoted 6 lines
arch/powerpc/include/asm/rheap.h +2 -0
 max_stats,
  /* Simple dump of remote heap info */
  extern void rh_dump(rh_info_t * info);
  +/* Simple dump of remote info block */
+extern void rh_dump_blk(rh_info_t *info, rh_block_t *blk);
+

Only used in one place, should be static

Quoted 5 lines

Well here is what I see over here:

$ git grep rh_dump_blk
...
arch/powerpc/lib/rheap.c:EXPORT_SYMBOL_GPL(rh_dump_blk);

If it was really used by anybody in a module, it would already be in a=20= =20
.h=20so I think we should simply delete the function

Christophe

Quoted 5 lines
Quoted 5 lines

Christophe

Quoted 8 lines
Quoted 8 lines
Quoted 4 lines
arch/powerpc/include/asm/rheap.h +0 -0
  /* Set owner of taken block */
  extern int rh_set_owner(rh_info_t * info, unsigned long start, const

char *owner);

---
L'absence de virus dans ce courrier =C3=A9lectronique a =C3=A9t=C3=A9 v=

=C3=A9rifi=C3=A9e par le

Quoted 3 lines
Quoted 3 lines

logiciel antivirus Avast.
https://www.avast.com/antivirus

#83 lore raw

Re: [PATCH 15/19] powerpc: Add missing prototype

Quoted 12 lines · LEROY Christophe

Mathieu Malaterre <[email protected]> a =C3=A9crit :

Quoted 9 lines
Quoted 7 lines · christophe leroy

Le 22/03/2018 =C3=A0 21:20, Mathieu Malaterre a =C3=A9crit :

Quoted 3 lines

Add one missing prototype for function rh_dump_blk. Fix warning treate=

d

Quoted 30 lines
Quoted 30 lines
Quoted 28 lines
Quoted 22 lines

as
error in W=3D1:

arch/powerpc/lib/rheap.c:740:6: error: no previous prototype for
=E2=80=98rh_dump_blk=E2=80=99 [-Werror=3Dmissing-prototypes]

---
  arch/powerpc/include/asm/rheap.h | 3 +++
  1 file changed, 3 insertions(+)
arch/powerpc/include/asm/rheap.h +0 -0
index 172381769cfc..e75d96de19a0 100644
@@ -83,6 +83,9 @@ extern int rh_get_stats(rh_info_t * info, int what,

int
max_stats,
/* Simple dump of remote heap info */
extern void rh_dump(rh_info_t * info);
+/* Simple dump of remote info block */

arch/powerpc/include/asm/rheap.h extern int rh_get_stats(rh_info_t * info, int what, int max_stats, · line 88

Quoted 2 lines
arch/powerpc/include/asm/rheap.h +2 -0
+extern void rh_dump_blk(rh_info_t *info, rh_block_t *blk);
+

Only used in one place, should be static

Quoted 8 lines
Quoted 5 lines

Well here is what I see over here:

$ git grep rh_dump_blk
...
arch/powerpc/lib/rheap.c:EXPORT_SYMBOL_GPL(rh_dump_blk);

If it was really used by anybody in a module, it would already be in a .h=

so

Quoted 2 lines

I think we should simply delete the function

Sent a v3 without the extern keyword. I did not feel bold enough to remove completely a function. Could one of the maintainers confirm removal of the function ?

Quoted 16 lines

Christophe

Quoted 13 lines
Quoted 13 lines

Christophe

Quoted 4 lines

/* Set owner of taken block */
extern int rh_set_owner(rh_info_t * info, unsigned long start, const
char *owner);

---
L'absence de virus dans ce courrier =C3=A9lectronique a =C3=A9t=C3=A9 v=

=C3=A9rifi=C3=A9e par le

Quoted 5 lines
Quoted 3 lines
Quoted 3 lines

logiciel antivirus Avast.
https://www.avast.com/antivirus

#84 lore raw

PATCH v3 15/19 powerpc: Add missing prototype

In reply to Mathieu Malaterre

Add one missing prototype for function rh_dump_blk. Fix warning treated as error in W=1:

arch/powerpc/lib/rheap.c:740:6: error: no previous prototype for ‘rh_dump_blk’ [-Werror=missing-prototypes]

---
v3: remove extern keyword
v2: no change

 arch/powerpc/include/asm/rheap.h | 3 +++
 1 file changed, 3 insertions(+)
arch/powerpc/include/asm/rheap.h +3 -0
index 172381769cfc..8e83703d6736 100644
@@ -83,6 +83,9 @@ extern int rh_get_stats(rh_info_t * info, int what, int max_stats,
 /* Simple dump of remote heap info */
 extern void rh_dump(rh_info_t * info);
 
+/* Simple dump of remote info block */
+void rh_dump_blk(rh_info_t *info, rh_block_t *blk);
+
 /* Set owner of taken block */
 extern int rh_set_owner(rh_info_t * info, unsigned long start, const char *owner);
 
Signature · 1 line
2.11.0
#85 lore raw

Re: [v3,15/19] powerpc: Add missing prototype

Quoted 7 lines · Mathieu Malaterre

Add one missing prototype for function rh_dump_blk. Fix warning treated as error in W=1:

arch/powerpc/lib/rheap.c:740:6: error: no previous prototype for ‘rh_dump_blk’ [-Werror=missing-prototypes]

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/3fc5ee9b2846db2eaddeadf089ef25

cheers

#86 lore raw

PATCH 16/19 powerpc/powermac: Add missing include of header pmac.h

In reply to Mathieu Malaterre

The header pmac.h was not included, leading to the following warnings, treated as error with W=1:

arch/powerpc/platforms/powermac/time.c:69:13: error: no previous prototype for ‘pmac_time_init’ [-Werror=missing-prototypes] arch/powerpc/platforms/powermac/time.c:207:15: error: no previous prototype for ‘pmac_get_boot_time’ [-Werror=missing-prototypes] arch/powerpc/platforms/powermac/time.c:222:6: error: no previous prototype for ‘pmac_get_rtc_time’ [-Werror=missing-prototypes] arch/powerpc/platforms/powermac/time.c:240:5: error: no previous prototype for ‘pmac_set_rtc_time’ [-Werror=missing-prototypes] arch/powerpc/platforms/powermac/time.c:259:12: error: no previous prototype for ‘via_calibrate_decr’ [-Werror=missing-prototypes] arch/powerpc/platforms/powermac/time.c:311:13: error: no previous prototype for ‘pmac_calibrate_decr’ [-Werror=missing-prototypes]

The function via_calibrate_decr was made static to silence a warning.

---
 arch/powerpc/platforms/powermac/time.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
arch/powerpc/platforms/powermac/time.c +3 -1
index 274af6fa388e..5cc6fa40fcc4 100644
@@ -34,6 +34,8 @@
 #include <asm/nvram.h>
 #include <asm/smu.h>
 
+#include "pmac.h"
+
 #undef DEBUG
 
 #ifdef DEBUG
@@ -256,7 +258,7 @@ int pmac_set_rtc_time(struct rtc_time *tm)
  * Calibrate the decrementer register using VIA timer 1.
  * This is used both on powermacs and CHRP machines.
  */
-int __init via_calibrate_decr(void)
+static int __init via_calibrate_decr(void)
 {
 	struct device_node *vias;
 	volatile unsigned char __iomem *via;
Signature · 1 line
2.11.0
#87 lore raw

Re: [PATCH 16/19] powerpc/powermac: Add missing include of header pmac.h

This one is also ok.

Quoted 43 lines · Mathieu Malaterre

The header pmac.h was not included, leading to the following warnings, treated as error with W=1:

arch/powerpc/platforms/powermac/time.c:69:13: error: no previous prototype for ‘pmac_time_init’ [-Werror=missing-prototypes] arch/powerpc/platforms/powermac/time.c:207:15: error: no previous prototype for ‘pmac_get_boot_time’ [-Werror=missing-prototypes] arch/powerpc/platforms/powermac/time.c:222:6: error: no previous prototype for ‘pmac_get_rtc_time’ [-Werror=missing-prototypes] arch/powerpc/platforms/powermac/time.c:240:5: error: no previous prototype for ‘pmac_set_rtc_time’ [-Werror=missing-prototypes] arch/powerpc/platforms/powermac/time.c:259:12: error: no previous prototype for ‘via_calibrate_decr’ [-Werror=missing-prototypes] arch/powerpc/platforms/powermac/time.c:311:13: error: no previous prototype for ‘pmac_calibrate_decr’ [-Werror=missing-prototypes]

The function via_calibrate_decr was made static to silence a warning.

---
 arch/powerpc/platforms/powermac/time.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
arch/powerpc/platforms/powermac/time.c +3 -2
index 274af6fa388e..5cc6fa40fcc4 100644
@@ -34,6 +34,8 @@
 #include <asm/nvram.h>
 #include <asm/smu.h>
 
+#include "pmac.h"
+
 #undef DEBUG
 
 #ifdef DEBUG
@@ -256,7 +258,7 @@ int pmac_set_rtc_time(struct rtc_time *tm)
  * Calibrate the decrementer register using VIA timer 1.
  * This is used both on powermacs and CHRP machines.
  */
-int __init via_calibrate_decr(void)
+static int __init via_calibrate_decr(void)
 {
        struct device_node *vias;
        volatile unsigned char __iomem *via;
--

2.11.0

#88 lore raw

Re: [16/19] powerpc/powermac: Add missing include of header pmac.h

In reply to Mathieu Malaterre
Quoted 10 lines · Mathieu Malaterre

The header pmac.h was not included, leading to the following warnings, treated as error with W=1:

arch/powerpc/platforms/powermac/time.c:69:13: error: no previous prototype for ‘pmac_time_init’ [-Werror=missing-prototypes] arch/powerpc/platforms/powermac/time.c:207:15: error: no previous prototype for ‘pmac_get_boot_time’ [-Werror=missing-prototypes] arch/powerpc/platforms/powermac/time.c:222:6: error: no previous prototype for ‘pmac_get_rtc_time’ [-Werror=missing-prototypes] arch/powerpc/platforms/powermac/time.c:240:5: error: no previous prototype for ‘pmac_set_rtc_time’ [-Werror=missing-prototypes] arch/powerpc/platforms/powermac/time.c:259:12: error: no previous prototype for ‘via_calibrate_decr’ [-Werror=missing-prototypes] arch/powerpc/platforms/powermac/time.c:311:13: error: no previous prototype for ‘pmac_calibrate_decr’ [-Werror=missing-prototypes]

Quoted 3 lines

The function via_calibrate_decr was made static to silence a warning.

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/2fff0f07b8441a481eb5fc0bfcd0e4

cheers

#89 lore raw

PATCH 17/19 powerpc/32: Add a missing include header

In reply to Mathieu Malaterre

The header file <linux/syscalls.h> was missing from the includes. Fix the following warning, treated as error with W=1:

arch/powerpc/kernel/pci_32.c:286:6: error: no previous prototype for ‘sys_pciconfig_iobase’ [-Werror=missing-prototypes]

---
 arch/powerpc/kernel/pci_32.c | 1 +
 1 file changed, 1 insertion(+)
arch/powerpc/kernel/pci_32.c +1 -0
index 85ad2f78b889..51cba7d7a4fd 100644
@@ -11,6 +11,7 @@
 #include <linux/sched.h>
 #include <linux/errno.h>
 #include <linux/bootmem.h>
+#include <linux/syscalls.h>
 #include <linux/irq.h>
 #include <linux/list.h>
 #include <linux/of.h>
Signature · 1 line
2.11.0
#90 lore raw

Re: [17/19] powerpc/32: Add a missing include header

Quoted 6 lines · Mathieu Malaterre

The header file <linux/syscalls.h> was missing from the includes. Fix the following warning, treated as error with W=1:

arch/powerpc/kernel/pci_32.c:286:6: error: no previous prototype for ‘sys_pciconfig_iobase’ [-Werror=missing-prototypes]

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/c89ca593220931c150cffda24b4d4c

cheers

#91 lore raw

PATCH 18/19 powerpc: Add a missing include header

In reply to Mathieu Malaterre

The header file <asm/switch_to.h> was missing from the includes. Fix the following warning, treated as error with W=1:

arch/powerpc/kernel/vecemu.c:260:5: error: no previous prototype for ‘emulate_altivec’ [-Werror=missing-prototypes]

---
 arch/powerpc/kernel/vecemu.c | 1 +
 1 file changed, 1 insertion(+)
arch/powerpc/kernel/vecemu.c +1 -0
index 8812085883fd..4acd3fb2b38e 100644
@@ -8,6 +8,7 @@
 #include <linux/sched.h>
 #include <asm/ptrace.h>
 #include <asm/processor.h>
+#include <asm/switch_to.h>
 #include <linux/uaccess.h>
 
 /* Functions in vector.S */
Signature · 1 line
2.11.0
#92 lore raw

Re: [18/19] powerpc: Add a missing include header

Quoted 6 lines · Mathieu Malaterre

The header file <asm/switch_to.h> was missing from the includes. Fix the following warning, treated as error with W=1:

arch/powerpc/kernel/vecemu.c:260:5: error: no previous prototype for ‘emulate_altivec’ [-Werror=missing-prototypes]

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/d647b210ac738b401c7f824bbebdcb

cheers

#93 lore raw

PATCH 19/19 powerpc/tau: Synchronize function prototypes and body

In reply to Mathieu Malaterre

Some function prototypes and body for Thermal Assist Units were not in sync. Update the function definition to match the existing function declaration found in setup-common.c, changing an int return type to a u32 return type. Move the prototypes to a header file. Fix the following warnings, treated as error with W=1:

arch/powerpc/kernel/tau_6xx.c:257:5: error: no previous prototype for ‘cpu_temp_both’ [-Werror=missing-prototypes] arch/powerpc/kernel/tau_6xx.c:262:5: error: no previous prototype for ‘cpu_temp’ [-Werror=missing-prototypes] arch/powerpc/kernel/tau_6xx.c:267:5: error: no previous prototype for ‘tau_interrupts’ [-Werror=missing-prototypes]

Compile tested with CONFIG_TAU_INT.

---
 arch/powerpc/kernel/irq.c          | 2 +-
 arch/powerpc/kernel/setup-common.c | 6 ------
 arch/powerpc/kernel/setup.h        | 6 ++++++
 arch/powerpc/kernel/tau_6xx.c      | 7 +++++--
 4 files changed, 12 insertions(+), 9 deletions(-)
arch/powerpc/kernel/irq.c +1 -1
index f88038847790..3777b6e09142 100644
@@ -89,7 +89,7 @@ atomic_t ppc_n_lost_interrupts;
 
 #ifdef CONFIG_TAU_INT
 extern int tau_initialized;
-extern int tau_interrupts(int);
+extern u32 tau_interrupts(unsigned long cpu);
 #endif
 #endif /* CONFIG_PPC32 */
 
arch/powerpc/kernel/setup-common.c +0 -6
index d73ec518ef80..bd3675c3984b 100644
@@ -192,12 +192,6 @@ void machine_halt(void)
 	machine_hang();
 }
 
-
-#ifdef CONFIG_TAU
-extern u32 cpu_temp(unsigned long cpu);
-extern u32 cpu_temp_both(unsigned long cpu);
-#endif /* CONFIG_TAU */
-
 #ifdef CONFIG_SMP
 DEFINE_PER_CPU(unsigned int, cpu_pvr);
 #endif
arch/powerpc/kernel/setup.h +6 -0
index d768023a04bd..3c9c19430439 100644
@@ -70,4 +70,10 @@ void kvm_cma_reserve(void);
 static inline void kvm_cma_reserve(void) { };
 #endif
 
+#ifdef CONFIG_TAU
+extern u32 cpu_temp(unsigned long cpu);
+extern u32 cpu_temp_both(unsigned long cpu);
+extern u32 tau_interrupts(unsigned long cpu);
+#endif /* CONFIG_TAU */
+
 #endif /* __ARCH_POWERPC_KERNEL_SETUP_H */
arch/powerpc/kernel/tau_6xx.c +5 -2
index 1fc6a89a978e..e2ab8a111b69 100644
@@ -27,6 +27,9 @@
 #include <asm/cache.h>
 #include <asm/8xx_immap.h>
 #include <asm/machdep.h>
+#include <asm/asm-prototypes.h>
+
+#include "setup.h"
 
 static struct tau_temp
 {
@@ -259,12 +262,12 @@ u32 cpu_temp_both(unsigned long cpu)
 	return ((tau[cpu].high << 16) | tau[cpu].low);
 }
 
-int cpu_temp(unsigned long cpu)
+u32 cpu_temp(unsigned long cpu)
 {
 	return ((tau[cpu].high + tau[cpu].low) / 2);
 }
 
-int tau_interrupts(unsigned long cpu)
+u32 tau_interrupts(unsigned long cpu)
 {
 	return (tau[cpu].interrupts);
 }
Signature · 1 line
2.11.0
#94 lore raw

Re: [PATCH 19/19] powerpc/tau: Synchronize function prototypes and body

Le 22/03/2018 à 21:20, Mathieu Malaterre a écrit :

Quoted 55 lines

Some function prototypes and body for Thermal Assist Units were not in sync. Update the function definition to match the existing function declaration found in setup-common.c, changing an int return type to a u32 return type. Move the prototypes to a header file. Fix the following warnings, treated as error with W=1:

arch/powerpc/kernel/tau_6xx.c:257:5: error: no previous prototype for ‘cpu_temp_both’ [-Werror=missing-prototypes] arch/powerpc/kernel/tau_6xx.c:262:5: error: no previous prototype for ‘cpu_temp’ [-Werror=missing-prototypes] arch/powerpc/kernel/tau_6xx.c:267:5: error: no previous prototype for ‘tau_interrupts’ [-Werror=missing-prototypes]

Compile tested with CONFIG_TAU_INT.

---
  arch/powerpc/kernel/irq.c          | 2 +-
  arch/powerpc/kernel/setup-common.c | 6 ------
  arch/powerpc/kernel/setup.h        | 6 ++++++
  arch/powerpc/kernel/tau_6xx.c      | 7 +++++--
  4 files changed, 12 insertions(+), 9 deletions(-)
arch/powerpc/kernel/irq.c +1 -1
index f88038847790..3777b6e09142 100644
@@ -89,7 +89,7 @@ atomic_t ppc_n_lost_interrupts;
 
  #ifdef CONFIG_TAU_INT
  extern int tau_initialized;
-extern int tau_interrupts(int);
+extern u32 tau_interrupts(unsigned long cpu);
  #endif
  #endif /* CONFIG_PPC32 */
 
arch/powerpc/kernel/setup-common.c +0 -6
index d73ec518ef80..bd3675c3984b 100644
@@ -192,12 +192,6 @@ void machine_halt(void)
  	machine_hang();
  }
 
-
-#ifdef CONFIG_TAU
-extern u32 cpu_temp(unsigned long cpu);
-extern u32 cpu_temp_both(unsigned long cpu);
-#endif /* CONFIG_TAU */
-
  #ifdef CONFIG_SMP
  DEFINE_PER_CPU(unsigned int, cpu_pvr);
  #endif
arch/powerpc/kernel/setup.h +0 -0
index d768023a04bd..3c9c19430439 100644

arch/powerpc/kernel/setup.h void kvm_cma_reserve(void); · line 76

Quoted 7 lines
arch/powerpc/kernel/setup.h +4 -0
@@ -70,4 +70,10 @@ void kvm_cma_reserve(void);
  static inline void kvm_cma_reserve(void) { };
  #endif
 
+#ifdef CONFIG_TAU
+extern u32 cpu_temp(unsigned long cpu);
+extern u32 cpu_temp_both(unsigned long cpu);
+extern u32 tau_interrupts(unsigned long cpu);

extern keyword is not needed

Christophe

Quoted 23 lines
arch/powerpc/kernel/setup.h +2 -0
+#endif /* CONFIG_TAU */
+
  #endif /* __ARCH_POWERPC_KERNEL_SETUP_H */
arch/powerpc/kernel/tau_6xx.c +3 -1
index 1fc6a89a978e..e2ab8a111b69 100644
@@ -27,6 +27,9 @@
  #include <asm/cache.h>
  #include <asm/8xx_immap.h>
  #include <asm/machdep.h>
+#include <asm/asm-prototypes.h>
+
+#include "setup.h"
 
  static struct tau_temp
  {
@@ -259,12 +262,12 @@ u32 cpu_temp_both(unsigned long cpu)
  	return ((tau[cpu].high << 16) | tau[cpu].low);
  }
 
-int cpu_temp(unsigned long cpu)

arch/powerpc/kernel/tau_6xx.c u32 cpu_temp_both(unsigned long cpu) · line 273

Quoted 10 lines
arch/powerpc/kernel/tau_6xx.c +2 -1
+u32 cpu_temp(unsigned long cpu)
  {
  	return ((tau[cpu].high + tau[cpu].low) / 2);
  }
 
-int tau_interrupts(unsigned long cpu)
+u32 tau_interrupts(unsigned long cpu)
  {
  	return (tau[cpu].interrupts);
  }

---
L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast.
https://www.avast.com/antivirus

#95 lore raw

PATCH v3 19/19 powerpc/tau: Synchronize function prototypes and body

In reply to Mathieu Malaterre

Some function prototypes and body for Thermal Assist Units were not in sync. Update the function definition to match the existing function declaration found in setup-common.c, changing an int return type to a u32 return type. Move the prototypes to a header file. Fix the following warnings, treated as error with W=1:

arch/powerpc/kernel/tau_6xx.c:257:5: error: no previous prototype for ‘cpu_temp_both’ [-Werror=missing-prototypes] arch/powerpc/kernel/tau_6xx.c:262:5: error: no previous prototype for ‘cpu_temp’ [-Werror=missing-prototypes] arch/powerpc/kernel/tau_6xx.c:267:5: error: no previous prototype for ‘tau_interrupts’ [-Werror=missing-prototypes]

Compile tested with CONFIG_TAU_INT.

---
v3: remove extern keyword
v2: no change

 arch/powerpc/kernel/irq.c          | 2 +-
 arch/powerpc/kernel/setup-common.c | 6 ------
 arch/powerpc/kernel/setup.h        | 6 ++++++
 arch/powerpc/kernel/tau_6xx.c      | 7 +++++--
 4 files changed, 12 insertions(+), 9 deletions(-)
arch/powerpc/kernel/irq.c +1 -1
index 061aa0f47bb1..bbf7ec582d60 100644
@@ -89,7 +89,7 @@ atomic_t ppc_n_lost_interrupts;
 
 #ifdef CONFIG_TAU_INT
 extern int tau_initialized;
-extern int tau_interrupts(int);
+u32 tau_interrupts(unsigned long cpu);
 #endif
 #endif /* CONFIG_PPC32 */
 
arch/powerpc/kernel/setup-common.c +0 -6
index d73ec518ef80..bd3675c3984b 100644
@@ -192,12 +192,6 @@ void machine_halt(void)
 	machine_hang();
 }
 
-
-#ifdef CONFIG_TAU
-extern u32 cpu_temp(unsigned long cpu);
-extern u32 cpu_temp_both(unsigned long cpu);
-#endif /* CONFIG_TAU */
-
 #ifdef CONFIG_SMP
 DEFINE_PER_CPU(unsigned int, cpu_pvr);
 #endif
arch/powerpc/kernel/setup.h +6 -0
index d768023a04bd..76845c925bf5 100644
@@ -70,4 +70,10 @@ void kvm_cma_reserve(void);
 static inline void kvm_cma_reserve(void) { };
 #endif
 
+#ifdef CONFIG_TAU
+u32 cpu_temp(unsigned long cpu);
+u32 cpu_temp_both(unsigned long cpu);
+u32 tau_interrupts(unsigned long cpu);
+#endif /* CONFIG_TAU */
+
 #endif /* __ARCH_POWERPC_KERNEL_SETUP_H */
arch/powerpc/kernel/tau_6xx.c +5 -2
index 1fc6a89a978e..e2ab8a111b69 100644
@@ -27,6 +27,9 @@
 #include <asm/cache.h>
 #include <asm/8xx_immap.h>
 #include <asm/machdep.h>
+#include <asm/asm-prototypes.h>
+
+#include "setup.h"
 
 static struct tau_temp
 {
@@ -259,12 +262,12 @@ u32 cpu_temp_both(unsigned long cpu)
 	return ((tau[cpu].high << 16) | tau[cpu].low);
 }
 
-int cpu_temp(unsigned long cpu)
+u32 cpu_temp(unsigned long cpu)
 {
 	return ((tau[cpu].high + tau[cpu].low) / 2);
 }
 
-int tau_interrupts(unsigned long cpu)
+u32 tau_interrupts(unsigned long cpu)
 {
 	return (tau[cpu].interrupts);
 }
Signature · 1 line
2.11.0
#96 lore raw

Re: [v3,19/19] powerpc/tau: Synchronize function prototypes and body

Quoted 6 lines · Mathieu Malaterre

Some function prototypes and body for Thermal Assist Units were not in sync. Update the function definition to match the existing function declaration found in setup-common.c, changing an int return type to a u32 return type. Move the prototypes to a header file. Fix the following warnings, treated as error with W=1:

Quoted 8 lines

arch/powerpc/kernel/tau_6xx.c:257:5: error: no previous prototype for ‘cpu_temp_both’ [-Werror=missing-prototypes] arch/powerpc/kernel/tau_6xx.c:262:5: error: no previous prototype for ‘cpu_temp’ [-Werror=missing-prototypes] arch/powerpc/kernel/tau_6xx.c:267:5: error: no previous prototype for ‘tau_interrupts’ [-Werror=missing-prototypes]

Compile tested with CONFIG_TAU_INT.

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/bd13ac95f954570e01fba5a6caf771

cheers

#97 lore raw
In reply to Mathieu Malaterre

Any chance this could be applied to powerpc/next ?

Quoted 61 lines · Mathieu Malaterre

Here is another batch for warnings treated as error on ppc32. Tested with:

$ make ARCH=powerpc ppc32_defconfig
$ make -j8 ARCH=powerpc CROSS_COMPILE=powerpc-linux-gnu- W=1

Using:

$ powerpc-linux-gnu-gcc --version
powerpc-linux-gnu-gcc (Debian 6.3.0-18) 6.3.0 20170516

Mathieu Malaterre (19):
powerpc/powermac: Mark variable x as unused powerpc/powermac: Mark variable x as unused
powerpc: Mark variables as unused
powerpc/kvm: Mark variable tmp unused powerpc/chrp/setup: Add attribute unused and make some functions
static
powerpc: Make function btext_initialize static powerpc/powermac: Make some functions static powerpc/tau: Make some function static powerpc/chrp/pci: Make some functions static powerpc/chrp/time: Make some functions static, add missing header
include
powerpc/powermac: Move pmac_pfunc_base_install prototype to header
file
powerpc/powermac: Add missing prototype for note_bootable_part() powerpc/52xx: Add missing functions prototypes powerpc/altivec: Add missing prototypes for altivec
powerpc: Add missing prototype
powerpc/powermac: Add missing include of header pmac.h powerpc/32: Add a missing include header
powerpc: Add a missing include header
powerpc/tau: Synchronize function prototypes and body

 arch/powerpc/include/asm/mpc52xx.h           |  6 +++---
 arch/powerpc/include/asm/pmac_pfunc.h        |  1 +
 arch/powerpc/include/asm/rheap.h             |  3 +++
 arch/powerpc/kernel/btext.c                  |  2 +-
 arch/powerpc/kernel/irq.c                    |  2 +-
 arch/powerpc/kernel/kvm.c                    |  2 +-
 arch/powerpc/kernel/pci_32.c                 |  1 +
 arch/powerpc/kernel/prom_init.c              |  4 ++--
 arch/powerpc/kernel/setup-common.c           |  6 ------
 arch/powerpc/kernel/setup.h                  |  6 ++++++
 arch/powerpc/kernel/tau_6xx.c                | 15 +++++++++------
 arch/powerpc/kernel/vecemu.c                 |  1 +
 arch/powerpc/lib/xor_vmx.h                   | 14 ++++++++++++++
 arch/powerpc/platforms/chrp/pci.c            |  8 ++++----
 arch/powerpc/platforms/chrp/setup.c          | 10 +++++-----
 arch/powerpc/platforms/chrp/time.c           |  6 ++++--
 arch/powerpc/platforms/powermac/bootx_init.c |  2 +-
 arch/powerpc/platforms/powermac/pci.c        | 10 +++++-----
 arch/powerpc/platforms/powermac/setup.c      |  1 +
 arch/powerpc/platforms/powermac/smp.c        |  1 -
 arch/powerpc/platforms/powermac/time.c       |  4 +++-
 arch/powerpc/platforms/powermac/udbg_scc.c   |  2 +-
 22 files changed, 67 insertions(+), 40 deletions(-)

--
2.11.0