From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Bjorn Helgaas <helgaas@kernel.org>
Cc: linux-pci@vger.kernel.org, Bjorn Helgaas <bhelgaas@google.com>,
"Rafael J . Wysocki" <rjw@rjwysocki.net>,
linux-pm@vger.kernel.org
Subject: Re: [PATCH v1 1/1] PCI / PM: enforce type casting for pci_power_t
Date: Mon, 13 Jun 2016 16:19:33 +0300 [thread overview]
Message-ID: <1465823973.30123.15.camel@linux.intel.com> (raw)
In-Reply-To: <20160613131346.GA11051@localhost>
On Mon, 2016-06-13 at 08:13 -0500, Bjorn Helgaas wrote:
> On Mon, Jun 13, 2016 at 02:40:54PM +0300, Andy Shevchenko wrote:
> > On Fri, 2016-06-10 at 19:19 -0500, Bjorn Helgaas wrote:
> > > On Tue, Jun 07, 2016 at 08:48:33PM +0300, Andy Shevchenko wrote:
> > > > When cast pci_power_t type of variables a static analizer tool
> > > > complains on
> > > > that.
> > > >
> > > > include/linux/pci.h:119:37: warning: cast from
> > > > restricted
> > > > pci_power_t
> > > >
> > > > Enforce type casting to make static analizer happy.
> > > >
> > > > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.co
> > > > m>
> > >
> > > Applied to pci/pm for v4.8, thanks, Andy.
> >
> > Thanks.
> >
> > By the way, what was the main point to use __bitwise annotation to
> > this
> > type in the first place?
>
> I don't know. It looks like pci_power_t was the first use of
> __bitwise in
> pci.h, added by e8191db240d2 ("[PATCH] PCI: Cleanup PCI power
> states").
> That changelog mentions type-safety, but I must admit that doesn't
> make it
> obvious to me.
I'm asking since any code which is using this type (all direct
assignments or comparisons) brings a static analyzer complain.
You may check by yourself with (my usual command to build kernel)
% make C=1 CF=-D__CHECK_ENDIAN__ W=1 -j64
--
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy
prev parent reply other threads:[~2016-06-13 13:19 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-07 17:48 [PATCH v1 1/1] PCI / PM: enforce type casting for pci_power_t Andy Shevchenko
2016-06-08 0:16 ` Rafael J. Wysocki
2016-06-11 0:19 ` Bjorn Helgaas
2016-06-13 11:40 ` Andy Shevchenko
2016-06-13 13:13 ` Bjorn Helgaas
2016-06-13 13:19 ` Andy Shevchenko [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=1465823973.30123.15.camel@linux.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=bhelgaas@google.com \
--cc=helgaas@kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=rjw@rjwysocki.net \
/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;
as well as URLs for NNTP newsgroup(s).