From patchwork Sat Dec 17 22:57:24 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhumika Goyal X-Patchwork-Id: 9479131 X-Patchwork-Delegate: kvalo@adurom.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 AE7E36082E for ; Sat, 17 Dec 2016 22:58:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9DB152848E for ; Sat, 17 Dec 2016 22:58:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 849A42848F; Sat, 17 Dec 2016 22:58:02 +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=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, 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 4529F2848E for ; Sat, 17 Dec 2016 22:58:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759229AbcLQW5t (ORCPT ); Sat, 17 Dec 2016 17:57:49 -0500 Received: from mail-pf0-f193.google.com ([209.85.192.193]:35378 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752695AbcLQW5r (ORCPT ); Sat, 17 Dec 2016 17:57:47 -0500 Received: by mail-pf0-f193.google.com with SMTP id i88so5915033pfk.2; Sat, 17 Dec 2016 14:57:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=Z0gfE1r2yPb7PuUoG+NgDXD37bxWOmXIL8zJmXTgb3w=; b=pma/hR3TumBiJPXk9yTZtjAnFXREL+BdIgKGaCvzQkBoS88p6CVsF7hexvKc/AZl5N GjPKO1aPpZmr9KSe1ZJ4W/SU6XwNC5cCyYVaNM06EgJyHhtmmPAUmyuW86SS8ueCfNCa 85yDDvCydYIedbodYCG1C8/yOxxEB8RK7xTQQ03hAnO0EJsdnK0lD3bOpw6yHNKJDNvF WPo3qeGRgxJ0PtYG48rqPItddjASYHZ+ue74vR+t7pDBx3PLkm/7qhcUFuliX+eN6/2V 6bIphSv1aWXs9hiBkqkfSTOKHV60SOJJmNbH0dM8KC2ksNqwtvpOyGbeB4IKT2GQ5S/9 fyAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=Z0gfE1r2yPb7PuUoG+NgDXD37bxWOmXIL8zJmXTgb3w=; b=WH+no+gaUQhu6SCp+SNEezVeLCEk6na6TXxBVwoPYpomme9r5X3kty7D0IegsiwrUC i2Wl8osTjUFsVdeenH2UiwXcqIPEVey9Obt3P6QOeElfVmwvzSYtri47sDR8FQl2J/I4 cqxP42lGjSwsyhET/jmtgegFgYCuOsJ6YIgruUwBOVOJRyOLOrE8xZyETGusJiGJxNU5 IRGxOFlvu/AkdrsS1duba7nokFwX+tYapq63Y6KPEx0pNeMl5LsYBQs7mwRUikc8bx2Z fvB4nCgI59jrUlyYQd8/0s2+7sKPvU/TsHOnX+wFQmlD20MJLR6HyKxcwC3yXtx9JFDX 83/g== X-Gm-Message-State: AIkVDXJyx/gtC0rsEVFpDiaWiMn2MuqjM+3dIqP3ikF2n0g0ZHRypUDd/DkI9t2mAqmVrg== X-Received: by 10.84.241.66 with SMTP id u2mr7124067plm.107.1482015466751; Sat, 17 Dec 2016 14:57:46 -0800 (PST) Received: from gmail.com ([106.215.172.192]) by smtp.gmail.com with ESMTPSA id p79sm21065684pfj.51.2016.12.17.14.57.36 (version=TLS1 cipher=AES128-SHA bits=128/128); Sat, 17 Dec 2016 14:57:44 -0800 (PST) Received: by gmail.com (sSMTP sendmail emulation); Sun, 18 Dec 2016 04:27:27 +0530 From: Bhumika Goyal To: julia.lawall@lip6.fr, kvalo@codeaurora.org, libertas-dev@lists.infradead.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Bhumika Goyal Subject: [PATCH] net: wireless: marvell: libertas: constify cfg80211_ops structures Date: Sun, 18 Dec 2016 04:27:24 +0530 Message-Id: <1482015444-28899-1-git-send-email-bhumirks@gmail.com> 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 cfg80211_ops structures are only passed as an argument to the function wiphy_new. This argument is of type const, so cfg80211_ops strutures having this property can be declared as const. Done using Coccinelle @r1 disable optional_qualifier @ identifier i; position p; @@ static struct cfg80211_ops i@p = {...}; @ok1@ identifier r1.i; position p; @@ wiphy_new(&i@p,...) @bad@ position p!={r1.p,ok1.p}; identifier r1.i; @@ i@p @depends on !bad disable optional_qualifier@ identifier r1.i; @@ +const struct cfg80211_ops i; File size before: text data bss dec hex filename 21225 1954 16 23195 5a9b wireless/marvell/libertas/cfg.o File size after: text data bss dec hex filename 22041 1154 16 23211 5aab wireless/marvell/libertas/cfg.o Signed-off-by: Bhumika Goyal --- drivers/net/wireless/marvell/libertas/cfg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/marvell/libertas/cfg.c b/drivers/net/wireless/marvell/libertas/cfg.c index 7ff2efa..3f97acb 100644 --- a/drivers/net/wireless/marvell/libertas/cfg.c +++ b/drivers/net/wireless/marvell/libertas/cfg.c @@ -2086,7 +2086,7 @@ static int lbs_set_power_mgmt(struct wiphy *wiphy, struct net_device *dev, * Initialization */ -static struct cfg80211_ops lbs_cfg80211_ops = { +static const struct cfg80211_ops lbs_cfg80211_ops = { .set_monitor_channel = lbs_cfg_set_monitor_channel, .libertas_set_mesh_channel = lbs_cfg_set_mesh_channel, .scan = lbs_cfg_scan,