]> git.baikalelectronics.ru Git - kernel.git/commit
RDMA/siw: Fix DEFINE_PER_CPU compilation when ARCH_NEEDS_WEAK_PER_CPU
authorJason Gunthorpe <jgg@mellanox.com>
Mon, 8 Jul 2019 14:36:32 +0000 (11:36 -0300)
committerJason Gunthorpe <jgg@mellanox.com>
Mon, 8 Jul 2019 14:52:50 +0000 (11:52 -0300)
commitb9b91f20f9a92edeffd730c9887a453ea1d3e073
tree9b4dbbaa44b2682d9c8bbecbeb754a90e9379c82
parentbad92310ea68e242a819be9886a3f285e1767e7b
RDMA/siw: Fix DEFINE_PER_CPU compilation when ARCH_NEEDS_WEAK_PER_CPU

The initializer for the variable cannot be inside the macro (and zero
initialization isn't needed anyhow).

include/linux/percpu-defs.h:92:33: warning: '__pcpu_unique_use_cnt' initialized and declared 'extern'
  extern __PCPU_DUMMY_ATTRS char __pcpu_unique_##name;  \
                                 ^~~~~~~~~~~~~~
include/linux/percpu-defs.h:115:2: note: in expansion of macro 'DEFINE_PER_CPU_SECTION'
  DEFINE_PER_CPU_SECTION(type, name, "")
  ^~~~~~~~~~~~~~~~~~~~~~
drivers/infiniband/sw/siw/siw_main.c:129:8: note: in expansion of macro 'DEFINE_PER_CPU'
 static DEFINE_PER_CPU(atomic_t, use_cnt = ATOMIC_INIT(0));
        ^~~~~~~~~~~~~~

Also the rules for PER_CPU require the variable names to be globally
unique, so prefix them with siw_

Fixes: 43654ff73ad1 ("rdma/siw: transmit path")
Fixes: f8c4999b094d ("rdma/siw: network and RDMA core interface")
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/sw/siw/siw_main.c
drivers/infiniband/sw/siw/siw_qp_tx.c