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 <[email protected]>
Tested-by: Juergen Gross <[email protected]>
Reviewed-by: Jason Gunthorpe <[email protected]>
---
drivers/pci/msi.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/drivers/pci/msi.c
+++ b/drivers/pci/msi.c
@@ -642,8 +642,8 @@ static void msix_update_entries(struct p
{
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++;
}
On Mon, Dec 06, 2021 at 11:27:46PM +0100, Thomas Gleixner wrote:
> 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 <[email protected]>
> Tested-by: Juergen Gross <[email protected]>
> Reviewed-by: Jason Gunthorpe <[email protected]>
Reviewed-by: Greg Kroah-Hartman <[email protected]>
On Mon, Dec 06, 2021 at 11:27:46PM +0100, Thomas Gleixner wrote:
> 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 <[email protected]>
> Tested-by: Juergen Gross <[email protected]>
> Reviewed-by: Jason Gunthorpe <[email protected]>
Acked-by: Bjorn Helgaas <[email protected]>
> ---
> drivers/pci/msi.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> --- a/drivers/pci/msi.c
> +++ b/drivers/pci/msi.c
> @@ -642,8 +642,8 @@ static void msix_update_entries(struct p
> {
> 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++;
> }
>
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 <[email protected]>
AuthorDate: Mon, 06 Dec 2021 23:27:46 +01:00
Committer: Thomas Gleixner <[email protected]>
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 <[email protected]>
Tested-by: Juergen Gross <[email protected]>
Reviewed-by: Jason Gunthorpe <[email protected]>
Reviewed-by: Greg Kroah-Hartman <[email protected]>
Acked-by: Bjorn Helgaas <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
---
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++;
}