[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <509C688B.5010502@gmail.com>
Date: Fri, 09 Nov 2012 10:20:59 +0800
From: Shan Wei <shanwei88@...il.com>
To: steffen.klassert@...unet.com, David Miller <davem@...emloft.net>,
NetDev <netdev@...r.kernel.org>,
Herbert Xu <herbert@...dor.apana.org.au>,
Kernel-Maillist <linux-kernel@...r.kernel.org>,
cl@...ux-foundation.org, Shan Wei <shanwei88@...il.com>
Subject: [PATCH v3 3/9] net: xfrm: use __this_cpu_read per-cpu helper
From: Shan Wei <davidshan@...cent.com>
Signed-off-by: Shan Wei <davidshan@...cent.com>
---
v3 fix compile warning:
net/xfrm/xfrm_ipcomp.c: In function 'ipcomp_alloc_tfms':
net/xfrm/xfrm_ipcomp.c:285: warning: assignment from incompatible pointer type
---
net/xfrm/xfrm_ipcomp.c | 7 ++-----
1 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/net/xfrm/xfrm_ipcomp.c b/net/xfrm/xfrm_ipcomp.c
index e5246fb..898c899 100644
--- a/net/xfrm/xfrm_ipcomp.c
+++ b/net/xfrm/xfrm_ipcomp.c
@@ -276,18 +276,15 @@ static struct crypto_comp * __percpu *ipcomp_alloc_tfms(const char *alg_name)
struct crypto_comp * __percpu *tfms;
int cpu;
- /* This can be any valid CPU ID so we don't need locking. */
- cpu = raw_smp_processor_id();
list_for_each_entry(pos, &ipcomp_tfms_list, list) {
struct crypto_comp *tfm;
- tfms = pos->tfms;
- tfm = *per_cpu_ptr(tfms, cpu);
+ tfm = (struct crypto_comp *) __this_cpu_read(pos->tfms);
if (!strcmp(crypto_comp_name(tfm), alg_name)) {
pos->users++;
- return tfms;
+ return pos->tfms;
}
}
--
1.7.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists