lkml.org 
[lkml]   [2014]   [May]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] perf/x86/uncore: Remove unnecessary assignment to "box" in uncore_pci_remove(...)
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


\
 
 \ /
  Last update: 2014-05-28 23:01    [W:0.046 / U:0.068 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site