aboutsummaryrefslogtreecommitdiff
path: root/arch/arm
diff options
context:
space:
mode:
authorSebastien Jan <s-jan@ti.com>2011-10-25 10:51:57 +0800
committerAndy Green <andy.green@linaro.org>2011-11-19 08:53:43 +0800
commite8db717efd38d472d38034a925612c0cbcb648ca (patch)
treeb8dcc0f9ae317d20e0ad747cb9bd20e1a064dec9 /arch/arm
parentaf4cfaaade038cb3d6bce56124baf42f8fd374d7 (diff)
OMAP2+: mailbox: fix lookups for multiple mailboxes
Re-apply the following patch. It was partially reverted by a merge with mutex addition. This fix is required because, as expected, the concerned code generates an error with gcc4.6 (but not with gcc4.5!). OMAP2+: mailbox: fix lookups for multiple mailboxes The pointer math in omap_mbox_get() is not quite right, and leads to passing NULL to strcmp() when searching for an mbox that is not first in the list. Convert to using array indexing as is done in all the other functions which walk the mbox list. Tested on OMAP2420/n810, OMAP3630/zoom3, OMAP4430/Blaze Signed-off-by: Kevin Hilman <khilman@ti.com> Signed-off-by: Tony Lindgren <tony@atomide.com> Conflicts: arch/arm/plat-omap/mailbox.c Signed-off-by: Sebastien Jan <s-jan@ti.com>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/plat-omap/mailbox.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/arch/arm/plat-omap/mailbox.c b/arch/arm/plat-omap/mailbox.c
index b6137aa0321..dea4a22604b 100644
--- a/arch/arm/plat-omap/mailbox.c
+++ b/arch/arm/plat-omap/mailbox.c
@@ -351,9 +351,12 @@ struct omap_mbox *omap_mbox_get(const char *name, struct notifier_block *nb)
return ERR_PTR(-EINVAL);
mutex_lock(&mboxes_lock);
- for (mbox = *mboxes; mbox; mbox++)
- if (!strcmp(mbox->name, name))
+ for (i = 0; (_mbox = mboxes[i]); i++) {
+ if (!strcmp(_mbox->name, name)) {
+ mbox = _mbox;
break;
+ }
+ }
if (!mbox) {
mutex_unlock(&mboxes_lock);