The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Darren Hart <dvhart@infradead.org>
To: Jonathan Woithe <jwoithe@just42.net>
Cc: Micha?? K??pie?? <kernel@kempniu.pl>,
	Andy Shevchenko <andy@infradead.org>,
	Dan Carpenter <dan.carpenter@oracle.com>,
	platform-driver-x86@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] platform/x86: fujitsu-laptop: Revert UNSUPPORTED_CMD back to an int
Date: Wed, 21 Mar 2018 16:30:34 -0700	[thread overview]
Message-ID: <20180321233034.GB24138@fury> (raw)
In-Reply-To: <20180311041056.GA5432@gateway.atrad.com.au>

On Sun, Mar 11, 2018 at 02:40:56PM +1030, Jonathan Woithe wrote:
> On Sat, Mar 10, 2018 at 09:43:53PM +0100, Micha?? K??pie?? wrote:
> > UNSUPPORTED_CMD was previously 0x80000000 (int), but commit 819cddae7cfa
> > ("platform/x86: fujitsu-laptop: Clean up constants") changed it into an
> > unsigned long due to BIT() being used to define it.  As call_fext_func()
> > returns an int, 0x80000000 would get type promoted when compared to an
> > unsigned long, which on a 64-bit system would cause it to become
> > 0xffffffff80000000 due to sign extension.  This causes one logical
> > condition in fujitsu-laptop to always be true and another one to always
> > be false on 64-bit systems.  Fix this by reverting UNSUPPORTED_CMD back
> > to an int.
> > 
> > This patch fixes the following smatch warnings:
> > 
> > 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)'
> > 
> > Fixes: 819cddae7cfa ("platform/x86: fujitsu-laptop: Clean up constants")
> > Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> > Signed-off-by: Micha?? K??pie?? <kernel@kempniu.pl>

Queued up, thank you.
-- 
Darren Hart
VMware Open Source Technology Center

      reply	other threads:[~2018-03-21 23:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-10 20:43 [PATCH] platform/x86: fujitsu-laptop: Revert UNSUPPORTED_CMD back to an int Michał Kępień
2018-03-11  4:10 ` Jonathan Woithe
2018-03-21 23:30   ` Darren Hart [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180321233034.GB24138@fury \
    --to=dvhart@infradead.org \
    --cc=andy@infradead.org \
    --cc=dan.carpenter@oracle.com \
    --cc=jwoithe@just42.net \
    --cc=kernel@kempniu.pl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=platform-driver-x86@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox