From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752837Ab3HZUvp (ORCPT ); Mon, 26 Aug 2013 16:51:45 -0400 Received: from a9-62.smtp-out.amazonses.com ([54.240.9.62]:35723 "EHLO a9-62.smtp-out.amazonses.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752288Ab3HZUvg (ORCPT ); Mon, 26 Aug 2013 16:51:36 -0400 X-Greylist: delayed 420 seconds by postgrey-1.27 at vger.kernel.org; Mon, 26 Aug 2013 16:51:36 EDT Message-ID: <00000140bc5ef60d-53835641-c635-437c-8d40-3d5234d1b389-000000@email.amazonses.com> User-Agent: quilt/0.50-1 Date: Mon, 26 Aug 2013 20:44:34 +0000 From: Christoph Lameter To: Tejun Heo Cc: akpm@linuxfoundation.org Cc: linux-arch@vger.kernel.org Cc: Steven Rostedt Cc: linux-kernel@vger.kernel.org Subject: [guv v2 03/31] Coccinelle script for __get_cpu_var conversion References: <20130826204351.725357339@linux.com> X-SES-Outgoing: 2013.08.26-54.240.9.62 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Much of the work was done by this coccinelle script. Wont catch everything (since coccinelle aborts when it no longer can make sense out of macros, sigh) but it covers a lot of ground. Signed-off-by: Christoph Lameter Index: linux/scripts/coccinelle/convert/__get_cpu_var.cocci =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ linux/scripts/coccinelle/convert/__get_cpu_var.cocci 2013-08-22 14:41:13.976518846 -0500 @@ -0,0 +1,70 @@ +// Convert all &__get_cpu_var to this_cpu_ptr +// +// _get_cpu_var is defined as: +// +// #define __get_cpu_var(var) (*this_cpu_ptr(&(var))) +// +//&__get_cpu_var() is therefore +// +// this_cpu_ptr(&var); +// +// The use of this_cpu_ptr() instead of __get_cpu_var clarifies +// that we are relocating a per cpu offset and that there are +// no get/put semantics involved. +// +// +// Convert all &__get_cpu_vars (and also related functions) +// to this_cpu_ptr(). Multiple transformations are provided +// to be able to beautify the source a bit. +// +// Christoph Lameter August 20, 2013 +// + +@A@ expression E; @@ + +... +-(&__get_cpu_var(E)) ++this_cpu_ptr(&E) +... + +@B@ expression E; @@ + +... +-(&__raw_get_cpu_var(E)) ++__this_cpu_ptr(&E) +... + +@C@ expression E; @@ + +... +-&__get_cpu_var(E) ++this_cpu_ptr(&E) +... + +@D@ expression E; @@ + +... +-&__raw_get_cpu_var(E) ++__this_cpu_ptr(&E) +... + +@A2@ expression E; @@ + +-(&__get_cpu_var(E)) ++this_cpu_ptr(&E) + +@B2@ expression E; @@ + +-(&__raw_get_cpu_var(E)) ++__this_cpu_ptr(&E) + +@C2@ expression E; @@ + +-&__get_cpu_var(E) ++this_cpu_ptr(&E) + +@D2@ expression E; @@ + +-&__raw_get_cpu_var(E) ++__this_cpu_ptr(&E) + From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Lameter Subject: [guv v2 03/31] Coccinelle script for __get_cpu_var conversion Date: Mon, 26 Aug 2013 20:44:34 +0000 Message-ID: <00000140bc5ef60d-53835641-c635-437c-8d40-3d5234d1b389-000000@email.amazonses.com> References: <20130826204351.725357339@linux.com> Return-path: Received: from a9-62.smtp-out.amazonses.com ([54.240.9.62]:35723 "EHLO a9-62.smtp-out.amazonses.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752288Ab3HZUvg (ORCPT ); Mon, 26 Aug 2013 16:51:36 -0400 Sender: linux-arch-owner@vger.kernel.org List-ID: To: Tejun Heo Cc: akpm@linuxfoundation.org, linux-arch@vger.kernel.org, Steven Rostedt , linux-kernel@vger.kernel.org Much of the work was done by this coccinelle script. Wont catch everything (since coccinelle aborts when it no longer can make sense out of macros, sigh) but it covers a lot of ground. Signed-off-by: Christoph Lameter Index: linux/scripts/coccinelle/convert/__get_cpu_var.cocci =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ linux/scripts/coccinelle/convert/__get_cpu_var.cocci 2013-08-22 14:41:13.976518846 -0500 @@ -0,0 +1,70 @@ +// Convert all &__get_cpu_var to this_cpu_ptr +// +// _get_cpu_var is defined as: +// +// #define __get_cpu_var(var) (*this_cpu_ptr(&(var))) +// +//&__get_cpu_var() is therefore +// +// this_cpu_ptr(&var); +// +// The use of this_cpu_ptr() instead of __get_cpu_var clarifies +// that we are relocating a per cpu offset and that there are +// no get/put semantics involved. +// +// +// Convert all &__get_cpu_vars (and also related functions) +// to this_cpu_ptr(). Multiple transformations are provided +// to be able to beautify the source a bit. +// +// Christoph Lameter August 20, 2013 +// + +@A@ expression E; @@ + +... +-(&__get_cpu_var(E)) ++this_cpu_ptr(&E) +... + +@B@ expression E; @@ + +... +-(&__raw_get_cpu_var(E)) ++__this_cpu_ptr(&E) +... + +@C@ expression E; @@ + +... +-&__get_cpu_var(E) ++this_cpu_ptr(&E) +... + +@D@ expression E; @@ + +... +-&__raw_get_cpu_var(E) ++__this_cpu_ptr(&E) +... + +@A2@ expression E; @@ + +-(&__get_cpu_var(E)) ++this_cpu_ptr(&E) + +@B2@ expression E; @@ + +-(&__raw_get_cpu_var(E)) ++__this_cpu_ptr(&E) + +@C2@ expression E; @@ + +-&__get_cpu_var(E) ++this_cpu_ptr(&E) + +@D2@ expression E; @@ + +-&__raw_get_cpu_var(E) ++__this_cpu_ptr(&E) +