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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Sun, 27 Sep 2020 05:12:23 +0000
From:   "Zhao, Haifeng" <haifeng.zhao@...el.com>
To:     Joe Perches <joe@...ches.com>,
        "bhelgaas@...gle.com" <bhelgaas@...gle.com>,
        "oohall@...il.com" <oohall@...il.com>,
        "ruscur@...sell.cc" <ruscur@...sell.cc>,
        "lukas@...ner.de" <lukas@...ner.de>,
        "andriy.shevchenko@...ux.intel.com" 
        <andriy.shevchenko@...ux.intel.com>,
        "stuart.w.hayes@...il.com" <stuart.w.hayes@...il.com>,
        "mr.nuke.me@...il.com" <mr.nuke.me@...il.com>,
        "mika.westerberg@...ux.intel.com" <mika.westerberg@...ux.intel.com>
CC:     "linux-pci@...r.kernel.org" <linux-pci@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "Jia, Pei P" <pei.p.jia@...el.com>,
        "ashok.raj@...ux.intel.com" <ashok.raj@...ux.intel.com>,
        "Kuppuswamy, Sathyanarayanan" <sathyanarayanan.kuppuswamy@...el.com>
Subject: RE: [PATCH 4/5 V2] PCI: only return true when dev io state is really
 changed

😊  definitely simpler !

-----Original Message-----
From: Joe Perches <joe@...ches.com> 
Sent: Sunday, September 27, 2020 12:17 PM
To: Zhao, Haifeng <haifeng.zhao@...el.com>; bhelgaas@...gle.com; oohall@...il.com; ruscur@...sell.cc; lukas@...ner.de; andriy.shevchenko@...ux.intel.com; stuart.w.hayes@...il.com; mr.nuke.me@...il.com; mika.westerberg@...ux.intel.com
Cc: linux-pci@...r.kernel.org; linux-kernel@...r.kernel.org; Jia, Pei P <pei.p.jia@...el.com>; ashok.raj@...ux.intel.com; Kuppuswamy, Sathyanarayanan <sathyanarayanan.kuppuswamy@...el.com>
Subject: Re: [PATCH 4/5 V2] PCI: only return true when dev io state is really changed

On Sat, 2020-09-26 at 23:28 -0400, Ethan Zhao wrote:
> simplify the pci_dev_set_io_state() function to only return true when 
> dev->error_state is changed.
[]
> diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h
[]
> @@ -362,35 +362,11 @@ static inline bool pci_dev_set_io_state(struct pci_dev *dev,
>  	bool changed = false;
[]
> +	if (dev->error_state == new)
> +		return changed;
> +
> +	dev->error_state = new;
> +	changed = true;
>  	return changed;
>  }

This would be simpler removing the unnecessary changed automatic

...

	if (dev->error_state == new)
		return false;

	dev->error_state = new;

	return true;
}


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ