All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH][next] rtw88: remove redundant null pointer check on arrays
@ 2019-10-25 11:30 ` Colin King
  0 siblings, 0 replies; 4+ messages in thread
From: Colin King @ 2019-10-25 11:30 UTC (permalink / raw)
  To: Yan-Hsuan Chuang, Kalle Valo, David S . Miller, Chris Chiu,
	Tzu-En Huang, linux-wireless, netdev
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

The checks to see if swing_table->n or swing_table->p are null are
redundant since n and p are arrays and can never be null if
swing_table is non-null.  I believe these are redundant checks
and can be safely removed, especially the checks implies that these
are not arrays which can lead to confusion.

Addresses-Coverity: ("Array compared against 0")
Fixes: c97ee3e0bea2 ("rtw88: add power tracking support")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/net/wireless/realtek/rtw88/phy.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/realtek/rtw88/phy.c b/drivers/net/wireless/realtek/rtw88/phy.c
index 69e7edb629f4..11893ec73376 100644
--- a/drivers/net/wireless/realtek/rtw88/phy.c
+++ b/drivers/net/wireless/realtek/rtw88/phy.c
@@ -2071,7 +2071,7 @@ s8 rtw_phy_pwrtrack_get_pwridx(struct rtw_dev *rtwdev,
 		return 0;
 	}
 
-	if (!swing_table || !swing_table->n || !swing_table->p) {
+	if (!swing_table) {
 		rtw_warn(rtwdev, "swing table not configured\n");
 		return 0;
 	}
-- 
2.20.1


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

* [PATCH][next] rtw88: remove redundant null pointer check on arrays
@ 2019-10-25 11:30 ` Colin King
  0 siblings, 0 replies; 4+ messages in thread
From: Colin King @ 2019-10-25 11:30 UTC (permalink / raw)
  To: Yan-Hsuan Chuang, Kalle Valo, David S . Miller, Chris Chiu,
	Tzu-En Huang, linux-wireless, netdev
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

The checks to see if swing_table->n or swing_table->p are null are
redundant since n and p are arrays and can never be null if
swing_table is non-null.  I believe these are redundant checks
and can be safely removed, especially the checks implies that these
are not arrays which can lead to confusion.

Addresses-Coverity: ("Array compared against 0")
Fixes: c97ee3e0bea2 ("rtw88: add power tracking support")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/net/wireless/realtek/rtw88/phy.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/realtek/rtw88/phy.c b/drivers/net/wireless/realtek/rtw88/phy.c
index 69e7edb629f4..11893ec73376 100644
--- a/drivers/net/wireless/realtek/rtw88/phy.c
+++ b/drivers/net/wireless/realtek/rtw88/phy.c
@@ -2071,7 +2071,7 @@ s8 rtw_phy_pwrtrack_get_pwridx(struct rtw_dev *rtwdev,
 		return 0;
 	}
 
-	if (!swing_table || !swing_table->n || !swing_table->p) {
+	if (!swing_table) {
 		rtw_warn(rtwdev, "swing table not configured\n");
 		return 0;
 	}
-- 
2.20.1

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

* Re: [PATCH][next] rtw88: remove redundant null pointer check on arrays
  2019-10-25 11:30 ` Colin King
@ 2019-10-31  8:05   ` Kalle Valo
  -1 siblings, 0 replies; 4+ messages in thread
From: Kalle Valo @ 2019-10-31  8:05 UTC (permalink / raw)
  To: Colin King
  Cc: Yan-Hsuan Chuang, David S . Miller, Chris Chiu, Tzu-En Huang,
	linux-wireless, netdev, kernel-janitors, linux-kernel

Colin King <colin.king@canonical.com> wrote:

> From: Colin Ian King <colin.king@canonical.com>
> 
> The checks to see if swing_table->n or swing_table->p are null are
> redundant since n and p are arrays and can never be null if
> swing_table is non-null.  I believe these are redundant checks
> and can be safely removed, especially the checks implies that these
> are not arrays which can lead to confusion.
> 
> Addresses-Coverity: ("Array compared against 0")
> Fixes: c97ee3e0bea2 ("rtw88: add power tracking support")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

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

baff8da6e163 rtw88: remove redundant null pointer check on arrays

-- 
https://patchwork.kernel.org/patch/11212093/

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


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

* Re: [PATCH][next] rtw88: remove redundant null pointer check on arrays
@ 2019-10-31  8:05   ` Kalle Valo
  0 siblings, 0 replies; 4+ messages in thread
From: Kalle Valo @ 2019-10-31  8:05 UTC (permalink / raw)
  To: Colin King
  Cc: Yan-Hsuan Chuang, David S . Miller, Chris Chiu, Tzu-En Huang,
	linux-wireless, netdev, kernel-janitors, linux-kernel

Colin King <colin.king@canonical.com> wrote:

> From: Colin Ian King <colin.king@canonical.com>
> 
> The checks to see if swing_table->n or swing_table->p are null are
> redundant since n and p are arrays and can never be null if
> swing_table is non-null.  I believe these are redundant checks
> and can be safely removed, especially the checks implies that these
> are not arrays which can lead to confusion.
> 
> Addresses-Coverity: ("Array compared against 0")
> Fixes: c97ee3e0bea2 ("rtw88: add power tracking support")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

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

baff8da6e163 rtw88: remove redundant null pointer check on arrays

-- 
https://patchwork.kernel.org/patch/11212093/

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

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

end of thread, other threads:[~2019-10-31  8:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-25 11:30 [PATCH][next] rtw88: remove redundant null pointer check on arrays Colin King
2019-10-25 11:30 ` Colin King
2019-10-31  8:05 ` Kalle Valo
2019-10-31  8:05   ` 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.