summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/marvell/mwifiex/usb.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2024-08-16 08:56:10 +0200
committerKalle Valo <kvalo@kernel.org>2024-08-22 12:00:11 +0300
commit67a72043aa2e6f60f7bbe7bfa598ba168f16d04f (patch)
treec4a2b5e80d936a8a7c6a7845263ae7d05efe55c2 /drivers/net/wireless/marvell/mwifiex/usb.c
parentc9f4c1ec69728310a31080c266b8529381c1a7fa (diff)
wifi: mwifiex: remove unnecessary checks for valid priv
The pointers in adapter->priv[] are allocated in mwifiex_register(). With an allocation failed the function will return an error and driver initialization is aborted. This makes all checks for valid priv pointers unnecessary throughout the driver. In many places the pointers are assumed to be valid without checks, this patch removes the remaining checks. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Acked-by: Brian Norris <briannorris@chromium.org> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://patch.msgid.link/20240816-mwifiex-remove-priv-checks-v1-1-6dd6553e8ed9@pengutronix.de
Diffstat (limited to 'drivers/net/wireless/marvell/mwifiex/usb.c')
-rw-r--r--drivers/net/wireless/marvell/mwifiex/usb.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/net/wireless/marvell/mwifiex/usb.c b/drivers/net/wireless/marvell/mwifiex/usb.c
index 515e6db410f2..6085cd50970d 100644
--- a/drivers/net/wireless/marvell/mwifiex/usb.c
+++ b/drivers/net/wireless/marvell/mwifiex/usb.c
@@ -745,8 +745,6 @@ static void mwifiex_usb_port_resync(struct mwifiex_adapter *adapter)
if (adapter->usb_mc_status) {
for (i = 0; i < adapter->priv_num; i++) {
priv = adapter->priv[i];
- if (!priv)
- continue;
if ((priv->bss_role == MWIFIEX_BSS_ROLE_UAP &&
!priv->bss_started) ||
(priv->bss_role == MWIFIEX_BSS_ROLE_STA &&
@@ -758,8 +756,6 @@ static void mwifiex_usb_port_resync(struct mwifiex_adapter *adapter)
} else {
for (i = 0; i < adapter->priv_num; i++) {
priv = adapter->priv[i];
- if (!priv)
- continue;
if ((priv->bss_role == MWIFIEX_BSS_ROLE_UAP &&
priv->bss_started) ||
(priv->bss_role == MWIFIEX_BSS_ROLE_STA &&
@@ -770,8 +766,7 @@ static void mwifiex_usb_port_resync(struct mwifiex_adapter *adapter)
}
for (i = 0; i < adapter->priv_num; i++) {
priv = adapter->priv[i];
- if (priv)
- priv->usb_port = active_port;
+ priv->usb_port = active_port;
}
for (i = 0; i < MWIFIEX_TX_DATA_PORT; i++) {
if (active_port == card->port[i].tx_data_ep)