netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next v1 0/1] queue_api: reduce risk of name collision over txq
@ 2025-05-18 10:00 Gur Stavi
  2025-05-18 10:00 ` [PATCH net-next v1 1/1] " Gur Stavi
  2025-05-20  3:20 ` [PATCH net-next v1 0/1] " patchwork-bot+netdevbpf
  0 siblings, 2 replies; 4+ messages in thread
From: Gur Stavi @ 2025-05-18 10:00 UTC (permalink / raw)
  To: Gur Stavi
  Cc: netdev, linux-kernel, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Simon Horman

Rename local variable in macros from txq to _txq.
When macro parameter get_desc is expended it is likely to have a txq
token that refers to a different txq variable at the caller's site.

Gur Stavi (1):
  queue_api: reduce risk of name collision over txq

 include/net/netdev_queues.h | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)


base-commit: 67fa756408a5359941bea2c021740da5e9ed490d
-- 
2.45.2


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

* [PATCH net-next v1 1/1] queue_api: reduce risk of name collision over txq
  2025-05-18 10:00 [PATCH net-next v1 0/1] queue_api: reduce risk of name collision over txq Gur Stavi
@ 2025-05-18 10:00 ` Gur Stavi
  2025-05-19 23:09   ` Jakub Kicinski
  2025-05-20  3:20 ` [PATCH net-next v1 0/1] " patchwork-bot+netdevbpf
  1 sibling, 1 reply; 4+ messages in thread
From: Gur Stavi @ 2025-05-18 10:00 UTC (permalink / raw)
  To: Gur Stavi
  Cc: netdev, linux-kernel, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Simon Horman

Rename local variable in macros from txq to _txq.
When macro parameter get_desc is expended it is likely to have a txq
token that refers to a different txq variable at the caller's site.

Signed-off-by: Gur Stavi <gur.stavi@huawei.com>
---
 include/net/netdev_queues.h | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/include/net/netdev_queues.h b/include/net/netdev_queues.h
index 069ff35a72de..ba2eaf39089b 100644
--- a/include/net/netdev_queues.h
+++ b/include/net/netdev_queues.h
@@ -288,27 +288,27 @@ netdev_txq_completed_mb(struct netdev_queue *dev_queue,
 
 #define netif_subqueue_try_stop(dev, idx, get_desc, start_thrs)		\
 	({								\
-		struct netdev_queue *txq;				\
+		struct netdev_queue *_txq;				\
 									\
-		txq = netdev_get_tx_queue(dev, idx);			\
-		netif_txq_try_stop(txq, get_desc, start_thrs);		\
+		_txq = netdev_get_tx_queue(dev, idx);			\
+		netif_txq_try_stop(_txq, get_desc, start_thrs);		\
 	})
 
 #define netif_subqueue_maybe_stop(dev, idx, get_desc, stop_thrs, start_thrs) \
 	({								\
-		struct netdev_queue *txq;				\
+		struct netdev_queue *_txq;				\
 									\
-		txq = netdev_get_tx_queue(dev, idx);			\
-		netif_txq_maybe_stop(txq, get_desc, stop_thrs, start_thrs); \
+		_txq = netdev_get_tx_queue(dev, idx);			\
+		netif_txq_maybe_stop(_txq, get_desc, stop_thrs, start_thrs); \
 	})
 
 #define netif_subqueue_completed_wake(dev, idx, pkts, bytes,		\
 				      get_desc, start_thrs)		\
 	({								\
-		struct netdev_queue *txq;				\
+		struct netdev_queue *_txq;				\
 									\
-		txq = netdev_get_tx_queue(dev, idx);			\
-		netif_txq_completed_wake(txq, pkts, bytes,		\
+		_txq = netdev_get_tx_queue(dev, idx);			\
+		netif_txq_completed_wake(_txq, pkts, bytes,		\
 					 get_desc, start_thrs);		\
 	})
 
-- 
2.45.2


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

* Re: [PATCH net-next v1 1/1] queue_api: reduce risk of name collision over txq
  2025-05-18 10:00 ` [PATCH net-next v1 1/1] " Gur Stavi
@ 2025-05-19 23:09   ` Jakub Kicinski
  0 siblings, 0 replies; 4+ messages in thread
From: Jakub Kicinski @ 2025-05-19 23:09 UTC (permalink / raw)
  To: Gur Stavi
  Cc: netdev, linux-kernel, David S. Miller, Eric Dumazet, Paolo Abeni,
	Simon Horman

On Sun, 18 May 2025 13:00:54 +0300 Gur Stavi wrote:
> Rename local variable in macros from txq to _txq.
> When macro parameter get_desc is expended it is likely to have a txq
> token that refers to a different txq variable at the caller's site.
> 
> Signed-off-by: Gur Stavi <gur.stavi@huawei.com>

Reviewed-by: Jakub Kicinski <kuba@kernel.org>

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

* Re: [PATCH net-next v1 0/1] queue_api: reduce risk of name collision over txq
  2025-05-18 10:00 [PATCH net-next v1 0/1] queue_api: reduce risk of name collision over txq Gur Stavi
  2025-05-18 10:00 ` [PATCH net-next v1 1/1] " Gur Stavi
@ 2025-05-20  3:20 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-05-20  3:20 UTC (permalink / raw)
  To: Gur Stavi; +Cc: netdev, linux-kernel, davem, edumazet, kuba, pabeni, horms

Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Sun, 18 May 2025 13:00:53 +0300 you wrote:
> Rename local variable in macros from txq to _txq.
> When macro parameter get_desc is expended it is likely to have a txq
> token that refers to a different txq variable at the caller's site.
> 
> Gur Stavi (1):
>   queue_api: reduce risk of name collision over txq
> 
> [...]

Here is the summary with links:
  - [net-next,v1,1/1] queue_api: reduce risk of name collision over txq
    https://git.kernel.org/netdev/net-next/c/84b21e61ebd6

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] 4+ messages in thread

end of thread, other threads:[~2025-05-20  3:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-18 10:00 [PATCH net-next v1 0/1] queue_api: reduce risk of name collision over txq Gur Stavi
2025-05-18 10:00 ` [PATCH net-next v1 1/1] " Gur Stavi
2025-05-19 23:09   ` Jakub Kicinski
2025-05-20  3:20 ` [PATCH net-next v1 0/1] " patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).