All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] net: wwan: Fix bit ops double shift
@ 2021-04-20 19:09 Loic Poulain
  2021-04-21  0:00 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: Loic Poulain @ 2021-04-20 19:09 UTC (permalink / raw)
  To: kuba, davem; +Cc: netdev, Loic Poulain

bit operation helpers such as test_bit, clear_bit, etc take bit
position as parameter and not value. Current usage causes double
shift => BIT(BIT(0)). Fix that in wwan_core and mhi_wwan_ctrl.

Fixes: 9a44c1cc6388 ("net: Add a WWAN subsystem")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
---
 drivers/net/wwan/mhi_wwan_ctrl.c | 8 +++++---
 drivers/net/wwan/wwan_core.c     | 2 +-
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wwan/mhi_wwan_ctrl.c b/drivers/net/wwan/mhi_wwan_ctrl.c
index 1fc2376..1bc6b69 100644
--- a/drivers/net/wwan/mhi_wwan_ctrl.c
+++ b/drivers/net/wwan/mhi_wwan_ctrl.c
@@ -7,9 +7,11 @@
 #include <linux/wwan.h>
 
 /* MHI wwan flags */
-#define MHI_WWAN_DL_CAP		BIT(0)
-#define MHI_WWAN_UL_CAP		BIT(1)
-#define MHI_WWAN_RX_REFILL	BIT(2)
+enum mhi_wwan_flags {
+	MHI_WWAN_DL_CAP,
+	MHI_WWAN_UL_CAP,
+	MHI_WWAN_RX_REFILL,
+};
 
 #define MHI_WWAN_MAX_MTU	0x8000
 
diff --git a/drivers/net/wwan/wwan_core.c b/drivers/net/wwan/wwan_core.c
index b618b79..5be5e1e 100644
--- a/drivers/net/wwan/wwan_core.c
+++ b/drivers/net/wwan/wwan_core.c
@@ -26,7 +26,7 @@ static int wwan_major;
 #define to_wwan_port(d) container_of(d, struct wwan_port, dev)
 
 /* WWAN port flags */
-#define WWAN_PORT_TX_OFF	BIT(0)
+#define WWAN_PORT_TX_OFF	0
 
 /**
  * struct wwan_device - The structure that defines a WWAN device
-- 
2.7.4


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

* Re: [PATCH net-next] net: wwan: Fix bit ops double shift
  2021-04-20 19:09 [PATCH net-next] net: wwan: Fix bit ops double shift Loic Poulain
@ 2021-04-21  0:00 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-04-21  0:00 UTC (permalink / raw)
  To: Loic Poulain; +Cc: kuba, davem, netdev

Hello:

This patch was applied to netdev/net-next.git (refs/heads/master):

On Tue, 20 Apr 2021 21:09:57 +0200 you wrote:
> bit operation helpers such as test_bit, clear_bit, etc take bit
> position as parameter and not value. Current usage causes double
> shift => BIT(BIT(0)). Fix that in wwan_core and mhi_wwan_ctrl.
> 
> Fixes: 9a44c1cc6388 ("net: Add a WWAN subsystem")
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
> 
> [...]

Here is the summary with links:
  - [net-next] net: wwan: Fix bit ops double shift
    https://git.kernel.org/netdev/net-next/c/b8c55ce266de

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2021-04-21  0:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-20 19:09 [PATCH net-next] net: wwan: Fix bit ops double shift Loic Poulain
2021-04-21  0:00 ` patchwork-bot+netdevbpf

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.