[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Tue, 7 Jul 2020 14:33:36 +0200
From: Linus Walleij <linus.walleij@...aro.org>
To: Lee Jones <lee.jones@...aro.org>
Cc: Linux ARM <linux-arm-kernel@...ts.infradead.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
stable <stable@...r.kernel.org>
Subject: Re: [PATCH 06/10] mfd: ab3100-core: Fix incompatible types in
comparison expression warning
On Wed, Jun 24, 2020 at 5:07 PM Lee Jones <lee.jones@...aro.org> wrote:
> Smatch reports:
>
> drivers/mfd/ab3100-core.c:501:20: error: incompatible types in comparison expression (different type sizes):
> drivers/mfd/ab3100-core.c:501:20: unsigned int *
> drivers/mfd/ab3100-core.c:501:20: unsigned long *
> drivers/mfd/ab8500-debugfs.c:1804:20: error: incompatible types in comparison expression (different type sizes):
> drivers/mfd/ab8500-debugfs.c:1804:20: unsigned int *
> drivers/mfd/ab8500-debugfs.c:1804:20: unsigned long *
>
> Since the second min() argument can be less than 0 a signed
> variable is required for assignment. However, the non-sized
> type size_t is passed in from the userspace handlers. In order
> to firstly compare, then assign the smallest value, we firstly
> need to cast them both to the same as the receiving size_t typed
> variable.
>
> Cc: <stable@...r.kernel.org>
> Cc: Linus Walleij <linus.walleij@...aro.org>
> Signed-off-by: Lee Jones <lee.jones@...aro.org>
Reviewed-by: Linus Walleij <linus.walleij@...aro.org>
Yours,
Linus Walleij
Powered by blists - more mailing lists