From patchwork Mon Jun 19 20:18:17 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joe Perches X-Patchwork-Id: 9797733 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 73A4A601C8 for ; Mon, 19 Jun 2017 20:19:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6345B28423 for ; Mon, 19 Jun 2017 20:19:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 560D428469; Mon, 19 Jun 2017 20:19:18 +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 CABBF28423 for ; Mon, 19 Jun 2017 20:19:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752492AbdFSUSz (ORCPT ); Mon, 19 Jun 2017 16:18:55 -0400 Received: from smtprelay0206.hostedemail.com ([216.40.44.206]:42629 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752475AbdFSUSy (ORCPT ); Mon, 19 Jun 2017 16:18:54 -0400 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay05.hostedemail.com (Postfix) with ESMTP id B912F180715D7; Mon, 19 Jun 2017 20:18:32 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-HE-Tag: arm91_4a6d78ddbba56 X-Filterd-Recvd-Size: 4126 Received: from joe-laptop.perches.com (unknown [47.151.132.55]) (Authenticated sender: joe@perches.com) by omf08.hostedemail.com (Postfix) with ESMTPA; Mon, 19 Jun 2017 20:18:31 +0000 (UTC) From: Joe Perches To: Larry Finger , Chaoming Li Cc: Kalle Valo , linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 4/5] realtek: btcoexist: Make the rtl_btc_ops struct const Date: Mon, 19 Jun 2017 13:18:17 -0700 Message-Id: X-Mailer: git-send-email 2.10.0.rc2.1.g053435c In-Reply-To: References: 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 Avoid allowing a write into what should be const. Signed-off-by: Joe Perches --- drivers/net/wireless/realtek/rtlwifi/btcoexist/rtl_btc.c | 4 ++-- drivers/net/wireless/realtek/rtlwifi/btcoexist/rtl_btc.h | 2 +- drivers/net/wireless/realtek/rtlwifi/pci.c | 2 +- drivers/net/wireless/realtek/rtlwifi/wifi.h | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/net/wireless/realtek/rtlwifi/btcoexist/rtl_btc.c b/drivers/net/wireless/realtek/rtlwifi/btcoexist/rtl_btc.c index 3ab0cfe26513..19a95b69255d 100644 --- a/drivers/net/wireless/realtek/rtlwifi/btcoexist/rtl_btc.c +++ b/drivers/net/wireless/realtek/rtlwifi/btcoexist/rtl_btc.c @@ -29,7 +29,7 @@ #include "rtl_btc.h" #include "halbt_precomp.h" -static struct rtl_btc_ops rtl_btc_operation = { +static const struct rtl_btc_ops rtl_btc_operation = { .btc_init_variables = rtl_btc_init_variables, .btc_init_hal_vars = rtl_btc_init_hal_vars, .btc_init_hw_config = rtl_btc_init_hw_config, @@ -161,7 +161,7 @@ void rtl_btc_special_packet_notify(struct rtl_priv *rtlpriv, u8 pkt_type) return exhalbtc_special_packet_notify(&gl_bt_coexist, pkt_type); } -struct rtl_btc_ops *rtl_btc_get_ops_pointer(void) +const struct rtl_btc_ops *rtl_btc_get_ops_pointer(void) { return &rtl_btc_operation; } diff --git a/drivers/net/wireless/realtek/rtlwifi/btcoexist/rtl_btc.h b/drivers/net/wireless/realtek/rtlwifi/btcoexist/rtl_btc.h index fff5117e1c4e..83c5bb2d6ad8 100644 --- a/drivers/net/wireless/realtek/rtlwifi/btcoexist/rtl_btc.h +++ b/drivers/net/wireless/realtek/rtlwifi/btcoexist/rtl_btc.h @@ -44,7 +44,7 @@ bool rtl_btc_is_disable_edca_turbo(struct rtl_priv *rtlpriv); bool rtl_btc_is_bt_disabled(struct rtl_priv *rtlpriv); void rtl_btc_special_packet_notify(struct rtl_priv *rtlpriv, u8 pkt_type); -struct rtl_btc_ops *rtl_btc_get_ops_pointer(void); +const struct rtl_btc_ops *rtl_btc_get_ops_pointer(void); u8 rtl_get_hwpg_bt_exist(struct rtl_priv *rtlpriv); u8 rtl_get_hwpg_bt_type(struct rtl_priv *rtlpriv); diff --git a/drivers/net/wireless/realtek/rtlwifi/pci.c b/drivers/net/wireless/realtek/rtlwifi/pci.c index fa93401acdab..8000894c4212 100644 --- a/drivers/net/wireless/realtek/rtlwifi/pci.c +++ b/drivers/net/wireless/realtek/rtlwifi/pci.c @@ -1814,7 +1814,7 @@ static int rtl_pci_start(struct ieee80211_hw *hw) { struct rtl_priv *rtlpriv = rtl_priv(hw); struct rtl_hal_ops *ops = rtlpriv->cfg->ops; - struct rtl_btc_ops *btc_ops = rtlpriv->btcoexist.btc_ops; + const struct rtl_btc_ops *btc_ops = rtlpriv->btcoexist.btc_ops; struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw)); diff --git a/drivers/net/wireless/realtek/rtlwifi/wifi.h b/drivers/net/wireless/realtek/rtlwifi/wifi.h index 9a916188a703..d03f0ca92530 100644 --- a/drivers/net/wireless/realtek/rtlwifi/wifi.h +++ b/drivers/net/wireless/realtek/rtlwifi/wifi.h @@ -2475,7 +2475,7 @@ struct rtl_btc_info { }; struct bt_coexist_info { - struct rtl_btc_ops *btc_ops; + const struct rtl_btc_ops *btc_ops; struct rtl_btc_info btc_info; /* EEPROM BT info. */ u8 eeprom_bt_coexist;