netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] net: remove redundant NULL check in remove_xps_queue()
@ 2023-07-24  2:37 Zhengchao Shao
  2023-07-25  7:04 ` Simon Horman
  2023-07-26  3:10 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 4+ messages in thread
From: Zhengchao Shao @ 2023-07-24  2:37 UTC (permalink / raw)
  To: netdev, davem, edumazet, kuba, pabeni
  Cc: simon.horman, kuniyu, liuhangbin, jiri, hkallweit1, andy.ren,
	weiyongjun1, yuehaibing, shaozhengchao

There are currently two paths that call remove_xps_queue():
1. __netif_set_xps_queue -> remove_xps_queue
2. clean_xps_maps -> remove_xps_queue_cpu -> remove_xps_queue
There is no need to check dev_maps in remove_xps_queue() because
dev_maps has been checked on these two paths.

Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com>
---
 net/core/dev.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/net/core/dev.c b/net/core/dev.c
index f95e0674570f..76a91b849829 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -2384,8 +2384,7 @@ static bool remove_xps_queue(struct xps_dev_maps *dev_maps,
 	struct xps_map *map = NULL;
 	int pos;
 
-	if (dev_maps)
-		map = xmap_dereference(dev_maps->attr_map[tci]);
+	map = xmap_dereference(dev_maps->attr_map[tci]);
 	if (!map)
 		return false;
 
-- 
2.34.1


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

end of thread, other threads:[~2023-07-26  3:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-24  2:37 [PATCH net-next] net: remove redundant NULL check in remove_xps_queue() Zhengchao Shao
2023-07-25  7:04 ` Simon Horman
2023-07-26  2:25   ` shaozhengchao
2023-07-26  3:10 ` 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).