From: Giedrius Rekasius <giedrius.rekasius@gmail.com>
To: walter harms <wharms@bfs.de>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>,
Paul Mackerras <paulus@samba.org>, Ingo Molnar <mingo@redhat.com>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
Thomas Gleixner <tglx@linutronix.de>,
"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 21:10:21 +0100 [thread overview]
Message-ID: <20140528200609.GA1901@vaio> (raw)
In-Reply-To: <5385B764.6090301@bfs.de>
On Wed, May 28, 2014 at 12:16:04PM +0200, 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 could move the declaration itself closer to the if statement while
still keeping whole statement in one line.
On the other hand I'm not so sure if it makes any real difference to
have assignment right next to the if statement compared to a few lines
above it.
Regards,
Giedrius
next prev parent reply other threads:[~2014-05-28 20:10 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 [this message]
2014-05-28 20:42 ` Thomas Gleixner
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=20140528200609.GA1901@vaio \
--to=giedrius.rekasius@gmail.com \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@kernel.org \
--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=tglx@linutronix.de \
--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;
as well as URLs for NNTP newsgroup(s).