From: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org,
Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Subject: [PATCH 4/5] staging: most: remove unneeded NULL check
Date: Fri, 4 Sep 2015 16:22:05 +0530 [thread overview]
Message-ID: <1441363926-5025-4-git-send-email-sudipm.mukherjee@gmail.com> (raw)
In-Reply-To: <1441363926-5025-1-git-send-email-sudipm.mukherjee@gmail.com>
The loop cursor of list_for_each_entry_safe() can never be NULL.
Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
---
drivers/staging/most/mostcore/core.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/most/mostcore/core.c b/drivers/staging/most/mostcore/core.c
index 7bb16db..87f950f 100644
--- a/drivers/staging/most/mostcore/core.c
+++ b/drivers/staging/most/mostcore/core.c
@@ -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);
--
1.9.1
next prev parent reply other threads:[~2015-09-04 10:52 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-04 10:52 [PATCH 1/5] staging: most: remove always true comparison Sudip Mukherjee
2015-09-04 10:52 ` [PATCH 2/5] staging: most: return NULL instead of integer Sudip Mukherjee
2015-09-04 10:52 ` [PATCH 3/5] staging: most: remove driver owner Sudip Mukherjee
2015-09-07 12:13 ` Andrey Shvetsov
2015-09-07 12:46 ` Sudip Mukherjee
2015-09-08 9:56 ` Andrey Shvetsov
2015-09-08 16:48 ` Greg Kroah-Hartman
2015-09-04 10:52 ` Sudip Mukherjee [this message]
2015-09-04 10:52 ` [PATCH 5/5] staging: most: style of bool comparison Sudip Mukherjee
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1441363926-5025-4-git-send-email-sudipm.mukherjee@gmail.com \
--to=sudipm.mukherjee@gmail.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®