Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935444Ab2JaLWp (ORCPT ); Wed, 31 Oct 2012 07:22:45 -0400 Received: from mail-da0-f46.google.com ([209.85.210.46]:63014 "EHLO mail-da0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964984Ab2JaLWk (ORCPT ); Wed, 31 Oct 2012 07:22:40 -0400 Message-ID: <509109F9.3030904@gmail.com> Date: Wed, 31 Oct 2012 19:22:33 +0800 From: Shan Wei User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:16.0) Gecko/20121026 Thunderbird/16.0.2 MIME-Version: 1.0 To: steffen.klassert@secunet.com, David Miller , NetDev , Herbert Xu , Kernel-Maillist , cl@linux-foundation.org Subject: [PATCH 3/9] net: xfrm: use this_cpu_ptr per-cpu helper Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1143 Lines: 38 From: Shan Wei Signed-off-by: Shan Wei --- net/xfrm/xfrm_ipcomp.c | 7 +++---- 1 files changed, 3 insertions(+), 4 deletions(-) diff --git a/net/xfrm/xfrm_ipcomp.c b/net/xfrm/xfrm_ipcomp.c index e5246fb..af6c78a 100644 --- a/net/xfrm/xfrm_ipcomp.c +++ b/net/xfrm/xfrm_ipcomp.c @@ -276,14 +276,13 @@ 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); + + /* This can be any valid CPU ID so we don't need locking. */ + tfm = *this_cpu_ptr(tfms); if (!strcmp(crypto_comp_name(tfm), alg_name)) { pos->users++; -- 1.7.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/