staging: rtl8723au: Preserve const attribute of cmd handler argument
authorJes Sorensen <Jes.Sorensen@redhat.com>
Sat, 26 Apr 2014 16:55:06 +0000 (18:55 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 26 Apr 2014 17:16:14 +0000 (10:16 -0700)
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8723au/core/rtw_cmd.c
drivers/staging/rtl8723au/core/rtw_mlme_ext.c
drivers/staging/rtl8723au/core/rtw_sta_mgt.c
drivers/staging/rtl8723au/hal/hal_com.c
drivers/staging/rtl8723au/include/hal_com.h
drivers/staging/rtl8723au/include/rtw_mlme_ext.h
drivers/staging/rtl8723au/include/sta_info.h

index b9e38dc6a26c65c85b8c13dc248fa6aa32403d1c..508576ef1eb265b3742e087091ac07ef5e6086e7 100644 (file)
@@ -1446,7 +1446,7 @@ static void c2h_wk_callback(struct work_struct *work)
 
 u8 rtw_drvextra_cmd_hdl23a(struct rtw_adapter *padapter, const u8 *pbuf)
 {
-       struct drvextra_cmd_parm *pdrvextra_cmd;
+       const struct drvextra_cmd_parm *pdrvextra_cmd;
 
        if (!pbuf)
                return H2C_PARAMETERS_ERROR;
@@ -1482,7 +1482,11 @@ u8 rtw_drvextra_cmd_hdl23a(struct rtw_adapter *padapter, const u8 *pbuf)
 
        if (pdrvextra_cmd->pbuf && (pdrvextra_cmd->type_size > 0)) {
                kfree(pdrvextra_cmd->pbuf);
-               pdrvextra_cmd->pbuf = NULL;
+               /*
+                * No need to set pdrvextra_cmd->pbuf = NULL as we were
+                * operating on a copy of the original pcmd->parmbuf
+                * created in rtw_cmd_work().
+                */
        }
 
        return H2C_SUCCESS;
index 4ac1821bd9a4fe95362856d81c1d31ffc054c14c..303b76f9e1965230887b2113e9c2de86dcf1dfe7 100644 (file)
@@ -3959,7 +3959,8 @@ void issue_action_spct_ch_switch23a(struct rtw_adapter *padapter,
        dump_mgntframe23a(padapter, pmgntframe);
 }
 
-void issue_action_BA23a(struct rtw_adapter *padapter, unsigned char *raddr,
+void issue_action_BA23a(struct rtw_adapter *padapter,
+                       const unsigned char *raddr,
                        unsigned char action, unsigned short status)
 {
        u8 category = WLAN_CATEGORY_BACK;
@@ -5844,7 +5845,7 @@ u8 setopmode_hdl23a(struct rtw_adapter *padapter, const u8 *pbuf)
        u8      type;
        struct mlme_ext_priv    *pmlmeext = &padapter->mlmeextpriv;
        struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
-       struct setopmode_parm *psetop = (struct setopmode_parm *)pbuf;
+       const struct setopmode_parm *psetop = (struct setopmode_parm *)pbuf;
 
        if (psetop->mode == Ndis802_11APMode) {
                pmlmeinfo->state = WIFI_FW_AP_STATE;
@@ -5869,7 +5870,7 @@ u8 createbss_hdl23a(struct rtw_adapter *padapter, const u8 *pbuf)
        struct mlme_ext_priv    *pmlmeext = &padapter->mlmeextpriv;
        struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
        struct wlan_bssid_ex *pnetwork = &pmlmeinfo->network;
-       struct wlan_bssid_ex *pparm = (struct wlan_bssid_ex *)pbuf;
+       const struct wlan_bssid_ex *pparm = (struct wlan_bssid_ex *)pbuf;
        /* u32  initialgain; */
 
        if (pparm->InfrastructureMode == Ndis802_11APMode) {
@@ -5927,7 +5928,7 @@ u8 join_cmd_hdl23a(struct rtw_adapter *padapter, const u8 *pbuf)
        struct mlme_ext_priv    *pmlmeext = &padapter->mlmeextpriv;
        struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
        struct wlan_bssid_ex *pnetwork = &pmlmeinfo->network;
-       struct wlan_bssid_ex *pparm = (struct wlan_bssid_ex *)pbuf;
+       const struct wlan_bssid_ex *pparm = (struct wlan_bssid_ex *)pbuf;
        struct HT_info_element *pht_info;
        u32 i;
         /* u32 initialgain; */
@@ -6045,7 +6046,7 @@ u8 join_cmd_hdl23a(struct rtw_adapter *padapter, const u8 *pbuf)
 
 u8 disconnect_hdl23a(struct rtw_adapter *padapter, const u8 *pbuf)
 {
-       struct disconnect_parm *param = (struct disconnect_parm *)pbuf;
+       const struct disconnect_parm *param = (struct disconnect_parm *)pbuf;
        struct mlme_ext_priv    *pmlmeext = &padapter->mlmeextpriv;
        struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
        struct wlan_bssid_ex *pnetwork = &pmlmeinfo->network;
@@ -6089,8 +6090,10 @@ u8 disconnect_hdl23a(struct rtw_adapter *padapter, const u8 *pbuf)
        return  H2C_SUCCESS;
 }
 
-static int rtw_scan_ch_decision(struct rtw_adapter *padapter, struct rtw_ieee80211_channel *out,
-       u32 out_num, struct rtw_ieee80211_channel *in, u32 in_num)
+static int
+rtw_scan_ch_decision(struct rtw_adapter *padapter,
+                    struct rtw_ieee80211_channel *out, u32 out_num,
+                    const struct rtw_ieee80211_channel *in, u32 in_num)
 {
        int i, j;
        int scan_ch_num = 0;
@@ -6157,7 +6160,7 @@ static int rtw_scan_ch_decision(struct rtw_adapter *padapter, struct rtw_ieee802
 u8 sitesurvey_cmd_hdl23a(struct rtw_adapter *padapter, const u8 *pbuf)
 {
        struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
-       struct sitesurvey_parm *pparm = (struct sitesurvey_parm *)pbuf;
+       const struct sitesurvey_parm *pparm = (struct sitesurvey_parm *)pbuf;
        u8 bdelayscan = false;
        u32 initialgain;
        u32 i;
@@ -6238,7 +6241,7 @@ u8 sitesurvey_cmd_hdl23a(struct rtw_adapter *padapter, const u8 *pbuf)
 
 u8 setauth_hdl23a(struct rtw_adapter *padapter, const u8 *pbuf)
 {
-       struct setauth_parm             *pparm = (struct setauth_parm *)pbuf;
+       const struct setauth_parm *pparm = (struct setauth_parm *)pbuf;
        struct mlme_ext_priv    *pmlmeext = &padapter->mlmeextpriv;
        struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
 
@@ -6253,7 +6256,7 @@ u8 setauth_hdl23a(struct rtw_adapter *padapter, const u8 *pbuf)
 u8 setkey_hdl23a(struct rtw_adapter *padapter, const u8 *pbuf)
 {
        unsigned short                          ctrl;
-       struct setkey_parm              *pparm = (struct setkey_parm *)pbuf;
+       const struct setkey_parm *pparm = (struct setkey_parm *)pbuf;
        struct mlme_ext_priv    *pmlmeext = &padapter->mlmeextpriv;
        struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
        unsigned char                                   null_sta[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
@@ -6281,7 +6284,7 @@ u8 set_stakey_hdl23a(struct rtw_adapter *padapter, const u8 *pbuf)
        u8 cam_id;/* cam_entry */
        struct mlme_ext_priv    *pmlmeext = &padapter->mlmeextpriv;
        struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
-       struct set_stakey_parm  *pparm = (struct set_stakey_parm *)pbuf;
+       const struct set_stakey_parm *pparm = (struct set_stakey_parm *)pbuf;
 
        /* cam_entry: */
        /* 0~3 for default key */
@@ -6364,7 +6367,7 @@ u8 set_stakey_hdl23a(struct rtw_adapter *padapter, const u8 *pbuf)
 
 u8 add_ba_hdl23a(struct rtw_adapter *padapter, const u8 *pbuf)
 {
-       struct addBaReq_parm    *pparm = (struct addBaReq_parm *)pbuf;
+       const struct addBaReq_parm *pparm = (struct addBaReq_parm *)pbuf;
        struct mlme_ext_priv    *pmlmeext = &padapter->mlmeextpriv;
        struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
 
@@ -6436,7 +6439,7 @@ u8 mlme_evt_hdl23a(struct rtw_adapter *padapter, const u8 *pbuf)
 {
        u8 evt_code, evt_seq;
        u16 evt_sz;
-       uint    *peventbuf;
+       const uint *peventbuf;
        void (*event_callback)(struct rtw_adapter *dev, u8 *pbuf);
        struct evt_priv *pevt_priv = &padapter->evtpriv;
 
@@ -6544,7 +6547,7 @@ u8 tx_beacon_hdl23a(struct rtw_adapter *padapter, const u8 *pbuf)
 
 u8 set_ch_hdl23a(struct rtw_adapter *padapter, const u8 *pbuf)
 {
-       struct set_ch_parm *set_ch_parm;
+       const struct set_ch_parm *set_ch_parm;
        struct mlme_ext_priv    *pmlmeext = &padapter->mlmeextpriv;
 
        if (!pbuf)
@@ -6567,7 +6570,7 @@ u8 set_ch_hdl23a(struct rtw_adapter *padapter, const u8 *pbuf)
 
 u8 set_chplan_hdl23a(struct rtw_adapter *padapter, const u8 *pbuf)
 {
-       struct SetChannelPlan_param *setChannelPlan_param;
+       const struct SetChannelPlan_param *setChannelPlan_param;
        struct mlme_ext_priv    *pmlmeext = &padapter->mlmeextpriv;
 
        if (!pbuf)
index 451b58f47287989069e4e66630882894ba80417e..a64c350591c2fe596c510e75973e0533be47220f 100644 (file)
@@ -405,12 +405,12 @@ void rtw_free_all_stainfo23a(struct rtw_adapter *padapter)
 }
 
 /* any station allocated can be searched by hash list */
-struct sta_info *rtw_get_stainfo23a(struct sta_priv *pstapriv, u8 *hwaddr)
+struct sta_info *rtw_get_stainfo23a(struct sta_priv *pstapriv, const u8 *hwaddr)
 {
        struct list_head *plist, *phead;
        struct sta_info *psta = NULL;
        u32     index;
-       u8 *addr;
+       const u8 *addr;
        u8 bc_addr[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
 
        if (hwaddr == NULL)
index d1701a35bc90a158c5ef535a4d2c05e82c076712..8e08977e929b82ce4b33434e59880d4490702737 100644 (file)
@@ -686,7 +686,7 @@ void rtl8723a_cam_invalid_all(struct rtw_adapter *padapter)
 }
 
 void rtl8723a_cam_write(struct rtw_adapter *padapter,
-                       u8 entry, u16 ctrl, u8 *mac, u8 *key)
+                       u8 entry, u16 ctrl, const u8 *mac, const u8 *key)
 {
        u32 cmd;
        unsigned int i, val, addr;
index 5f050a346a8a19b7c5e3c0a48aff01daa0c78461..4a161e26c8dc5c82690d51795dc3d7d7b9c3f441 100644 (file)
@@ -184,7 +184,7 @@ void rtl8723a_set_sec_cfg(struct rtw_adapter *padapter, u8 sec);
 void rtl8723a_cam_empty_entry(struct rtw_adapter *padapter, u8 ucIndex);
 void rtl8723a_cam_invalid_all(struct rtw_adapter *padapter);
 void rtl8723a_cam_write(struct rtw_adapter *padapter,
-                       u8 entry, u16 ctrl, u8 *mac, u8 *key);
+                       u8 entry, u16 ctrl, const u8 *mac, const u8 *key);
 void rtl8723a_fifo_cleanup(struct rtw_adapter *padapter);
 void rtl8723a_set_apfm_on_mac(struct rtw_adapter *padapter, u8 val);
 void rtl8723a_bcn_valid(struct rtw_adapter *padapter);
index 8a287c231034f32a8f456dfb858d0f7e6202385e..26d360178eac1265d282a163312bb00c7002bed4 100644 (file)
@@ -605,8 +605,9 @@ int issue_deauth23a_ex23a(struct rtw_adapter *padapter, u8 *da, unsigned short r
                    int try_cnt, int wait_ms);
 void issue_action_spct_ch_switch23a(struct rtw_adapter *padapter, u8 *ra,
                                 u8 new_ch, u8 ch_offset);
-void issue_action_BA23a(struct rtw_adapter *padapter, unsigned char *raddr,
-                    unsigned char action, unsigned short status);
+void issue_action_BA23a(struct rtw_adapter *padapter,
+                       const unsigned char *raddr,
+                       unsigned char action, unsigned short status);
 unsigned int send_delba23a(struct rtw_adapter *padapter, u8 initiator, u8 *addr);
 unsigned int send_beacon23a(struct rtw_adapter *padapter);
 
index ffbc9e3f2156f9e8eb225b625f0c473f356653ee..c02947f6bd9b37f7dd381dc0f942ebb022175234 100644 (file)
@@ -349,7 +349,7 @@ struct      sta_priv {
        struct wlan_acl_pool acl_list;
 };
 
-static inline u32 wifi_mac_hash(u8 *mac)
+static inline u32 wifi_mac_hash(const u8 *mac)
 {
        u32 x;
 
@@ -377,7 +377,7 @@ struct sta_info *rtw_get_stainfo23a_by_offset23a(struct sta_priv *stapriv,
 struct sta_info *rtw_alloc_stainfo23a(struct sta_priv *pstapriv, u8 *hwaddr);
 u32 rtw_free_stainfo23a(struct rtw_adapter *padapter, struct sta_info *psta);
 void rtw_free_all_stainfo23a(struct rtw_adapter *padapter);
-struct sta_info *rtw_get_stainfo23a(struct sta_priv *pstapriv, u8 *hwaddr);
+struct sta_info *rtw_get_stainfo23a(struct sta_priv *pstapriv, const u8 *hwaddr);
 u32 rtw_init_bcmc_stainfo23a(struct rtw_adapter *padapter);
 struct sta_info *rtw_get_bcmc_stainfo23a(struct rtw_adapter *padapter);
 u8 rtw_access_ctrl23a(struct rtw_adapter *padapter, u8 *mac_addr);