From patchwork Sat Dec 17 22:44:27 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhumika Goyal X-Patchwork-Id: 9479127 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 0E61C60827 for ; Sat, 17 Dec 2016 22:45:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F21F12846D for ; Sat, 17 Dec 2016 22:45:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E6D852848F; Sat, 17 Dec 2016 22:45:17 +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.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM 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 AD7932846D for ; Sat, 17 Dec 2016 22:45:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758946AbcLQWox (ORCPT ); Sat, 17 Dec 2016 17:44:53 -0500 Received: from mail-pg0-f65.google.com ([74.125.83.65]:33010 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752695AbcLQWow (ORCPT ); Sat, 17 Dec 2016 17:44:52 -0500 Received: by mail-pg0-f65.google.com with SMTP id g1so2031733pgn.0; Sat, 17 Dec 2016 14:44:51 -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=Kf+PeiDq7+MH+DR8Ti3tyD+D20nzY1lsZ+meXd5Lq68=; b=Rwj7SNsIXq4qByYW+0WJ/xH6bCNvHPX/VTIGsKIzCmDGxt3ZC1vz5Mip/SdNOKMIia bQtC9BEcIbh7+2BSbtUzi8FoxDhor4S6kYIwhQgD1CM+ymWu7/8lUxN8t/rDBmkp7tTC WLOQueipEaToGhSYToq2MbyQeQOspBUciGMi5k/WFHzLhmOMUc0aYIV8ep6j9AqPCELZ o7bU6wwqKKdY4vdT2YrTWoa6a8oojVKvqKfY6okHeMyjAClAUXOT0wE/0dtT3P4+bN0/ /HMOVX88cOYTrkSmBabGOlZkMIEWMLM82aQvhXWkXhb673kNiZ4uuEG4A3i6rZBCsR9d TfdA== 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=Kf+PeiDq7+MH+DR8Ti3tyD+D20nzY1lsZ+meXd5Lq68=; b=RrmQRgpjD0gqMxjhaxxXIjCEOYyvm6zDXYh29o9TslahfegDDTevxp0ujLmygCthCs 9KmtYbDbN3bwSZdZnGB6HEKcUltwO/oIJnWQjz7HO/76765rjlwkvz1slFY+0suMheZx /svujM1iez07rJeqoQKqsCDGJnAbhT94VPOH5/LsuEzcx6RF6ySEeQxfyYEnUm6IkUsv Rw4pYUPZkQZJTspngZTzudh/X2b7WjZveFKB0qVwekfGWXNbo4Dq1p8qJVVem//6R9wD W5wZeLqvx7utyPf78XZgK6SqdD0oiGrxGrDAOxZtk3HhmBEeJdZCbmgrA5aelZCkbZqv Fc3g== X-Gm-Message-State: AKaTC03fzWBWL9Lwqq+jnH5gdOvN9FK7q5uipBKL5ym2ffLLiwRGl+suEft3OhJHDYpdmg== X-Received: by 10.99.102.69 with SMTP id a66mr17148550pgc.49.1482014691130; Sat, 17 Dec 2016 14:44:51 -0800 (PST) Received: from gmail.com ([106.215.189.148]) by smtp.gmail.com with ESMTPSA id c142sm21030513pfb.23.2016.12.17.14.44.38 (version=TLS1 cipher=AES128-SHA bits=128/128); Sat, 17 Dec 2016 14:44:49 -0800 (PST) Received: by gmail.com (sSMTP sendmail emulation); Sun, 18 Dec 2016 04:14:29 +0530 From: Bhumika Goyal To: julia.lawall@lip6.fr, qca_merez@qca.qualcomm.com, kvalo@codeaurora.org, linux-wireless@vger.kernel.org, wil6210@qca.qualcomm.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Bhumika Goyal Subject: [PATCH] net: wireless: ath: wil6210: constify cfg80211_ops structures Date: Sun, 18 Dec 2016 04:14:27 +0530 Message-Id: <1482014667-27082-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 18133 6632 0 24765 60bd wireless/ath/wil6210/cfg80211.o File size after: text data bss dec hex filename 18933 5832 0 24765 60bd wireless/ath/wil6210/cfg80211.o Signed-off-by: Bhumika Goyal --- drivers/net/wireless/ath/wil6210/cfg80211.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/wil6210/cfg80211.c b/drivers/net/wireless/ath/wil6210/cfg80211.c index 6aa3ff4..54dd116 100644 --- a/drivers/net/wireless/ath/wil6210/cfg80211.c +++ b/drivers/net/wireless/ath/wil6210/cfg80211.c @@ -1499,7 +1499,7 @@ static int wil_cfg80211_set_power_mgmt(struct wiphy *wiphy, return rc; } -static struct cfg80211_ops wil_cfg80211_ops = { +static const struct cfg80211_ops wil_cfg80211_ops = { .add_virtual_intf = wil_cfg80211_add_iface, .del_virtual_intf = wil_cfg80211_del_iface, .scan = wil_cfg80211_scan,