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]
Message-ID: <163906602397.11128.4835509365516033620.tip-bot2@tip-bot2>
Date:   Thu, 09 Dec 2021 16:07:03 -0000
From:   "tip-bot2 for Thomas Gleixner" <tip-bot2@...utronix.de>
To:     linux-tip-commits@...r.kernel.org
Cc:     Thomas Gleixner <tglx@...utronix.de>,
        Juergen Gross <jgross@...e.com>,
        Jason Gunthorpe <jgg@...dia.com>,
        "Greg Kroah-Hartman" <gregkh@...uxfoundation.org>,
        Bjorn Helgaas <bhelgaas@...gle.com>, x86@...nel.org,
        linux-kernel@...r.kernel.org
Subject: [tip: irq/msi] PCI/MSI: Make msix_update_entries() smarter

The following commit has been merged into the irq/msi branch of tip:

Commit-ID:     7112158d97a1539b217c360d379724ac3ee99fa3
Gitweb:        https://git.kernel.org/tip/7112158d97a1539b217c360d379724ac3ee99fa3
Author:        Thomas Gleixner <tglx@...utronix.de>
AuthorDate:    Mon, 06 Dec 2021 23:27:46 +01:00
Committer:     Thomas Gleixner <tglx@...utronix.de>
CommitterDate: Thu, 09 Dec 2021 11:52:21 +01:00

PCI/MSI: Make msix_update_entries() smarter

No need to walk the descriptors and check for each one whether the entries
pointer function argument is NULL. Do it once.

Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
Tested-by: Juergen Gross <jgross@...e.com>
Reviewed-by: Jason Gunthorpe <jgg@...dia.com>
Reviewed-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Acked-by: Bjorn Helgaas <bhelgaas@...gle.com>
Link: https://lore.kernel.org/r/20211206210224.600351129@linutronix.de

---
 drivers/pci/msi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
index a76fcf4..1573091 100644
--- a/drivers/pci/msi.c
+++ b/drivers/pci/msi.c
@@ -642,8 +642,8 @@ static void msix_update_entries(struct pci_dev *dev, struct msix_entry *entries)
 {
 	struct msi_desc *entry;
 
-	for_each_pci_msi_entry(entry, dev) {
-		if (entries) {
+	if (entries) {
+		for_each_pci_msi_entry(entry, dev) {
 			entries->vector = entry->irq;
 			entries++;
 		}

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ