Skip to content

Commit

Permalink
net: remove redundant NULL check in remove_xps_queue()
Browse files Browse the repository at this point in the history
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>
Link: https://lore.kernel.org/r/20230724023735.2751602-1-shaozhengchao@huawei.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Zhengchao Shao authored and Jakub Kicinski committed Jul 26, 2023
1 parent a5a91f5 commit f080864
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions net/core/dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit f080864

Please sign in to comment.