diff mbox series

[07/12] s390: cio: fix cio_irb declaration

Message ID 20190408212648.2407234-7-arnd@arndb.de
State Accepted
Commit e91012ee855ad9f5ef2ab106a3de51db93fe4d0c
Headers show
Series [01/12] s390: remove -fno-strength-reduce flag | expand

Commit Message

Arnd Bergmann April 8, 2019, 9:26 p.m. UTC
clang points out that the declaration of cio_irb does not match the
definition exactly, it is missing the alignment attribute:

../drivers/s390/cio/cio.c:50:1: warning: section does not match previous declaration [-Wsection]
DEFINE_PER_CPU_ALIGNED(struct irb, cio_irb);
^
../include/linux/percpu-defs.h:150:2: note: expanded from macro 'DEFINE_PER_CPU_ALIGNED'
        DEFINE_PER_CPU_SECTION(type, name, PER_CPU_ALIGNED_SECTION)     \
        ^
../include/linux/percpu-defs.h:93:9: note: expanded from macro 'DEFINE_PER_CPU_SECTION'
        extern __PCPU_ATTRS(sec) __typeof__(type) name;                 \
               ^
../include/linux/percpu-defs.h:49:26: note: expanded from macro '__PCPU_ATTRS'
        __percpu __attribute__((section(PER_CPU_BASE_SECTION sec)))     \
                                ^
../drivers/s390/cio/cio.h:118:1: note: previous attribute is here
DECLARE_PER_CPU(struct irb, cio_irb);
^
../include/linux/percpu-defs.h:111:2: note: expanded from macro 'DECLARE_PER_CPU'
        DECLARE_PER_CPU_SECTION(type, name, "")
        ^
../include/linux/percpu-defs.h:87:9: note: expanded from macro 'DECLARE_PER_CPU_SECTION'
        extern __PCPU_ATTRS(sec) __typeof__(type) name
               ^
../include/linux/percpu-defs.h:49:26: note: expanded from macro '__PCPU_ATTRS'
        __percpu __attribute__((section(PER_CPU_BASE_SECTION sec)))     \
                                ^
Use DECLARE_PER_CPU_ALIGNED() here, to make the two match.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>

---
 drivers/s390/cio/cio.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.20.0

Comments

Nathan Chancellor April 8, 2019, 10:35 p.m. UTC | #1
On Mon, Apr 08, 2019 at 11:26:20PM +0200, Arnd Bergmann wrote:
> clang points out that the declaration of cio_irb does not match the

> definition exactly, it is missing the alignment attribute:

> 

> ../drivers/s390/cio/cio.c:50:1: warning: section does not match previous declaration [-Wsection]

> DEFINE_PER_CPU_ALIGNED(struct irb, cio_irb);

> ^

> ../include/linux/percpu-defs.h:150:2: note: expanded from macro 'DEFINE_PER_CPU_ALIGNED'

>         DEFINE_PER_CPU_SECTION(type, name, PER_CPU_ALIGNED_SECTION)     \

>         ^

> ../include/linux/percpu-defs.h:93:9: note: expanded from macro 'DEFINE_PER_CPU_SECTION'

>         extern __PCPU_ATTRS(sec) __typeof__(type) name;                 \

>                ^

> ../include/linux/percpu-defs.h:49:26: note: expanded from macro '__PCPU_ATTRS'

>         __percpu __attribute__((section(PER_CPU_BASE_SECTION sec)))     \

>                                 ^

> ../drivers/s390/cio/cio.h:118:1: note: previous attribute is here

> DECLARE_PER_CPU(struct irb, cio_irb);

> ^

> ../include/linux/percpu-defs.h:111:2: note: expanded from macro 'DECLARE_PER_CPU'

>         DECLARE_PER_CPU_SECTION(type, name, "")

>         ^

> ../include/linux/percpu-defs.h:87:9: note: expanded from macro 'DECLARE_PER_CPU_SECTION'

>         extern __PCPU_ATTRS(sec) __typeof__(type) name

>                ^

> ../include/linux/percpu-defs.h:49:26: note: expanded from macro '__PCPU_ATTRS'

>         __percpu __attribute__((section(PER_CPU_BASE_SECTION sec)))     \

>                                 ^

> Use DECLARE_PER_CPU_ALIGNED() here, to make the two match.

> 

> Signed-off-by: Arnd Bergmann <arnd@arndb.de>


Reviewed-by: Nathan Chancellor <natechancellor@gmail.com>


> ---

>  drivers/s390/cio/cio.h | 2 +-

>  1 file changed, 1 insertion(+), 1 deletion(-)

> 

> diff --git a/drivers/s390/cio/cio.h b/drivers/s390/cio/cio.h

> index 9811fd8a0c73..92eabbb5f18d 100644

> --- a/drivers/s390/cio/cio.h

> +++ b/drivers/s390/cio/cio.h

> @@ -115,7 +115,7 @@ struct subchannel {

>  	struct schib_config config;

>  } __attribute__ ((aligned(8)));

>  

> -DECLARE_PER_CPU(struct irb, cio_irb);

> +DECLARE_PER_CPU_ALIGNED(struct irb, cio_irb);

>  

>  #define to_subchannel(n) container_of(n, struct subchannel, dev)

>  

> -- 

> 2.20.0

>
Sebastian Ott April 9, 2019, 1:13 p.m. UTC | #2
On Mon, 8 Apr 2019, Arnd Bergmann wrote:
> clang points out that the declaration of cio_irb does not match the

> definition exactly, it is missing the alignment attribute:

> 

> ../drivers/s390/cio/cio.c:50:1: warning: section does not match previous declaration [-Wsection]

> DEFINE_PER_CPU_ALIGNED(struct irb, cio_irb);

> ^

> ../include/linux/percpu-defs.h:150:2: note: expanded from macro 'DEFINE_PER_CPU_ALIGNED'

>         DEFINE_PER_CPU_SECTION(type, name, PER_CPU_ALIGNED_SECTION)     \

>         ^

> ../include/linux/percpu-defs.h:93:9: note: expanded from macro 'DEFINE_PER_CPU_SECTION'

>         extern __PCPU_ATTRS(sec) __typeof__(type) name;                 \

>                ^

> ../include/linux/percpu-defs.h:49:26: note: expanded from macro '__PCPU_ATTRS'

>         __percpu __attribute__((section(PER_CPU_BASE_SECTION sec)))     \

>                                 ^

> ../drivers/s390/cio/cio.h:118:1: note: previous attribute is here

> DECLARE_PER_CPU(struct irb, cio_irb);

> ^

> ../include/linux/percpu-defs.h:111:2: note: expanded from macro 'DECLARE_PER_CPU'

>         DECLARE_PER_CPU_SECTION(type, name, "")

>         ^

> ../include/linux/percpu-defs.h:87:9: note: expanded from macro 'DECLARE_PER_CPU_SECTION'

>         extern __PCPU_ATTRS(sec) __typeof__(type) name

>                ^

> ../include/linux/percpu-defs.h:49:26: note: expanded from macro '__PCPU_ATTRS'

>         __percpu __attribute__((section(PER_CPU_BASE_SECTION sec)))     \

>                                 ^

> Use DECLARE_PER_CPU_ALIGNED() here, to make the two match.

> 

> Signed-off-by: Arnd Bergmann <arnd@arndb.de>


Thanks for the patch! Applied.
Sebastian
diff mbox series

Patch

diff --git a/drivers/s390/cio/cio.h b/drivers/s390/cio/cio.h
index 9811fd8a0c73..92eabbb5f18d 100644
--- a/drivers/s390/cio/cio.h
+++ b/drivers/s390/cio/cio.h
@@ -115,7 +115,7 @@  struct subchannel {
 	struct schib_config config;
 } __attribute__ ((aligned(8)));
 
-DECLARE_PER_CPU(struct irb, cio_irb);
+DECLARE_PER_CPU_ALIGNED(struct irb, cio_irb);
 
 #define to_subchannel(n) container_of(n, struct subchannel, dev)