All of lore.kernel.org
 help / color / mirror / Atom feed
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 14:40:54 +0300	[thread overview]
Message-ID: <1465818054.30123.10.camel@linux.intel.com> (raw)
In-Reply-To: <20160611001956.GH16462@localhost>

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.com>
> 
> 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?

> 
> > ---
> >  include/linux/pci.h | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/include/linux/pci.h b/include/linux/pci.h
> > index b67e4df..8d74834 100644
> > --- a/include/linux/pci.h
> > +++ b/include/linux/pci.h
> > @@ -116,7 +116,7 @@ extern const char *pci_power_names[];
> >  
> >  static inline const char *pci_power_name(pci_power_t state)
> >  {
> > -	return pci_power_names[1 + (int) state];
> > +	return pci_power_names[1 + (__force int) state];
> >  }
> >  
> >  #define PCI_PM_D2_DELAY		200
> > -- 
> > 2.8.1
> > 
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-pci" 
> > in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 

Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy

  reply	other threads:[~2016-06-13 11:40 UTC|newest]

Thread overview: 7+ 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 [this message]
2016-06-13 13:13     ` Bjorn Helgaas
2016-06-13 13:19       ` Andy Shevchenko
2016-06-13 13:19         ` Andy Shevchenko

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=1465818054.30123.10.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.