[PATCH] bsps/sparc: Fix ambapp_find_by_idx()

Sebastian Huber sebastian.huber at embedded-brains.de
Tue Feb 11 09:10:05 UTC 2014


The expression "*pi++" post-increments the pointer (not the value).
---
 .../libbsp/sparc/shared/amba/ambapp_find_by_idx.c  |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/c/src/lib/libbsp/sparc/shared/amba/ambapp_find_by_idx.c b/c/src/lib/libbsp/sparc/shared/amba/ambapp_find_by_idx.c
index 7c6db62..d524a3c 100644
--- a/c/src/lib/libbsp/sparc/shared/amba/ambapp_find_by_idx.c
+++ b/c/src/lib/libbsp/sparc/shared/amba/ambapp_find_by_idx.c
@@ -28,7 +28,7 @@ int ambapp_find_by_idx(struct ambapp_dev *dev, int index, void *pcount)
   int *pi = pcount;
 
   if (pi) {
-    if (*pi-- == 0)
+    if ((*pi)-- == 0)
       return (int)dev;
     else
       return 0;
-- 
1.7.7




More information about the devel mailing list