Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1419903

[PATCH] pinctrl: xway: Change structure initialisation to c99 style

Path csiph.com!aioe.org!bofh.it!news.nic.it!robomod
From Amitoj Kaur Chawla <amitoj1606@gmail.com>
Newsgroups linux.kernel
Subject [PATCH] pinctrl: xway: Change structure initialisation to c99 style
Date Sat, 11 Jun 2016 06:10:01 +0200
Message-ID <rIIpb-6Cf-1@gated-at.bofh.it> (permalink)
Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :user-agent; bh=O6mW+BnYC0/Jn8HRHDSzju4NnLd4pmqGwUshz3H29VE=; b=iuWxihj0IQxotgX+7tiEqSgGxpougEJFXtDaCQHZHRSKGICdxKGipEnQJzh+vJWDH5 6MLPXA56J6OqekyfRhUvUSXdXr4whSz5JdlkR0xA67JNGAlwHgI/Bud1rs11m7nfFrcp MegporVz9fjiI55LGxe0HGzjyPC9KCnNS8dPpvvQXgS8vFH7rVm93Tbas0EeXrYzapZN e4nGMbyA5ezmSISfghWVN68xRpZYO4fDFeIexsAmFkINkG0rsjBEh0uZDztIMT9Wjade BV3cadSqXvrJK/Wxf5hrfmhm9Oe7ZE7rSQvQfkA86lUTDlwioPn+KBBBUC+DXQX7mtMT WG2g==
X-Google-Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:user-agent; bh=O6mW+BnYC0/Jn8HRHDSzju4NnLd4pmqGwUshz3H29VE=; b=ZlK3chsa2/KcA8vUVtuh0cx/RQba0lCPpmLsGwamqC9LYPrZ/nPnWCj0bkBHiGrgHA GbpNfMJiZv05p3Uja7OCrtZNiUGiFd4ePf+8M7ZXEurhOaFi9gnNhDMfYWNzml2/xPTc RnOSskDS4ItC1V5jM+fMkPnqElYncoR4aZ61P8vBIC5iACabPsw7tSoIXNuBuF5VBE89 wnXwtCGr99Ho0FHXIX4ty7+AuBjnvHin/wEbGun37OAiwkUvLpPJOMkwcgxzuucIQl7w tiPOtf2KplZAbGvWqS9re7o7b+etZ2HhRNI1+YLlC6+Ua2yyEIZhFseDlIlMIkqZLZxP Rc7Q==
X-Gm-Message-State ALyK8tLXYOyhH7kEn0vC5+PQ/QCman3jK84lFWoE1BBwy3tPx0Ni0RTeF9DEllMGP2G0UA==
X-Received by 10.98.90.67 with SMTP id o64mr6088652pfb.150.1465617777653; Fri, 10 Jun 2016 21:02:57 -0700 (PDT)
MIME-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Disposition inline
User-Agent Mutt/1.5.21 (2010-09-15)
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 137
Organization linux.* mail to news gateway
X-Original-Cc julia.lawall@lip6.fr
X-Original-Date Sat, 11 Jun 2016 09:32:52 +0530
X-Original-Message-ID <20160611040252.GA20307@amitoj-Inspiron-3542>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1419903

Show key headers only | View raw


Replace the in order struct initialisation style with explicit field
style.

The Coccinelle semantic patch used to make this change is as follows:

@decl@
identifier i1,fld;
type T;
field list[n] fs;
@@

struct i1 {
 fs
 T fld;
 ...};

@@
identifier decl.i1,i2,decl.fld;
expression e;
position bad.p, bad.fix;
@@

struct i1 i2@p = { ...,
+ .fld = e
- e@fix
 ,...};

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
---
 drivers/pinctrl/pinctrl-xway.c | 72 ++++++++++++++++++++++++++++--------------
 1 file changed, 48 insertions(+), 24 deletions(-)

diff --git a/drivers/pinctrl/pinctrl-xway.c b/drivers/pinctrl/pinctrl-xway.c
index a13f2b6..dac88a2 100644
--- a/drivers/pinctrl/pinctrl-xway.c
+++ b/drivers/pinctrl/pinctrl-xway.c
@@ -1616,50 +1616,74 @@ struct pinctrl_xway_soc {
 
 /* xway xr9 series (DEPRECATED: Use XWAY xRX100/xRX200 Family) */
 static struct pinctrl_xway_soc xr9_pinctrl = {
-	XR9_MAX_PIN, xway_mfp,
-	xway_grps, ARRAY_SIZE(xway_grps),
-	xrx_funcs, ARRAY_SIZE(xrx_funcs),
-	xway_exin_pin_map, 6
+	.pin_count = XR9_MAX_PIN,
+	.mfp = xway_mfp,
+	.grps = xway_grps,
+	.num_grps = ARRAY_SIZE(xway_grps),
+	.funcs = xrx_funcs,
+	.num_funcs = ARRAY_SIZE(xrx_funcs),
+	.exin = xway_exin_pin_map,
+	.num_exin = 6
 };
 
 /* XWAY AMAZON Family */
 static struct pinctrl_xway_soc ase_pinctrl = {
-	ASE_MAX_PIN, ase_mfp,
-	ase_grps, ARRAY_SIZE(ase_grps),
-	ase_funcs, ARRAY_SIZE(ase_funcs),
-	ase_exin_pin_map, 3
+	.pin_count = ASE_MAX_PIN,
+	.mfp = ase_mfp,
+	.grps = ase_grps,
+	.num_grps = ARRAY_SIZE(ase_grps),
+	.funcs = ase_funcs,
+	.num_funcs = ARRAY_SIZE(ase_funcs),
+	.exin = ase_exin_pin_map,
+	.num_exin = 3
 };
 
 /* XWAY DANUBE Family */
 static struct pinctrl_xway_soc danube_pinctrl = {
-	DANUBE_MAX_PIN, danube_mfp,
-	danube_grps, ARRAY_SIZE(danube_grps),
-	danube_funcs, ARRAY_SIZE(danube_funcs),
-	danube_exin_pin_map, 3
+	.pin_count = DANUBE_MAX_PIN,
+	.mfp = danube_mfp,
+	.grps = danube_grps,
+	.num_grps = ARRAY_SIZE(danube_grps),
+	.funcs = danube_funcs,
+	.num_funcs = ARRAY_SIZE(danube_funcs),
+	.exin = danube_exin_pin_map,
+	.num-exin = 3
 };
 
 /* XWAY xRX100 Family */
 static struct pinctrl_xway_soc xrx100_pinctrl = {
-	XRX100_MAX_PIN, xrx100_mfp,
-	xrx100_grps, ARRAY_SIZE(xrx100_grps),
-	xrx100_funcs, ARRAY_SIZE(xrx100_funcs),
-	xrx100_exin_pin_map, 6
+	.pin_count = XRX100_MAX_PIN,
+	.mfp = xrx100_mfp,
+	.grps = xrx100_grps,
+	.num_grps = ARRAY_SIZE(xrx100_grps),
+	.funcs = xrx100_funcs,
+	.num_funcs = ARRAY_SIZE(xrx100_funcs),
+	.exin = xrx100_exin_pin_map,
+	.num_exin = 6
 };
 
 /* XWAY xRX200 Family */
 static struct pinctrl_xway_soc xrx200_pinctrl = {
-	XRX200_MAX_PIN, xrx200_mfp,
-	xrx200_grps, ARRAY_SIZE(xrx200_grps),
-	xrx200_funcs, ARRAY_SIZE(xrx200_funcs),
-	xrx200_exin_pin_map, 6
+	.pin_count = XRX200_MAX_PIN,
+	.mfp = xrx200_mfp,
+	.grps = xrx200_grps,
+	.num_grps = ARRAY_SIZE(xrx200_grps),
+	.funcs = xrx200_funcs,
+	.num_funcs = ARRAY_SIZE(xrx200_funcs),
+	.exin = xrx200_exin_pin_map,
+	.num_exin = 6
 };
 
 /* XWAY xRX300 Family */
 static struct pinctrl_xway_soc xrx300_pinctrl = {
-	XRX300_MAX_PIN, xrx300_mfp,
-	xrx300_grps, ARRAY_SIZE(xrx300_grps),
-	xrx300_funcs, ARRAY_SIZE(xrx300_funcs),
-	xrx300_exin_pin_map, 5
+	.pin_count = XRX300_MAX_PIN,
+	.mfp = xrx300_mfp,
+	.grps = xrx300_grps,
+	.num_grps = ARRAY_SIZE(xrx300_grps),
+	.funcs = xrx300_funcs,
+	.num_funcs = ARRAY_SIZE(xrx300_funcs),
+	.exin = xrx300_exin_pin_map,
+	.num_exin = 5
 };
 
 static struct pinctrl_gpio_range xway_gpio_range = {
-- 
1.9.1

Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

[PATCH] pinctrl: xway: Change structure initialisation to c99 style Amitoj Kaur Chawla <amitoj1606@gmail.com> - 2016-06-11 06:10 +0200
  Re: [PATCH] pinctrl: xway: Change structure initialisation to c99 style Linus Walleij <linus.walleij@linaro.org> - 2016-06-13 14:10 +0200

csiph-web