From: Thomas Gleixner <tglx@linutronix.de>
To: walter harms <wharms@bfs.de>
Cc: Giedrius Rekasius <giedrius.rekasius@gmail.com>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
Paul Mackerras <paulus@samba.org>, Ingo Molnar <mingo@redhat.com>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
"H. Peter Anvin" <hpa@zytor.com>,
x86@kernel.org, linux-kernel@vger.kernel.org,
kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] perf/x86/uncore: Remove unnecessary assignment to "box" in uncore_pci_remove(...)
Date: Wed, 28 May 2014 20:42:51 +0000 [thread overview]
Message-ID: <alpine.DEB.2.10.1405282239190.3952@nanos> (raw)
In-Reply-To: <5385B764.6090301@bfs.de>
On Wed, 28 May 2014, walter harms wrote:
> Am 28.05.2014 11:11, schrieb Giedrius Rekasius:
> > Local variable "box" gets assigned correct value when it is initialized.
> > There is no need to assign the same value again.
> >
> > Signed-off-by: Giedrius Rekasius <giedrius.rekasius@gmail.com>
> > ---
> > arch/x86/kernel/cpu/perf_event_intel_uncore.c | 1 -
> > 1 file changed, 1 deletion(-)
> >
> > diff --git a/arch/x86/kernel/cpu/perf_event_intel_uncore.c b/arch/x86/kernel/cpu/perf_event_intel_uncore.c
> > index 65bbbea..8cbbb1b 100644
> > --- a/arch/x86/kernel/cpu/perf_event_intel_uncore.c
> > +++ b/arch/x86/kernel/cpu/perf_event_intel_uncore.c
> > @@ -3817,7 +3817,6 @@ static void uncore_pci_remove(struct pci_dev *pdev)
> > struct intel_uncore_pmu *pmu;
> > int i, cpu, phys_id = pcibus_to_physid[pdev->bus->number];
> >
> > - box = pci_get_drvdata(pdev);
> > if (!box) {
> > for (i = 0; i < UNCORE_EXTRA_PCI_DEV_MAX; i++) {
> > if (extra_pci_dev[phys_id][i] = pdev) {
>
> Just a remark,
> for readability it is better to remove the other one.
I rather have stuff reshuffled a bit more:
static void uncore_pci_remove(struct pci_dev *pdev)
{
int i, cpu, phys_id = pcibus_to_physid[pdev->bus->number];
struct intel_uncore_box *box = pci_get_drvdata(pdev);
struct intel_uncore_pmu *pmu;
if (!box) {
That's less lines and entirely readable.
Thanks,
tglx
next prev parent reply other threads:[~2014-05-28 20:42 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-28 9:11 [PATCH] perf/x86/uncore: Remove unnecessary assignment to "box" in uncore_pci_remove(...) Giedrius Rekasius
2014-05-28 10:16 ` walter harms
2014-05-28 20:10 ` Giedrius Rekasius
2014-05-28 20:42 ` Thomas Gleixner [this message]
2014-05-29 20:51 ` Giedrius Rekasius
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.1405282239190.3952@nanos \
--to=tglx@linutronix.de \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@kernel.org \
--cc=giedrius.rekasius@gmail.com \
--cc=hpa@zytor.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=paulus@samba.org \
--cc=wharms@bfs.de \
--cc=x86@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