* Re: linux-4.4-rc8/drivers/gpio/gpio-generic.c: 2 * possible int/long mixup ?
[not found] <DUB128-W5686644DDCB66C9E75ECBB9CF20@phx.gbl>
@ 2016-01-05 9:43 ` Linus Walleij
0 siblings, 0 replies; only message in thread
From: Linus Walleij @ 2016-01-05 9:43 UTC (permalink / raw)
To: David Binderman; +Cc: gnurou@gmail.com, linux-gpio@vger.kernel.org
On Mon, Jan 4, 2016 at 10:12 AM, David Binderman <dcb314@hotmail.com> wrote:
> [linux-4.4-rc8/drivers/gpio/gpio-generic.c:129]: (style) int result is returned as long value. If the return value is long to avoid loss of information, then you have loss of information.
Where does this come from? Sparse? Coverity? Polyspace?
> Source code is
>
> static unsigned long bgpio_pin2mask(struct bgpio_chip *bgc, unsigned int pin)
> {
> return 1 << pin;
> }
>
> I don't know if pin can be>= 32. Suggest new code
>
> static unsigned long bgpio_pin2mask(struct bgpio_chip *bgc, unsigned int pin)
> {
> return 1UL << pin;
> }
I suggest:
#include <linux/bitops.h>
return BIT(pin);
Do you wanna patch it? Or should I do it?
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2016-01-05 9:43 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <DUB128-W5686644DDCB66C9E75ECBB9CF20@phx.gbl>
2016-01-05 9:43 ` linux-4.4-rc8/drivers/gpio/gpio-generic.c: 2 * possible int/long mixup ? Linus Walleij
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).