diff mbox

[1/3] net: rtlwifi: constify rate_control_ops

Message ID 1503482375-19983-2-git-send-email-arvind.yadav.cs@gmail.com
State Awaiting Upstream, archived
Delegated to: David Miller
Headers show

Commit Message

Arvind Yadav Aug. 23, 2017, 9:59 a.m. UTC
rate_control_ops are not supposed to change at runtime. All functions
working with rate_control_ops provided by <net/mac80211.h> work with
const rate_control_ops. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
 drivers/net/wireless/realtek/rtlwifi/rc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Kalle Valo Aug. 24, 2017, 9:57 a.m. UTC | #1
Arvind Yadav <arvind.yadav.cs@gmail.com> wrote:

> rate_control_ops are not supposed to change at runtime. All functions
> working with rate_control_ops provided by <net/mac80211.h> work with
> const rate_control_ops. So mark the non-const structs as const.
> 
> Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>

2 patches applied to wireless-drivers-next.git, thanks.

28b75415ad19 wireless: ipw2200: Replace PCI pool old API
9ea792a48cdd net: rsi: mac80211: constify ieee80211_ops
diff mbox

Patch

diff --git a/drivers/net/wireless/realtek/rtlwifi/rc.c b/drivers/net/wireless/realtek/rtlwifi/rc.c
index 951d257..02811ed 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rc.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rc.c
@@ -283,7 +283,7 @@  static void rtl_rate_free_sta(void *rtlpriv,
 	kfree(rate_priv);
 }
 
-static struct rate_control_ops rtl_rate_ops = {
+static const struct rate_control_ops rtl_rate_ops = {
 	.name = "rtl_rc",
 	.alloc = rtl_rate_alloc,
 	.free = rtl_rate_free,