All of lore.kernel.org
 help / color / mirror / Atom feed
From: Roger Pau Monne <roger.pau@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Roger Pau Monne <roger.pau@citrix.com>
Subject: [PATCH for-4.17 4/6] vpci: introduce a local vpci_bar variable to modify_decoding()
Date: Thu, 20 Oct 2022 11:46:47 +0200	[thread overview]
Message-ID: <20221020094649.28667-5-roger.pau@citrix.com> (raw)
In-Reply-To: <20221020094649.28667-1-roger.pau@citrix.com>

This is done to shorten line length in the function in preparation for
adding further usages of the vpci_bar data structure.

No functional change.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/drivers/vpci/header.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/xen/drivers/vpci/header.c b/xen/drivers/vpci/header.c
index a1c928a0d2..eb9219a49a 100644
--- a/xen/drivers/vpci/header.c
+++ b/xen/drivers/vpci/header.c
@@ -103,24 +103,26 @@ static void modify_decoding(const struct pci_dev *pdev, uint16_t cmd,
 
     for ( i = 0; i < ARRAY_SIZE(header->bars); i++ )
     {
-        if ( !MAPPABLE_BAR(&header->bars[i]) )
+        struct vpci_bar *bar = &header->bars[i];
+
+        if ( !MAPPABLE_BAR(bar) )
             continue;
 
-        if ( rom_only && header->bars[i].type == VPCI_BAR_ROM )
+        if ( rom_only && bar->type == VPCI_BAR_ROM )
         {
             unsigned int rom_pos = (i == PCI_HEADER_NORMAL_NR_BARS)
                                    ? PCI_ROM_ADDRESS : PCI_ROM_ADDRESS1;
-            uint32_t val = header->bars[i].addr |
+            uint32_t val = bar->addr |
                            (map ? PCI_ROM_ADDRESS_ENABLE : 0);
 
-            header->bars[i].enabled = header->rom_enabled = map;
+            bar->enabled = header->rom_enabled = map;
             pci_conf_write32(pdev->sbdf, rom_pos, val);
             return;
         }
 
         if ( !rom_only &&
-             (header->bars[i].type != VPCI_BAR_ROM || header->rom_enabled) )
-            header->bars[i].enabled = map;
+             (bar->type != VPCI_BAR_ROM || header->rom_enabled) )
+            bar->enabled = map;
     }
 
     if ( !rom_only )
-- 
2.37.3



  parent reply	other threads:[~2022-10-20  9:47 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-20  9:46 [PATCH for-4.17 0/6] (v)pci: fixes related to memory decoding handling Roger Pau Monne
2022-10-20  9:46 ` [PATCH for-4.17 1/6] test/vpci: add dummy cfcheck define Roger Pau Monne
2022-10-20  9:57   ` Andrew Cooper
2022-10-20 13:20   ` Anthony PERARD
2022-10-20  9:46 ` [PATCH for-4.17 2/6] test/vpci: fix vPCI test harness to provide pci_get_pdev() Roger Pau Monne
2022-10-20 13:21   ` Anthony PERARD
2022-10-20  9:46 ` [PATCH for-4.17 3/6] vpci: don't assume that vpci per-device data exists unconditionally Roger Pau Monne
2022-10-24 11:04   ` Jan Beulich
2022-10-24 16:01     ` Roger Pau Monné
2022-10-24 16:06       ` Jan Beulich
2022-10-20  9:46 ` Roger Pau Monne [this message]
2022-10-24 11:05   ` [PATCH for-4.17 4/6] vpci: introduce a local vpci_bar variable to modify_decoding() Jan Beulich
2022-10-20  9:46 ` [PATCH for-4.17 5/6] pci: do not disable memory decoding for devices Roger Pau Monne
2022-10-24 11:19   ` Jan Beulich
2022-10-24 12:45     ` Roger Pau Monné
2022-10-24 13:59       ` Jan Beulich
2022-10-24 15:45         ` Roger Pau Monné
2022-10-24 15:56           ` Jan Beulich
2022-10-24 16:24             ` Roger Pau Monné
2022-10-20  9:46 ` [PATCH for-4.17 6/6] vpci: refuse BAR writes only if the BAR is mapped Roger Pau Monne
2022-10-24 11:51   ` Jan Beulich
2022-10-24 15:04     ` Roger Pau Monné
2022-10-24 16:03       ` Jan Beulich
2022-10-20 10:12 ` [PATCH for-4.17 0/6] (v)pci: fixes related to memory decoding handling Henry Wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221020094649.28667-5-roger.pau@citrix.com \
    --to=roger.pau@citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.