From patchwork Sun Nov 27 17:03:26 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhumika Goyal X-Patchwork-Id: 9448851 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 911726071A for ; Sun, 27 Nov 2016 17:04:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5DF5E27B2F for ; Sun, 27 Nov 2016 17:04:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4136527CFC; Sun, 27 Nov 2016 17:04:03 +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=ham 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 D134927B2F for ; Sun, 27 Nov 2016 17:04:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751947AbcK0RDs (ORCPT ); Sun, 27 Nov 2016 12:03:48 -0500 Received: from mail-pf0-f196.google.com ([209.85.192.196]:34335 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751154AbcK0RDp (ORCPT ); Sun, 27 Nov 2016 12:03:45 -0500 Received: by mail-pf0-f196.google.com with SMTP id y68so5170829pfb.1; Sun, 27 Nov 2016 09:03:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=ZFrIpc4JyY0LFo/8LFpoc9pJEnKW2fY3ciuvbX9ju6U=; b=n++I41LbgW+wwx7u2xaxC5E6LqmMpbQG92CXjfR4PD5pd61wnUyO6WmQBg9lDj2raY DcDJR37c/a1OYC/S8uFR+YF59MroHCsh+Sy7dlIRhDABTcmUjrzYt+vg6jfudUtnij1h 3/kxr3cMzY9VngdNKFVbHaLPVueuFwR+FDG4mDJnX6q4s3Wioov6I+wRuSw6gMg4L+T6 2wy6UT1v7E7wzi7dx3yLg6+fUuBRLDgQkAgYKfpNfVNCVTgxktF5UZEvpjVMPOJjYprb Zb969l/GsEduW1WOYpLMwcCxuWRKo5hXaQ3RzWnyxYWwbsGXGmuZj5TY4CIW83dzgBq7 x1/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=ZFrIpc4JyY0LFo/8LFpoc9pJEnKW2fY3ciuvbX9ju6U=; b=CKQtu0vxC2oGYCKToT/XpTbW+z5oFFm9hFWZVg2EPQpsqUnqs5/aPNlp1S9tj/mtPv CDblygONpvfvFNMFEdrHLdzEkBRXAATTgP5QJtgSkqmuB5+40e7gSP8n0mPpbagn6WBt P7EtDetciu7GQvqGd0I1/lje+5ncos84nWp+D2HpxEHUCgwNynARuMAcun4G6GYkPT6o LmCtCFGoyIiO+E7ynx6DYddex9UMtGARPbkPf2wY7qPjcVe+RSD/OImgRh7xu+YG989S Se4lAgaWu4r6eWghGMg+XgUU2ZR72mG/K7mkZMjHPADJ0DrqtqvOPy6d4xz+pxw07oEJ E1zQ== X-Gm-Message-State: AKaTC026k6kyV4sQpwcwCjWe+WdRTKWaTYgM16CJqCDnKJ2ly01/UTyEA5edau0acEJxKQ== X-Received: by 10.84.162.204 with SMTP id o12mr40747501plg.17.1480266224994; Sun, 27 Nov 2016 09:03:44 -0800 (PST) Received: from gmail.com ([106.215.162.2]) by smtp.gmail.com with ESMTPSA id w11sm69215795pfk.75.2016.11.27.09.03.35 (version=TLS1 cipher=AES128-SHA bits=128/128); Sun, 27 Nov 2016 09:03:43 -0800 (PST) Received: by gmail.com (sSMTP sendmail emulation); Sun, 27 Nov 2016 22:33:27 +0530 From: Bhumika Goyal To: julia.lawall@lip6.fr, ath9k-devel@qca.qualcomm.com, kvalo@codeaurora.org, linux-wireless@vger.kernel.org, ath9k-devel@lists.ath9k.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Bhumika Goyal Subject: [PATCH] wireless: ath: ath9k: constify ath_bus_ops structure Date: Sun, 27 Nov 2016 22:33:26 +0530 Message-Id: <1480266206-26732-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 Declare the structure ath_bus_ops as const as it is only passed as an argument to the function ath9k_init_device. This argument is of type const struct ath_bus_ops *, so ath_bus_ops structures with this property can be declared as const. Done using Coccinelle: @r1 disable optional_qualifier @ identifier i; position p; @@ static struct ath_bus_ops i@p = {...}; @ok1@ identifier r1.i; position p; expression e1,e2; @@ ath9k_init_device(e1,e2,&i@p) @bad@ position p!={r1.p,ok1.p}; identifier r1.i; @@ i@p @depends on !bad disable optional_qualifier@ identifier r1.i; @@ static +const struct ath_bus_ops i={...}; @depends on !bad disable optional_qualifier@ identifier r1.i; @@ +const struct ath_bus_ops i; File size before: text data bss dec hex filename 1295 232 0 1527 5f7 ath/ath9k/ahb.o File size after: text data bss dec hex filename 1359 176 0 1535 5ff ath/ath9k/ahb.o Signed-off-by: Bhumika Goyal --- drivers/net/wireless/ath/ath9k/ahb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath9k/ahb.c b/drivers/net/wireless/ath/ath9k/ahb.c index bea6186..2bd982c 100644 --- a/drivers/net/wireless/ath/ath9k/ahb.c +++ b/drivers/net/wireless/ath/ath9k/ahb.c @@ -62,7 +62,7 @@ static bool ath_ahb_eeprom_read(struct ath_common *common, u32 off, u16 *data) return false; } -static struct ath_bus_ops ath_ahb_bus_ops = { +static const struct ath_bus_ops ath_ahb_bus_ops = { .ath_bus_type = ATH_AHB, .read_cachesize = ath_ahb_read_cachesize, .eeprom_read = ath_ahb_eeprom_read,