From patchwork Tue Aug 9 16:11:02 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julia Lawall X-Patchwork-Id: 9271695 X-Patchwork-Delegate: sameo@linux.intel.com 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 DF49760839 for ; Tue, 9 Aug 2016 16:29:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CB6BB27569 for ; Tue, 9 Aug 2016 16:29:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C03AB28375; Tue, 9 Aug 2016 16:29:43 +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=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4312C27569 for ; Tue, 9 Aug 2016 16:29:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932408AbcHIQ3O (ORCPT ); Tue, 9 Aug 2016 12:29:14 -0400 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]:60071 "EHLO mail3-relais-sop.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932256AbcHIQ3A (ORCPT ); Tue, 9 Aug 2016 12:29:00 -0400 X-IronPort-AV: E=Sophos;i="5.28,495,1464645600"; d="scan'208";a="187295072" Received: from palace.rsr.lip6.fr (HELO localhost.localdomain) ([132.227.105.202]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/AES128-SHA256; 09 Aug 2016 18:28:25 +0200 From: Julia Lawall To: Lauro Ramos Venancio Cc: kernel-janitors@vger.kernel.org, Aloisio Almeida Jr , Samuel Ortiz , linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] NFC: pn533: constify pn533_phy_ops structures Date: Tue, 9 Aug 2016 18:11:02 +0200 Message-Id: <1470759062-21276-1-git-send-email-Julia.Lawall@lip6.fr> X-Mailer: git-send-email 1.9.1 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The pn533_phy_ops are never modified, so declare them as const. Done with the help of Coccinelle. Signed-off-by: Julia Lawall --- drivers/nfc/pn533/i2c.c | 2 +- drivers/nfc/pn533/pn533.c | 2 +- drivers/nfc/pn533/pn533.h | 4 ++-- drivers/nfc/pn533/usb.c | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) -- 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/pn533/i2c.c b/drivers/nfc/pn533/i2c.c index 1dc8924..8a7c17e 100644 --- a/drivers/nfc/pn533/i2c.c +++ b/drivers/nfc/pn533/i2c.c @@ -176,7 +176,7 @@ static irqreturn_t pn533_i2c_irq_thread_fn(int irq, void *data) return IRQ_HANDLED; } -static struct pn533_phy_ops i2c_phy_ops = { +static const struct pn533_phy_ops i2c_phy_ops = { .send_frame = pn533_i2c_send_frame, .send_ack = pn533_i2c_send_ack, .abort_cmd = pn533_i2c_abort_cmd, diff --git a/drivers/nfc/pn533/pn533.c b/drivers/nfc/pn533/pn533.c index d9c5583..2f817b3 100644 --- a/drivers/nfc/pn533/pn533.c +++ b/drivers/nfc/pn533/pn533.c @@ -2560,7 +2560,7 @@ struct pn533 *pn533_register_device(u32 device_type, u32 protocols, enum pn533_protocol_type protocol_type, void *phy, - struct pn533_phy_ops *phy_ops, + const struct pn533_phy_ops *phy_ops, struct pn533_frame_ops *fops, struct device *dev, struct device *parent) diff --git a/drivers/nfc/pn533/pn533.h b/drivers/nfc/pn533/pn533.h index 553c7d1..e26d634 100644 --- a/drivers/nfc/pn533/pn533.h +++ b/drivers/nfc/pn533/pn533.h @@ -179,7 +179,7 @@ struct pn533 { struct device *dev; void *phy; - struct pn533_phy_ops *phy_ops; + const struct pn533_phy_ops *phy_ops; }; typedef int (*pn533_send_async_complete_t) (struct pn533 *dev, void *arg, @@ -226,7 +226,7 @@ struct pn533 *pn533_register_device(u32 device_type, u32 protocols, enum pn533_protocol_type protocol_type, void *phy, - struct pn533_phy_ops *phy_ops, + const struct pn533_phy_ops *phy_ops, struct pn533_frame_ops *fops, struct device *dev, struct device *parent); diff --git a/drivers/nfc/pn533/usb.c b/drivers/nfc/pn533/usb.c index 33ed78b..bcf3f54 100644 --- a/drivers/nfc/pn533/usb.c +++ b/drivers/nfc/pn533/usb.c @@ -434,7 +434,7 @@ static void pn533_send_complete(struct urb *urb) } } -static struct pn533_phy_ops usb_phy_ops = { +static const struct pn533_phy_ops usb_phy_ops = { .send_frame = pn533_usb_send_frame, .send_ack = pn533_usb_send_ack, .abort_cmd = pn533_usb_abort_cmd,