mirror of
https://github.com/torvalds/linux.git
synced 2026-05-28 00:53:34 +02:00
wifi: wilc1000: set wilc_set_mac_address parameter as const
Any attempt to provide a const mac address to wilc_set_mac_address results
in the following warning:
warning: passing argument 2 of 'wilc_set_mac_address' discards 'const'
qualifier from pointer target type [-Wdiscarded-qualifiers]
[...]
drivers/net/wireless/microchip/wilc1000/hif.h:170:52: note: expected 'u8 *'
{aka 'unsigned char *'} but argument is of type 'const unsigned char *'a
int wilc_set_mac_address(struct wilc_vif *vif, u8 *mac_addr);
Instead of using an explicit cast each time we need provide a MAC address,
set the function parameter as const
Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://msgid.link/20240514-mac_addr_at_probe-v2-3-afef09f1cd10@bootlin.com
This commit is contained in:
parent
ec99908906
commit
5f1191ed38
|
|
@ -1293,7 +1293,7 @@ int wilc_get_mac_address(struct wilc_vif *vif, u8 *mac_addr)
|
|||
return result;
|
||||
}
|
||||
|
||||
int wilc_set_mac_address(struct wilc_vif *vif, u8 *mac_addr)
|
||||
int wilc_set_mac_address(struct wilc_vif *vif, const u8 *mac_addr)
|
||||
{
|
||||
struct wid wid;
|
||||
int result;
|
||||
|
|
@ -1301,7 +1301,7 @@ int wilc_set_mac_address(struct wilc_vif *vif, u8 *mac_addr)
|
|||
wid.id = WID_MAC_ADDR;
|
||||
wid.type = WID_STR;
|
||||
wid.size = ETH_ALEN;
|
||||
wid.val = mac_addr;
|
||||
wid.val = (u8 *)mac_addr;
|
||||
|
||||
result = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1);
|
||||
if (result)
|
||||
|
|
|
|||
|
|
@ -167,7 +167,7 @@ int wilc_add_rx_gtk(struct wilc_vif *vif, const u8 *rx_gtk, u8 gtk_key_len,
|
|||
u8 cipher_mode);
|
||||
int wilc_set_pmkid_info(struct wilc_vif *vif, struct wilc_pmkid_attr *pmkid);
|
||||
int wilc_get_mac_address(struct wilc_vif *vif, u8 *mac_addr);
|
||||
int wilc_set_mac_address(struct wilc_vif *vif, u8 *mac_addr);
|
||||
int wilc_set_mac_address(struct wilc_vif *vif, const u8 *mac_addr);
|
||||
int wilc_set_join_req(struct wilc_vif *vif, u8 *bssid, const u8 *ies,
|
||||
size_t ies_len);
|
||||
int wilc_disconnect(struct wilc_vif *vif);
|
||||
|
|
|
|||
|
|
@ -678,7 +678,7 @@ static int wilc_set_mac_addr(struct net_device *dev, void *p)
|
|||
}
|
||||
rcu_read_unlock();
|
||||
|
||||
result = wilc_set_mac_address(vif, (u8 *)addr->sa_data);
|
||||
result = wilc_set_mac_address(vif, addr->sa_data);
|
||||
if (result)
|
||||
return result;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user