lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.10.1405282239190.3952@nanos>
Date:	Wed, 28 May 2014 22:42:51 +0200 (CEST)
From:	Thomas Gleixner <tglx@...utronix.de>
To:	walter harms <wharms@....de>
cc:	Giedrius Rekasius <giedrius.rekasius@...il.com>,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	Paul Mackerras <paulus@...ba.org>,
	Ingo Molnar <mingo@...hat.com>,
	Arnaldo Carvalho de Melo <acme@...nel.org>,
	"H. Peter Anvin" <hpa@...or.com>, x86@...nel.org,
	linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: Re: [PATCH] perf/x86/uncore: Remove unnecessary assignment to "box"
 in uncore_pci_remove(...)

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@...il.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ