From: Kautuk Consul <consul.kautuk@gmail.com>
To: Russell King <linux@arm.linux.org.uk>
Cc: linux-kernel@vger.kernel.org, Kautuk Consul <consul.kautuk@gmail.com>
Subject: [PATCH 1/1] drivers/amba/bus.c: Don't perform extra matching when any one fails
Date: Thu, 1 Sep 2011 23:25:15 +0530 [thread overview]
Message-ID: <1314899715-20311-1-git-send-email-consul.kautuk@gmail.com> (raw)
If any one operation fails, then r anyways gets set to 0, which will
cause the device to not match the find_data.
Signed-off-by: Kautuk Consul <consul.kautuk@gmail.com>
---
drivers/amba/bus.c | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/amba/bus.c b/drivers/amba/bus.c
index d74926e..af2e0a1 100644
--- a/drivers/amba/bus.c
+++ b/drivers/amba/bus.c
@@ -699,10 +699,12 @@ static int amba_find_match(struct device *dev, void *data)
int r;
r = (pcdev->periphid & d->mask) == d->id;
- if (d->parent)
- r &= d->parent == dev->parent;
- if (d->busid)
- r &= strcmp(dev_name(dev), d->busid) == 0;
+ if (r) {
+ if (d->parent)
+ r &= d->parent == dev->parent;
+ if (r && d->busid)
+ r &= strcmp(dev_name(dev), d->busid) == 0;
+ }
if (r) {
get_device(dev);
--
1.7.4.1
reply other threads:[~2011-09-01 17:55 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1314899715-20311-1-git-send-email-consul.kautuk@gmail.com \
--to=consul.kautuk@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
/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®