From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: linux-pci@vger.kernel.org,
Potnuri Bharat Teja <bharat@chelsio.com>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
Subject: [PATCH 3/3] cxgb3: Split complex PCI write statement into logic + write
Date: Tue, 10 Jun 2025 13:32:05 +0300 [thread overview]
Message-ID: <20250610103205.6750-3-ilpo.jarvinen@linux.intel.com> (raw)
In-Reply-To: <20250610103205.6750-1-ilpo.jarvinen@linux.intel.com>
Instead of trying to complex logic within the PCI capability write
statement, split the logic onto separate lines for better readability.
Also, don't pretend just clearing the fields, but set the fields to
what 0 means (128 bytes).
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
---
drivers/net/ethernet/chelsio/cxgb3/t3_hw.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/chelsio/cxgb3/t3_hw.c b/drivers/net/ethernet/chelsio/cxgb3/t3_hw.c
index 171bf6cf1abf..b9327d8c6893 100644
--- a/drivers/net/ethernet/chelsio/cxgb3/t3_hw.c
+++ b/drivers/net/ethernet/chelsio/cxgb3/t3_hw.c
@@ -3267,9 +3267,9 @@ static void config_pcie(struct adapter *adap)
pci_read_config_word(adap->pdev, PCI_DEVICE_ID, &devid);
if (devid == 0x37) {
- pcie_capability_write_word(adap->pdev, PCI_EXP_DEVCTL,
- val & ~PCI_EXP_DEVCTL_READRQ &
- ~PCI_EXP_DEVCTL_PAYLOAD);
+ val &= ~(PCI_EXP_DEVCTL_PAYLOAD|PCI_EXP_DEVCTL_READRQ);
+ val |= PCI_EXP_DEVCTL_PAYLOAD_128B|PCI_EXP_DEVCTL_READRQ_128B;
+ pcie_capability_write_word(adap->pdev, PCI_EXP_DEVCTL, val);
pldsize = 0;
}
--
2.39.5
next prev parent reply other threads:[~2025-06-10 10:32 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-10 10:32 [PATCH 1/3] cxgb3: Replace PCI related literals with defines & correct variable Ilpo Järvinen
2025-06-10 10:32 ` [PATCH 2/3] cxgb3: Use FIELD_GET() for PCI register fields Ilpo Järvinen
2025-06-10 10:32 ` Ilpo Järvinen [this message]
2025-06-10 20:53 ` [PATCH 1/3] cxgb3: Replace PCI related literals with defines & correct variable Jakub Kicinski
2025-06-11 7:22 ` Ilpo Järvinen
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=20250610103205.6750-3-ilpo.jarvinen@linux.intel.com \
--to=ilpo.jarvinen@linux.intel.com \
--cc=andrew+netdev@lunn.ch \
--cc=bharat@chelsio.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).