aboutsummaryrefslogtreecommitdiff
path: root/drivers/infiniband/sw/siw/siw_main.c
diff options
context:
space:
mode:
authorJason Gunthorpe2019-07-08 11:36:32 -0300
committerJason Gunthorpe2019-07-08 11:52:50 -0300
commit4c7d6dcd364843e408a60952ba914bb72bafc6cc (patch)
tree9b4dbbaa44b2682d9c8bbecbeb754a90e9379c82 /drivers/infiniband/sw/siw/siw_main.c
parentd3e5397169175628696e92191dfc0e86d8e48db9 (diff)
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: b9be6f18cf9e ("rdma/siw: transmit path") Fixes: bdcf26bf9b3a ("rdma/siw: network and RDMA core interface") Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'drivers/infiniband/sw/siw/siw_main.c')
-rw-r--r--drivers/infiniband/sw/siw/siw_main.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/infiniband/sw/siw/siw_main.c b/drivers/infiniband/sw/siw/siw_main.c
index 3f5f3d27ebe5..fd2552a9091d 100644
--- a/drivers/infiniband/sw/siw/siw_main.c
+++ b/drivers/infiniband/sw/siw/siw_main.c
@@ -126,7 +126,7 @@ static int siw_dev_qualified(struct net_device *netdev)
return 0;
}
-static DEFINE_PER_CPU(atomic_t, use_cnt = ATOMIC_INIT(0));
+static DEFINE_PER_CPU(atomic_t, siw_use_cnt);
static struct {
struct cpumask **tx_valid_cpus;
@@ -215,7 +215,7 @@ int siw_get_tx_cpu(struct siw_device *sdev)
if (!siw_tx_thread[cpu])
continue;
- usage = atomic_read(&per_cpu(use_cnt, cpu));
+ usage = atomic_read(&per_cpu(siw_use_cnt, cpu));
if (usage <= min_use) {
tx_cpu = cpu;
min_use = usage;
@@ -226,7 +226,7 @@ int siw_get_tx_cpu(struct siw_device *sdev)
out:
if (tx_cpu >= 0)
- atomic_inc(&per_cpu(use_cnt, tx_cpu));
+ atomic_inc(&per_cpu(siw_use_cnt, tx_cpu));
else
pr_warn("siw: no tx cpu found\n");
@@ -235,7 +235,7 @@ out:
void siw_put_tx_cpu(int cpu)
{
- atomic_dec(&per_cpu(use_cnt, cpu));
+ atomic_dec(&per_cpu(siw_use_cnt, cpu));
}
static struct ib_qp *siw_get_base_qp(struct ib_device *base_dev, int id)