staging: most: remove unneeded NULL check
authorSudip Mukherjee <sudipm.mukherjee@gmail.com>
Fri, 4 Sep 2015 10:52:05 +0000 (16:22 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 13 Sep 2015 01:24:44 +0000 (18:24 -0700)
The loop cursor of list_for_each_entry_safe() can never be NULL.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/most/mostcore/core.c

index 7bb16db..87f950f 100644 (file)
@@ -190,8 +190,7 @@ static void flush_channel_fifos(struct most_c_obj *c)
        list_for_each_entry_safe(mbo, tmp, &c->fifo, list) {
                list_del(&mbo->list);
                spin_unlock_irqrestore(&c->fifo_lock, flags);
-               if (likely(mbo))
-                       most_free_mbo_coherent(mbo);
+               most_free_mbo_coherent(mbo);
                spin_lock_irqsave(&c->fifo_lock, flags);
        }
        spin_unlock_irqrestore(&c->fifo_lock, flags);
@@ -200,8 +199,7 @@ static void flush_channel_fifos(struct most_c_obj *c)
        list_for_each_entry_safe(mbo, tmp, &c->halt_fifo, list) {
                list_del(&mbo->list);
                spin_unlock_irqrestore(&c->fifo_lock, hf_flags);
-               if (likely(mbo))
-                       most_free_mbo_coherent(mbo);
+               most_free_mbo_coherent(mbo);
                spin_lock_irqsave(&c->fifo_lock, hf_flags);
        }
        spin_unlock_irqrestore(&c->fifo_lock, hf_flags);