All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ath10k: remove unnecessary comparison of unsigned integer with < 0
@ 2018-10-05 18:56 ` Gustavo A. R. Silva
  0 siblings, 0 replies; 5+ messages in thread
From: Gustavo A. R. Silva @ 2018-10-05 18:56 UTC (permalink / raw)
  To: Kalle Valo, David S. Miller
  Cc: ath10k, linux-wireless, netdev, linux-kernel, Gustavo A. R. Silva

There is no need to compare *ps_state_enable* with < 0 because
such variable is of type u8 (8 bits, unsigned), making it
impossible to hold a negative value.

Fix this by removing such comparison.

Addresses-Coverity-ID: 1473921 ("Unsigned compared against 0")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
 drivers/net/wireless/ath/ath10k/debug.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath10k/debug.c b/drivers/net/wireless/ath/ath10k/debug.c
index 2c0cb67..15964b3 100644
--- a/drivers/net/wireless/ath/ath10k/debug.c
+++ b/drivers/net/wireless/ath/ath10k/debug.c
@@ -2421,7 +2421,7 @@ static ssize_t ath10k_write_ps_state_enable(struct file *file,
 	if (kstrtou8_from_user(user_buf, count, 0, &ps_state_enable))
 		return -EINVAL;
 
-	if (ps_state_enable > 1 || ps_state_enable < 0)
+	if (ps_state_enable > 1)
 		return -EINVAL;
 
 	mutex_lock(&ar->conf_mutex);
-- 
2.7.4


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

* [PATCH] ath10k: remove unnecessary comparison of unsigned integer with < 0
@ 2018-10-05 18:56 ` Gustavo A. R. Silva
  0 siblings, 0 replies; 5+ messages in thread
From: Gustavo A. R. Silva @ 2018-10-05 18:56 UTC (permalink / raw)
  To: Kalle Valo, David S. Miller
  Cc: netdev, linux-wireless, linux-kernel, ath10k, Gustavo A. R. Silva

There is no need to compare *ps_state_enable* with < 0 because
such variable is of type u8 (8 bits, unsigned), making it
impossible to hold a negative value.

Fix this by removing such comparison.

Addresses-Coverity-ID: 1473921 ("Unsigned compared against 0")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
 drivers/net/wireless/ath/ath10k/debug.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath10k/debug.c b/drivers/net/wireless/ath/ath10k/debug.c
index 2c0cb67..15964b3 100644
--- a/drivers/net/wireless/ath/ath10k/debug.c
+++ b/drivers/net/wireless/ath/ath10k/debug.c
@@ -2421,7 +2421,7 @@ static ssize_t ath10k_write_ps_state_enable(struct file *file,
 	if (kstrtou8_from_user(user_buf, count, 0, &ps_state_enable))
 		return -EINVAL;
 
-	if (ps_state_enable > 1 || ps_state_enable < 0)
+	if (ps_state_enable > 1)
 		return -EINVAL;
 
 	mutex_lock(&ar->conf_mutex);
-- 
2.7.4


_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

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

* Re: [PATCH] ath10k: remove unnecessary comparison of unsigned integer with < 0
  2018-10-05 18:56 ` Gustavo A. R. Silva
  (?)
  (?)
@ 2018-10-13 17:24 ` Kalle Valo
  -1 siblings, 0 replies; 5+ messages in thread
From: Kalle Valo @ 2018-10-13 17:24 UTC (permalink / raw)
  To: Gustavo A. R. Silva
  Cc: David S. Miller, ath10k, linux-wireless, netdev, linux-kernel,
	Gustavo A. R. Silva

"Gustavo A. R. Silva" <gustavo@embeddedor.com> wrote:

> There is no need to compare *ps_state_enable* with < 0 because
> such variable is of type u8 (8 bits, unsigned), making it
> impossible to hold a negative value.
> 
> Fix this by removing such comparison.
> 
> Addresses-Coverity-ID: 1473921 ("Unsigned compared against 0")
> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>

Patch applied to ath-next branch of ath.git, thanks.

7bfd82bff60e ath10k: remove unnecessary comparison of unsigned integer with < 0

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

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


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

* Re: [PATCH] ath10k: remove unnecessary comparison of unsigned integer with < 0
  2018-10-05 18:56 ` Gustavo A. R. Silva
@ 2018-10-13 17:24   ` Kalle Valo
  -1 siblings, 0 replies; 5+ messages in thread
From: Kalle Valo @ 2018-10-13 17:24 UTC (permalink / raw)
  To: Gustavo A. R. Silva
  Cc: Gustavo A. R. Silva, netdev, linux-wireless, linux-kernel,
	ath10k, David S. Miller

"Gustavo A. R. Silva" <gustavo@embeddedor.com> wrote:

> There is no need to compare *ps_state_enable* with < 0 because
> such variable is of type u8 (8 bits, unsigned), making it
> impossible to hold a negative value.
> 
> Fix this by removing such comparison.
> 
> Addresses-Coverity-ID: 1473921 ("Unsigned compared against 0")
> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>

Patch applied to ath-next branch of ath.git, thanks.

7bfd82bff60e ath10k: remove unnecessary comparison of unsigned integer with < 0

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

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

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

* Re: [PATCH] ath10k: remove unnecessary comparison of unsigned integer with < 0
@ 2018-10-13 17:24   ` Kalle Valo
  0 siblings, 0 replies; 5+ messages in thread
From: Kalle Valo @ 2018-10-13 17:24 UTC (permalink / raw)
  To: Gustavo A. R. Silva
  Cc: netdev, linux-wireless, linux-kernel, ath10k, David S. Miller

"Gustavo A. R. Silva" <gustavo@embeddedor.com> wrote:

> There is no need to compare *ps_state_enable* with < 0 because
> such variable is of type u8 (8 bits, unsigned), making it
> impossible to hold a negative value.
> 
> Fix this by removing such comparison.
> 
> Addresses-Coverity-ID: 1473921 ("Unsigned compared against 0")
> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>

Patch applied to ath-next branch of ath.git, thanks.

7bfd82bff60e ath10k: remove unnecessary comparison of unsigned integer with < 0

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

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


_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

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

end of thread, other threads:[~2018-10-13 17:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-05 18:56 [PATCH] ath10k: remove unnecessary comparison of unsigned integer with < 0 Gustavo A. R. Silva
2018-10-05 18:56 ` Gustavo A. R. Silva
2018-10-13 17:24 ` Kalle Valo
2018-10-13 17:24   ` Kalle Valo
2018-10-13 17:24 ` 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.