From patchwork Mon Aug 21 14:05:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhumika Goyal X-Patchwork-Id: 9912653 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 022E7608A6 for ; Mon, 21 Aug 2017 14:07:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ED23628798 for ; Mon, 21 Aug 2017 14:07:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E1C77287AB; Mon, 21 Aug 2017 14:07:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, DKIM_VALID, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 97CA42879A for ; Mon, 21 Aug 2017 14:07:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=QcDZd53qqvYCac4QzooBQ+5AHzG1KEVa6jOWZR5c1Ds=; b=KK7 r9RoghnEYr0rZVbBCcwYL0LMQA8nCVORyz1KMRyY8oprRI/byKyV3oWHTtfaqs76FA6SoVy3SSPJ5 BEUsOvKOVMS8tjSEVTRN+2pacVeYX+VQFgZVfhkR2u61Wjip+0n/LtBrs8W1rq6I839mlhLbOZQ7m 0epKv3NKyspAVe78XJQjgMIgzPmOeBEsPXGsqCowghgrG25dxnOObAKoL1/vW33gKkex5EYGwV28D 0dKgGAZPhJW1jf/ZmT1hL5WlOXiylINg4sRuyDfNe13ShYqwr/suo/fGtveYhr2E778KdGf+LMee4 Se8pzER9xZiOnJhnqCz7vLx5EcfToAQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1djnMZ-000614-E0; Mon, 21 Aug 2017 14:07:31 +0000 Received: from mail-pg0-x243.google.com ([2607:f8b0:400e:c05::243]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1djnLE-0004qY-Ii for linux-arm-kernel@lists.infradead.org; Mon, 21 Aug 2017 14:06:15 +0000 Received: by mail-pg0-x243.google.com with SMTP id y129so23967421pgy.3 for ; Mon, 21 Aug 2017 07:05:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=j7alCaTN26iouo7wM96UL4u0TRO269oBdwrfIxzb54A=; b=V7EVVsyv1WPjU7AIna7ei0+EoVVpwmRtXQ1n83CWdxsZT+D18hiOX+kVqbHAOHtfKb OZzqP/lW1YbWoqhPO7qRk8eBtLnOIcCsbsFBEgaWar4vgYFRv66043qBlXh5Eggdy4MM zDDMlaNN1tuJNRaxK1GBe1Yl0oC3x/VwY9tlj0QWWrLXaIRUMZiJNk6jcxev53k8/3ky KCKt39+V/5/HPQmJLka8Gp0EkM7ZZ4PuGT0S4ZPieAnOctA0EQKGQJgcwYovdgqbK4UQ NU2EfbPxTzDo2KeGcHsdQrMpEZZE2uVDEKWmMSiemgFyBALHYYTHAoKAPLQqmnFnOgr+ kH6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=j7alCaTN26iouo7wM96UL4u0TRO269oBdwrfIxzb54A=; b=FtUHcoocx6QlXTLm4S4ikxaXftz6ZfcdMaGcEEWtyBajJ01NbGtc3wvLUMzLlXm0g5 Xeg+ioLPh84u4askHhL2I283CkmJMhLyiILXzFq98Gl/+l60K58UHuVCsqWJA/uzn/BK Di2LWhIs9OYxHkXFWeRyZmcAjxWdYJe+sv/j9DYcEMhOkd0H41hs5EoguHS57ay0Qd+C 8u/JpCIidNIJlaLfdi3+q5GTbyH0NZpahgIPOYyugcJTx1EIkbkf/gJZWNswNFr2cF4G E2kLUsnlubbb61uEmz1xh3csjXI0FkmmprUH1IZeAQ3vXi2a7lwVv4NvIrJo2eYyVZyN N0Jw== X-Gm-Message-State: AHYfb5hifcjRX0C5QxGiUAhrh1s46yobnYi51vdoeAKRGDBxzW+O+HF6 r9/WRgGVOdL0Ow== X-Received: by 10.84.167.2 with SMTP id c2mr19094877plb.330.1503324347769; Mon, 21 Aug 2017 07:05:47 -0700 (PDT) Received: from gmail.com ([117.196.124.19]) by smtp.gmail.com with ESMTPSA id h62sm26004075pfc.97.2017.08.21.07.05.41 (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 21 Aug 2017 07:05:47 -0700 (PDT) Received: by gmail.com (sSMTP sendmail emulation); Mon, 21 Aug 2017 19:35:38 +0530 From: Bhumika Goyal To: julia.lawall@lip6.fr, daniel@zonque.org, robert.jarzmik@free.fr, linux@armlinux.org.uk, marek.vasut@gmail.com, sleep_walker@suse.com, slapin@ossfans.org, haojian.zhuang@gmail.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] ARM: pxa: make matrix_keymap_data const Date: Mon, 21 Aug 2017 19:35:28 +0530 Message-Id: <1503324328-32007-1-git-send-email-bhumirks@gmail.com> X-Mailer: git-send-email 1.9.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170821_070609_311480_92CA9B41 X-CRM114-Status: GOOD ( 11.66 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Bhumika Goyal MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Make these const as they are only stored in the const fields of pxa27x_keypad_platform_data or matrix_keypad_platform_data structures. Done using Coccinelle: @match disable optional_qualifier@ identifier s; @@ static struct matrix_keymap_data s = {...}; @ref@ position p; identifier match.s; @@ s@p @good1@ identifier y; position ref.p; identifier match.s; @@ struct matrix_keypad_platform_data y = {...,.keymap_data=&s@p,...}; @good2@ struct matrix_keypad_platform_data y; identifier match.s; position ref.p; @@ y.keymap_data = &s@p @good3@ identifier y; position ref.p; identifier match.s; @@ struct pxa27x_keypad_platform_data y = {...,.matrix_keymap_data=&s@p,...}; @good4@ struct pxa27x_keypad_platform_data y; identifier match.s; position ref.p; @@ y.matrix_keymap_data = &s@p @bad depends on !good1 && !good2 && !good3 && !good4@ position ref.p; identifier match.s; @@ s@p @depends on forall !bad disable optional_qualifier@ identifier match.s; @@ static + const struct matrix_keymap_data s; Signed-off-by: Bhumika Goyal --- arch/arm/mach-pxa/corgi.c | 2 +- arch/arm/mach-pxa/em-x270.c | 4 ++-- arch/arm/mach-pxa/ezx.c | 12 ++++++------ arch/arm/mach-pxa/littleton.c | 2 +- arch/arm/mach-pxa/mainstone.c | 2 +- arch/arm/mach-pxa/mioa701.c | 2 +- arch/arm/mach-pxa/palmld.c | 2 +- arch/arm/mach-pxa/palmt5.c | 2 +- arch/arm/mach-pxa/palmtreo.c | 4 ++-- arch/arm/mach-pxa/palmtx.c | 2 +- arch/arm/mach-pxa/palmz72.c | 2 +- arch/arm/mach-pxa/tavorevb.c | 2 +- arch/arm/mach-pxa/tosa.c | 2 +- arch/arm/mach-pxa/z2.c | 2 +- arch/arm/mach-pxa/zylonite.c | 2 +- 15 files changed, 22 insertions(+), 22 deletions(-) diff --git a/arch/arm/mach-pxa/corgi.c b/arch/arm/mach-pxa/corgi.c index 7270f0d..4393b9b 100644 --- a/arch/arm/mach-pxa/corgi.c +++ b/arch/arm/mach-pxa/corgi.c @@ -380,7 +380,7 @@ struct platform_device corgiscoop_device = { KEY(7, 4, CORGI_KEY_EXJOGUP), }; -static struct matrix_keymap_data corgikbd_keymap_data = { +static const struct matrix_keymap_data corgikbd_keymap_data = { .keymap = corgikbd_keymap, .keymap_size = ARRAY_SIZE(corgikbd_keymap), }; diff --git a/arch/arm/mach-pxa/em-x270.c b/arch/arm/mach-pxa/em-x270.c index 811a731..8619140 100644 --- a/arch/arm/mach-pxa/em-x270.c +++ b/arch/arm/mach-pxa/em-x270.c @@ -846,7 +846,7 @@ static inline void em_x270_init_ac97(void) {} KEY(0, 1, KEY_C), KEY(1, 2, KEY_DOWN), KEY(2, 2, KEY_D), }; -static struct matrix_keymap_data em_x270_matrix_keymap_data = { +static const struct matrix_keymap_data em_x270_matrix_keymap_data = { .keymap = em_x270_module_matrix_keys, .keymap_size = ARRAY_SIZE(em_x270_module_matrix_keys), }; @@ -900,7 +900,7 @@ struct pxa27x_keypad_platform_data em_x270_module_keypad_info = { KEY(7, 6, 0), KEY(7, 7, 0), }; -static struct matrix_keymap_data em_x270_exeda_matrix_keymap_data = { +static const struct matrix_keymap_data em_x270_exeda_matrix_keymap_data = { .keymap = em_x270_exeda_matrix_keys, .keymap_size = ARRAY_SIZE(em_x270_exeda_matrix_keys), }; diff --git a/arch/arm/mach-pxa/ezx.c b/arch/arm/mach-pxa/ezx.c index a057cf9..e87f137 100644 --- a/arch/arm/mach-pxa/ezx.c +++ b/arch/arm/mach-pxa/ezx.c @@ -429,7 +429,7 @@ KEY(4, 4, KEY_DOWN), }; -static struct matrix_keymap_data a780_matrix_keymap_data = { +static const struct matrix_keymap_data a780_matrix_keymap_data = { .keymap = a780_key_map, .keymap_size = ARRAY_SIZE(a780_key_map), }; @@ -464,7 +464,7 @@ KEY(2, 3, KEY_KPENTER), }; -static struct matrix_keymap_data e680_matrix_keymap_data = { +static const struct matrix_keymap_data e680_matrix_keymap_data = { .keymap = e680_key_map, .keymap_size = ARRAY_SIZE(e680_key_map), }; @@ -526,7 +526,7 @@ KEY(4, 5, KEY_RESERVED), }; -static struct matrix_keymap_data a1200_matrix_keymap_data = { +static const struct matrix_keymap_data a1200_matrix_keymap_data = { .keymap = a1200_key_map, .keymap_size = ARRAY_SIZE(a1200_key_map), }; @@ -578,7 +578,7 @@ KEY(4, 5, KEY_PREVIOUSSONG), }; -static struct matrix_keymap_data e6_keymap_data = { +static const struct matrix_keymap_data e6_keymap_data = { .keymap = e6_key_map, .keymap_size = ARRAY_SIZE(e6_key_map), }; @@ -630,7 +630,7 @@ KEY(4, 5, KEY_RESERVED), }; -static struct matrix_keymap_data a910_matrix_keymap_data = { +static const struct matrix_keymap_data a910_matrix_keymap_data = { .keymap = a910_key_map, .keymap_size = ARRAY_SIZE(a910_key_map), }; @@ -682,7 +682,7 @@ KEY(4, 5, KEY_RESERVED), }; -static struct matrix_keymap_data e2_matrix_keymap_data = { +static const struct matrix_keymap_data e2_matrix_keymap_data = { .keymap = e2_key_map, .keymap_size = ARRAY_SIZE(e2_key_map), }; diff --git a/arch/arm/mach-pxa/littleton.c b/arch/arm/mach-pxa/littleton.c index fae38fd..0f4046a 100644 --- a/arch/arm/mach-pxa/littleton.c +++ b/arch/arm/mach-pxa/littleton.c @@ -249,7 +249,7 @@ static inline void littleton_init_spi(void) {} KEY(3, 1, KEY_F23), /* soft2 */ }; -static struct matrix_keymap_data littleton_matrix_keymap_data = { +static const struct matrix_keymap_data littleton_matrix_keymap_data = { .keymap = littleton_matrix_key_map, .keymap_size = ARRAY_SIZE(littleton_matrix_key_map), }; diff --git a/arch/arm/mach-pxa/mainstone.c b/arch/arm/mach-pxa/mainstone.c index a2d851a..5f87398 100644 --- a/arch/arm/mach-pxa/mainstone.c +++ b/arch/arm/mach-pxa/mainstone.c @@ -482,7 +482,7 @@ static void mainstone_irda_transceiver_mode(struct device *dev, int mode) KEY(4, 6, KEY_SELECT), }; -static struct matrix_keymap_data mainstone_matrix_keymap_data = { +static const struct matrix_keymap_data mainstone_matrix_keymap_data = { .keymap = mainstone_matrix_keys, .keymap_size = ARRAY_SIZE(mainstone_matrix_keys), }; diff --git a/arch/arm/mach-pxa/mioa701.c b/arch/arm/mach-pxa/mioa701.c index 8a5d049..e882a8e 100644 --- a/arch/arm/mach-pxa/mioa701.c +++ b/arch/arm/mach-pxa/mioa701.c @@ -240,7 +240,7 @@ static void mioa701_lcd_power(int on, struct fb_var_screeninfo *si) KEY(2, 2, KEY_CAMERA) /* Camera key */ }; -static struct matrix_keymap_data mioa701_matrix_keymap_data = { +static const struct matrix_keymap_data mioa701_matrix_keymap_data = { .keymap = mioa701_matrix_keys, .keymap_size = ARRAY_SIZE(mioa701_matrix_keys), }; diff --git a/arch/arm/mach-pxa/palmld.c b/arch/arm/mach-pxa/palmld.c index 980f284..da796c6 100644 --- a/arch/arm/mach-pxa/palmld.c +++ b/arch/arm/mach-pxa/palmld.c @@ -190,7 +190,7 @@ static inline void palmld_nor_init(void) {} KEY(3, 2, KEY_LEFT), }; -static struct matrix_keymap_data palmld_matrix_keymap_data = { +static const struct matrix_keymap_data palmld_matrix_keymap_data = { .keymap = palmld_matrix_keys, .keymap_size = ARRAY_SIZE(palmld_matrix_keys), }; diff --git a/arch/arm/mach-pxa/palmt5.c b/arch/arm/mach-pxa/palmt5.c index 876144a..6bb10c0 100644 --- a/arch/arm/mach-pxa/palmt5.c +++ b/arch/arm/mach-pxa/palmt5.c @@ -124,7 +124,7 @@ KEY(3, 2, KEY_LEFT), }; -static struct matrix_keymap_data palmt5_matrix_keymap_data = { +static const struct matrix_keymap_data palmt5_matrix_keymap_data = { .keymap = palmt5_matrix_keys, .keymap_size = ARRAY_SIZE(palmt5_matrix_keys), }; diff --git a/arch/arm/mach-pxa/palmtreo.c b/arch/arm/mach-pxa/palmtreo.c index 4cc05ec..08400fa 100644 --- a/arch/arm/mach-pxa/palmtreo.c +++ b/arch/arm/mach-pxa/palmtreo.c @@ -286,12 +286,12 @@ KEY(7, 5, KEY_I), }; -static struct matrix_keymap_data treo680_matrix_keymap_data = { +static const struct matrix_keymap_data treo680_matrix_keymap_data = { .keymap = treo680_matrix_keys, .keymap_size = ARRAY_SIZE(treo680_matrix_keys), }; -static struct matrix_keymap_data centro_matrix_keymap_data = { +static const struct matrix_keymap_data centro_matrix_keymap_data = { .keymap = centro_matrix_keys, .keymap_size = ARRAY_SIZE(centro_matrix_keys), }; diff --git a/arch/arm/mach-pxa/palmtx.c b/arch/arm/mach-pxa/palmtx.c index 3664697..22dd32a 100644 --- a/arch/arm/mach-pxa/palmtx.c +++ b/arch/arm/mach-pxa/palmtx.c @@ -192,7 +192,7 @@ static inline void palmtx_nor_init(void) {} KEY(3, 2, KEY_LEFT), }; -static struct matrix_keymap_data palmtx_matrix_keymap_data = { +static const struct matrix_keymap_data palmtx_matrix_keymap_data = { .keymap = palmtx_matrix_keys, .keymap_size = ARRAY_SIZE(palmtx_matrix_keys), }; diff --git a/arch/arm/mach-pxa/palmz72.c b/arch/arm/mach-pxa/palmz72.c index 2963006..4241c37 100644 --- a/arch/arm/mach-pxa/palmz72.c +++ b/arch/arm/mach-pxa/palmz72.c @@ -156,7 +156,7 @@ KEY(3, 2, KEY_LEFT), }; -static struct matrix_keymap_data almz72_matrix_keymap_data = { +static const struct matrix_keymap_data almz72_matrix_keymap_data = { .keymap = palmz72_matrix_keys, .keymap_size = ARRAY_SIZE(palmz72_matrix_keys), }; diff --git a/arch/arm/mach-pxa/tavorevb.c b/arch/arm/mach-pxa/tavorevb.c index 4b38e82..d8c6845 100644 --- a/arch/arm/mach-pxa/tavorevb.c +++ b/arch/arm/mach-pxa/tavorevb.c @@ -148,7 +148,7 @@ KEY(3, 3, KEY_F23), /* soft2 */ }; -static struct matrix_keymap_data tavorevb_matrix_keymap_data = { +static const struct matrix_keymap_data tavorevb_matrix_keymap_data = { .keymap = tavorevb_matrix_key_map, .keymap_size = ARRAY_SIZE(tavorevb_matrix_key_map), }; diff --git a/arch/arm/mach-pxa/tosa.c b/arch/arm/mach-pxa/tosa.c index 13de660..9115665 100644 --- a/arch/arm/mach-pxa/tosa.c +++ b/arch/arm/mach-pxa/tosa.c @@ -452,7 +452,7 @@ static void tosa_irda_shutdown(struct device *dev) KEY(6, 7, KEY_RIGHT), }; -static struct matrix_keymap_data tosakbd_keymap_data = { +static const struct matrix_keymap_data tosakbd_keymap_data = { .keymap = tosakbd_keymap, .keymap_size = ARRAY_SIZE(tosakbd_keymap), }; diff --git a/arch/arm/mach-pxa/z2.c b/arch/arm/mach-pxa/z2.c index 510e533..212ac2f 100644 --- a/arch/arm/mach-pxa/z2.c +++ b/arch/arm/mach-pxa/z2.c @@ -412,7 +412,7 @@ static inline void z2_leds_init(void) {} KEY(5, 7, KEY_DOT), }; -static struct matrix_keymap_data z2_matrix_keymap_data = { +static const struct matrix_keymap_data z2_matrix_keymap_data = { .keymap = z2_matrix_keys, .keymap_size = ARRAY_SIZE(z2_matrix_keys), }; diff --git a/arch/arm/mach-pxa/zylonite.c b/arch/arm/mach-pxa/zylonite.c index 4268552..7ae3ee6 100644 --- a/arch/arm/mach-pxa/zylonite.c +++ b/arch/arm/mach-pxa/zylonite.c @@ -313,7 +313,7 @@ static inline void zylonite_init_mmc(void) {} KEY(0, 3, KEY_AUX), /* contact */ }; -static struct matrix_keymap_data zylonite_matrix_keymap_data = { +static const struct matrix_keymap_data zylonite_matrix_keymap_data = { .keymap = zylonite_matrix_key_map, .keymap_size = ARRAY_SIZE(zylonite_matrix_key_map), };