summaryrefslogtreecommitdiff
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-10-25 10:51:57 +0800
commited87187ae5daf451253c4850d894518c99337a0e (patch)
tree5ddc01d671900c0354fddff42d8bb83f1d858d6c
parentf886b215c01e1b682ce92d24da4947cc938a8055 (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>
-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);