From patchwork Sun May 1 12:07:23 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julia Lawall X-Patchwork-Id: 617267 X-Patchwork-Delegate: jeffrey.t.kirsher@intel.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ozlabs.org (Postfix) with ESMTP id 3qydl208yTz9t5V for ; Mon, 2 May 2016 06:07:25 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 7CBA12E61A; Sun, 1 May 2016 20:07:24 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id p9rKdu8zeYVz; Sun, 1 May 2016 20:07:22 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 293352DFEF; Sun, 1 May 2016 20:07:22 +0000 (UTC) X-Original-To: intel-wired-lan@lists.osuosl.org Delivered-To: intel-wired-lan@lists.osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id A47821BFBF4 for ; Sun, 1 May 2016 12:33:09 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 9ED968AEA8 for ; Sun, 1 May 2016 12:33:09 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1Bm1ygoOa4AL for ; Sun, 1 May 2016 12:33:08 +0000 (UTC) X-Greylist: delayed 00:10:21 by SQLgrey-1.7.6 Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by hemlock.osuosl.org (Postfix) with ESMTPS id EF9E78ACD7 for ; Sun, 1 May 2016 12:33:07 +0000 (UTC) X-IronPort-AV: E=Sophos;i="5.24,561,1454972400"; d="scan'208";a="176348623" 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; 01 May 2016 14:22:42 +0200 From: Julia Lawall To: linux-kernel@vger.kernel.org Date: Sun, 1 May 2016 14:07:23 +0200 Message-Id: <1462104443-30724-1-git-send-email-Julia.Lawall@lip6.fr> X-Mailer: git-send-email 1.9.1 X-Mailman-Approved-At: Sun, 01 May 2016 20:07:20 +0000 Cc: Mustafa Ismail , netdev@vger.kernel.org, Faisal Latif , linux-rdma@vger.kernel.org, Tatyana Nikolova , Chien Tin Tung , kernel-janitors@vger.kernel.org, Doug Ledford , intel-wired-lan@lists.osuosl.org, Sean Hefty , Shiraz Saleem , Hal Rosenstock Subject: [Intel-wired-lan] [PATCH] i40e: constify i40e_client_ops structure X-BeenThere: intel-wired-lan@lists.osuosl.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-wired-lan-bounces@lists.osuosl.org Sender: "Intel-wired-lan" The i40e_client_ops structure is never modified, so declare it as const. Done with the help of Coccinelle. Signed-off-by: Julia Lawall Reviewed-by: Leon Romanovsky Tested-by: Andrew Bowers --- drivers/infiniband/hw/i40iw/i40iw_main.c | 2 +- drivers/net/ethernet/intel/i40e/i40e_client.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/infiniband/hw/i40iw/i40iw_main.c b/drivers/infiniband/hw/i40iw/i40iw_main.c index 90e5af2..e41fae24 100644 --- a/drivers/infiniband/hw/i40iw/i40iw_main.c +++ b/drivers/infiniband/hw/i40iw/i40iw_main.c @@ -1863,7 +1863,7 @@ static enum i40iw_status_code i40iw_virtchnl_send(struct i40iw_sc_dev *dev, } /* client interface functions */ -static struct i40e_client_ops i40e_ops = { +static const struct i40e_client_ops i40e_ops = { .open = i40iw_open, .close = i40iw_close, .l2_param_change = i40iw_l2param_change, diff --git a/drivers/net/ethernet/intel/i40e/i40e_client.h b/drivers/net/ethernet/intel/i40e/i40e_client.h index bf6b453..a4601d9 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_client.h +++ b/drivers/net/ethernet/intel/i40e/i40e_client.h @@ -217,7 +217,7 @@ struct i40e_client { #define I40E_CLIENT_FLAGS_LAUNCH_ON_PROBE BIT(0) #define I40E_TX_FLAGS_NOTIFY_OTHER_EVENTS BIT(2) enum i40e_client_type type; - struct i40e_client_ops *ops; /* client ops provided by the client */ + const struct i40e_client_ops *ops; /* client ops provided by the client */ }; static inline bool i40e_client_is_registered(struct i40e_client *client)