Re: [bug report] platform/x86: fujitsu-laptop: Clean up constants

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Mar 05, 2018 at 03:30:53PM -0800, Darren Hart wrote:
> On Sun, Mar 04, 2018 at 09:37:59PM +0100, Michał Kępień wrote:
> > > The patch 819cddae7cfa: "platform/x86: fujitsu-laptop: Clean up
> > > constants" from Feb 20, 2018, leads to the following static checker
> > > warning:
> > > 
> > >     drivers/platform/x86/fujitsu-laptop.c:763 acpi_fujitsu_laptop_leds_register()
> > >     warn: always true condition '(call_fext_func(device, ((1 << (12)) | (1 << (0))), 2, (1 << (16)), 0) != (1 << (31))) => (s32min-s32max != 2147483648)'
> > > 
> > >     drivers/platform/x86/fujitsu-laptop.c:816 acpi_fujitsu_laptop_add()
> > >     warn: impossible condition '(priv->flags_supported == (1 << (31))) => (0-2147483647,18446744071562067968-u64max == 2147483648)'
> > 
> > Thank you for catching this, Dan.  sparse did not complain and as luck
> > would have it, I am only able to test fujitsu-laptop on an x86 machine,
> > which this bug does not affect.  I have now incorporated smatch into my
> 
> Erm, Fujitsu-laptop "depends on X86" - so which machine does this affect?
> 
> I presume this is an issue on 32b builds when BIT()'s use of a shifted 1UL
> causes the problem, combined with call_fext_func casting a ULL value into an int
> for return.

It affects 64 bit not 32 bit.

regards,
dan carpenter




[Index of Archives]     [Linux Kernel Development]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux