From patchwork Sat Aug 23 11:20:26 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julia Lawall X-Patchwork-Id: 4769001 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 04C749F344 for ; Sat, 23 Aug 2014 11:26:53 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 46D232013D for ; Sat, 23 Aug 2014 11:26:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6DEFD200C6 for ; Sat, 23 Aug 2014 11:26:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752744AbaHWLZ1 (ORCPT ); Sat, 23 Aug 2014 07:25:27 -0400 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:21752 "EHLO mail2-relais-roc.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751812AbaHWLY5 (ORCPT ); Sat, 23 Aug 2014 07:24:57 -0400 X-IronPort-AV: E=Sophos;i="5.04,386,1406584800"; d="scan'208";a="90829919" Received: from palace.lip6.fr (HELO localhost.localdomain) ([132.227.105.202]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 23 Aug 2014 13:24:53 +0200 From: Julia Lawall To: Lauro Ramos Venancio Cc: josh@joshtriplett.org, kernel-janitors@vger.kernel.org, Aloisio Almeida Jr , Samuel Ortiz , linux-wireless@vger.kernel.org, linux-nfc@lists.01.org, linux-kernel@vger.kernel.org Subject: [PATCH 4/9] NFC: use c99 initializers in structures Date: Sat, 23 Aug 2014 13:20:26 +0200 Message-Id: <1408792831-25615-5-git-send-email-Julia.Lawall@lip6.fr> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1408792831-25615-1-git-send-email-Julia.Lawall@lip6.fr> References: <1408792831-25615-1-git-send-email-Julia.Lawall@lip6.fr> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Julia Lawall Use c99 initializers for structures. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @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 ,...}; // Signed-off-by: Julia Lawall --- The patches in this series do not depend on each other. drivers/nfc/nfcwilink.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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);