mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] cw1200: remove an unneeded NULL check on list iterator
@ 2022-03-19  6:38 Xiaomeng Tong
  2022-03-20  0:47 ` Jakob Koschel
  0 siblings, 1 reply; 3+ messages in thread
From: Xiaomeng Tong @ 2022-03-19  6:38 UTC (permalink / raw)
  To: pizza, kvalo, davem, kuba
  Cc: linux-wireless, netdev, linux-kernel, Xiaomeng Tong

The list iterator 'item' is always non-NULL so it doesn't need to be
checked. Thus just remove the unnecessary NULL check. Also remove the
unnecessary initializer because the list iterator is always initialized.

Signed-off-by: Xiaomeng Tong <xiam0nd.tong@gmail.com>
---
 drivers/net/wireless/st/cw1200/queue.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/st/cw1200/queue.c b/drivers/net/wireless/st/cw1200/queue.c
index 12952b1c29df..05392598e273 100644
--- a/drivers/net/wireless/st/cw1200/queue.c
+++ b/drivers/net/wireless/st/cw1200/queue.c
@@ -90,7 +90,7 @@ static void __cw1200_queue_gc(struct cw1200_queue *queue,
 			      bool unlock)
 {
 	struct cw1200_queue_stats *stats = queue->stats;
-	struct cw1200_queue_item *item = NULL, *tmp;
+	struct cw1200_queue_item *item, *tmp;
 	bool wakeup_stats = false;
 
 	list_for_each_entry_safe(item, tmp, &queue->queue, head) {
@@ -117,7 +117,7 @@ static void __cw1200_queue_gc(struct cw1200_queue *queue,
 			queue->overfull = false;
 			if (unlock)
 				__cw1200_queue_unlock(queue);
-		} else if (item) {
+		} else {
 			unsigned long tmo = item->queue_timestamp + queue->ttl;
 			mod_timer(&queue->gc, tmo);
 			cw1200_pm_stay_awake(&stats->priv->pm_state,
-- 
2.17.1


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

end of thread, other threads:[~2022-03-20  1:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-19  6:38 [PATCH] cw1200: remove an unneeded NULL check on list iterator Xiaomeng Tong
2022-03-20  0:47 ` Jakob Koschel
2022-03-20  1:53   ` Xiaomeng Tong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®