[PATCH] bsps/sparc: Fix ambapp_find_by_idx()

Daniel Hellstrom daniel at gaisler.com
Tue Feb 11 11:51:51 UTC 2014


This is good. Had to do the same myself.

Daniel


On 02/11/2014 10:10 AM, Sebastian Huber wrote:
> 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;


-- 
Daniel Hellstrom
Software Section Head
Aeroflex Gaisler AB
Aeroflex Microelectronic Solutions – HiRel
Kungsgatan 12
SE-411 19 Gothenburg, Sweden
Phone: +46 31 7758657
daniel at gaisler.com
www.Aeroflex.com/Gaisler




More information about the devel mailing list