lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sat, 23 Aug 2014 13:20:26 +0200
From:	Julia Lawall <Julia.Lawall@...6.fr>
To:	Lauro Ramos Venancio <lauro.venancio@...nbossa.org>
Cc:	josh@...htriplett.org, kernel-janitors@...r.kernel.org,
	Aloisio Almeida Jr <aloisio.almeida@...nbossa.org>,
	Samuel Ortiz <sameo@...ux.intel.com>,
	linux-wireless@...r.kernel.org, linux-nfc@...ts.01.org,
	linux-kernel@...r.kernel.org
Subject: [PATCH 4/9] NFC: use c99 initializers in structures

From: Julia Lawall <Julia.Lawall@...6.fr>

Use c99 initializers for structures.

A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@decl@
identifier i1,fld;
type T;
field list[n] fs;
@@

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

@bad@
identifier decl.i1,i2;
expression e;
initializer list[decl.n] is;
@@

struct i1 i2 = { is,
+ .fld = e
- e
 ,...};
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@...6.fr>

---
The patches in this series do not depend on each other.

 drivers/nfc/nfcwilink.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/nfc/nfcwilink.c b/drivers/nfc/nfcwilink.c
index 683671a..e83df00 100644
--- a/drivers/nfc/nfcwilink.c
+++ b/drivers/nfc/nfcwilink.c
@@ -461,7 +461,11 @@ static int nfcwilink_close(struct nci_dev *ndev)
 static int nfcwilink_send(struct nci_dev *ndev, struct sk_buff *skb)
 {
 	struct nfcwilink *drv = nci_get_drvdata(ndev);
-	struct nfcwilink_hdr hdr = {NFCWILINK_CHNL, NFCWILINK_OPCODE, 0x0000};
+	struct nfcwilink_hdr hdr = {
+		.chnl = NFCWILINK_CHNL,
+		.opcode = NFCWILINK_OPCODE,
+		.len = 0x0000
+	};
 	long len;
 
 	dev_dbg(&drv->pdev->dev, "send entry, len %d\n", skb->len);

--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ