All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH wireless-drivers-next] rtw89: fix return value in hfc_pub_cfg_chk
@ 2021-10-21  6:32 Kevin Lo
  2021-10-22  0:26 ` Pkshih
  2021-10-27  7:37 ` Kalle Valo
  0 siblings, 2 replies; 3+ messages in thread
From: Kevin Lo @ 2021-10-21  6:32 UTC (permalink / raw)
  To: linux-wireless; +Cc: Pkshih

It seems to me when pub_cfg->grp0 + pub_cfg->grp1 != pub_cfg->pub_max is true,
it should return -EFAULT rather than 0.  Otherwise, the function doesn't need 
to exist.

Signed-off-by: Kevin Lo <kevlo@kevlo.org>
---
diff --git a/drivers/net/wireless/realtek/rtw89/mac.c b/drivers/net/wireless/realtek/rtw89/mac.c
index 69384c43c046..afcd07ab1de7 100644
--- a/drivers/net/wireless/realtek/rtw89/mac.c
+++ b/drivers/net/wireless/realtek/rtw89/mac.c
@@ -560,7 +560,7 @@ static int hfc_pub_cfg_chk(struct rtw89_dev *rtwdev)
 	const struct rtw89_hfc_pub_cfg *pub_cfg = &param->pub_cfg;
 
 	if (pub_cfg->grp0 + pub_cfg->grp1 != pub_cfg->pub_max)
-		return 0;
+		return -EFAULT;
 
 	return 0;
 }

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* RE: [PATCH wireless-drivers-next] rtw89: fix return value in hfc_pub_cfg_chk
  2021-10-21  6:32 [PATCH wireless-drivers-next] rtw89: fix return value in hfc_pub_cfg_chk Kevin Lo
@ 2021-10-22  0:26 ` Pkshih
  2021-10-27  7:37 ` Kalle Valo
  1 sibling, 0 replies; 3+ messages in thread
From: Pkshih @ 2021-10-22  0:26 UTC (permalink / raw)
  To: Kevin Lo, linux-wireless


> -----Original Message-----
> From: Kevin Lo <kevlo@kevlo.org>
> Sent: Thursday, October 21, 2021 2:32 PM
> To: linux-wireless@vger.kernel.org
> Cc: Pkshih <pkshih@realtek.com>
> Subject: [PATCH wireless-drivers-next] rtw89: fix return value in hfc_pub_cfg_chk
> 
> It seems to me when pub_cfg->grp0 + pub_cfg->grp1 != pub_cfg->pub_max is true,
> it should return -EFAULT rather than 0.  Otherwise, the function doesn't need
> to exist.
> 
> Signed-off-by: Kevin Lo <kevlo@kevlo.org>

Acked-by: Ping-Ke Shih <pkshih@realtek.com>

> ---
> diff --git a/drivers/net/wireless/realtek/rtw89/mac.c b/drivers/net/wireless/realtek/rtw89/mac.c
> index 69384c43c046..afcd07ab1de7 100644
> --- a/drivers/net/wireless/realtek/rtw89/mac.c
> +++ b/drivers/net/wireless/realtek/rtw89/mac.c
> @@ -560,7 +560,7 @@ static int hfc_pub_cfg_chk(struct rtw89_dev *rtwdev)
>  	const struct rtw89_hfc_pub_cfg *pub_cfg = &param->pub_cfg;
> 
>  	if (pub_cfg->grp0 + pub_cfg->grp1 != pub_cfg->pub_max)
> -		return 0;
> +		return -EFAULT;

Fortunately, current checking is always equal, so it doesn't affect the result.

> 
>  	return 0;
>  }


--
Ping-Ke


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH wireless-drivers-next] rtw89: fix return value in hfc_pub_cfg_chk
  2021-10-21  6:32 [PATCH wireless-drivers-next] rtw89: fix return value in hfc_pub_cfg_chk Kevin Lo
  2021-10-22  0:26 ` Pkshih
@ 2021-10-27  7:37 ` Kalle Valo
  1 sibling, 0 replies; 3+ messages in thread
From: Kalle Valo @ 2021-10-27  7:37 UTC (permalink / raw)
  To: Kevin Lo; +Cc: linux-wireless, Pkshih

Kevin Lo <kevlo@kevlo.org> wrote:

> It seems to me when pub_cfg->grp0 + pub_cfg->grp1 != pub_cfg->pub_max is true,
> it should return -EFAULT rather than 0.  Otherwise, the function doesn't need 
> to exist.
> 
> Signed-off-by: Kevin Lo <kevlo@kevlo.org>
> Acked-by: Ping-Ke Shih <pkshih@realtek.com>
> 
> diff --git a/drivers/net/wireless/realtek/rtw89/mac.c b/drivers/net/wireless/realtek/rtw89/mac.c
> index 69384c43c046..afcd07ab1de7 100644
> --- a/drivers/net/wireless/realtek/rtw89/mac.c
> +++ b/drivers/net/wireless/realtek/rtw89/mac.c
> @@ -560,7 +560,7 @@ static int hfc_pub_cfg_chk(struct rtw89_dev *rtwdev)
>  	const struct rtw89_hfc_pub_cfg *pub_cfg = &param->pub_cfg;
>  
>  	if (pub_cfg->grp0 + pub_cfg->grp1 != pub_cfg->pub_max)
> -		return 0;
> +		return -EFAULT;
>  
>  	return 0;
>  }

Patch applied to wireless-drivers-next.git, thanks.

c6477cb23704 rtw89: fix return value in hfc_pub_cfg_chk

-- 
https://patchwork.kernel.org/project/linux-wireless/patch/YXEJey8lKksAZif4@ns.kevlo.org/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-10-27  7:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-21  6:32 [PATCH wireless-drivers-next] rtw89: fix return value in hfc_pub_cfg_chk Kevin Lo
2021-10-22  0:26 ` Pkshih
2021-10-27  7:37 ` Kalle Valo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.