From: Julia Lawall <julia.lawall@lip6.fr>
To: Lee Jones <lee.jones@linaro.org>
Cc: Julia Lawall <Julia.Lawall@lip6.fr>,
Samuel Ortiz <sameo@linux.intel.com>,
kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/3] mfd: sta2x11-mfd: use named constants for pci_power_t values
Date: Mon, 6 Jan 2014 12:17:26 +0100 (CET) [thread overview]
Message-ID: <alpine.DEB.2.10.1401061215560.2079@hadrien> (raw)
In-Reply-To: <20140106110145.GM23772@lee--X1>
[-- Attachment #1: Type: TEXT/PLAIN, Size: 1689 bytes --]
On Mon, 6 Jan 2014, Lee Jones wrote:
> On Fri, 03 Jan 2014, Julia Lawall wrote:
>
> > From: Julia Lawall <Julia.Lawall@lip6.fr>
> >
> > The semantic patch that makes this change is as follows:
> > (http://coccinelle.lip6.fr/)
> >
> > // <smpl>
> > @@
> > expression pdev;
> > @@
> >
> > pci_set_power_state(pdev,
> > - 0
> > + PCI_D0
> > )
> > // </smpl>
>
> I'm happy with the code and that you used Coccinelle to discover the
> issue, but I feel a little more explanation would be helpful to
> readers.
>
> Why is (pci_power_t __force) 0 better than 0?
I wasn't particularly attached to the cast, and I don't know if it is an
issue. But in trying to understand the code, I found PCI_D0 more
understandable than 0.
julia
> > Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
> >
> > ---
> > drivers/mfd/sta2x11-mfd.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/mfd/sta2x11-mfd.c b/drivers/mfd/sta2x11-mfd.c
> > index 0d42e40..5b72db0 100644
> > --- a/drivers/mfd/sta2x11-mfd.c
> > +++ b/drivers/mfd/sta2x11-mfd.c
> > @@ -529,7 +529,7 @@ static int sta2x11_mfd_resume(struct pci_dev *pdev)
> > {
> > int err;
> >
> > - pci_set_power_state(pdev, 0);
> > + pci_set_power_state(pdev, PCI_D0);
> > err = pci_enable_device(pdev);
> > if (err)
> > return err;
> >
>
> --
> Lee Jones
> Linaro STMicroelectronics Landing Team Lead
> Linaro.org │ Open source software for ARM SoCs
> Follow Linaro: Facebook | Twitter | Blog
> --
> To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
next prev parent reply other threads:[~2014-01-06 11:17 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-02 23:40 [PATCH 0/3] use named constants for pci_power_t values Julia Lawall
2014-01-02 23:40 ` [PATCH 1/3] mfd: sta2x11-mfd: " Julia Lawall
2014-01-06 11:01 ` Lee Jones
2014-01-06 11:17 ` Julia Lawall [this message]
2014-01-06 11:49 ` Lee Jones
2014-01-02 23:40 ` [PATCH 2/3] ALSA: cs5535audio: " Julia Lawall
2014-01-05 10:44 ` Takashi Iwai
2014-01-02 23:40 ` [PATCH 3/3] smsc9420: " Julia Lawall
2014-01-04 0:59 ` David Miller
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=alpine.DEB.2.10.1401061215560.2079@hadrien \
--to=julia.lawall@lip6.fr \
--cc=kernel-janitors@vger.kernel.org \
--cc=lee.jones@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sameo@linux.intel.com \
/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