From: Igor Russkikh <irusskikh@marvell.com>
To: <netdev@vger.kernel.org>
Cc: "David S . Miller" <davem@davemloft.net>,
Mark Starovoytov <mstarovoitov@marvell.com>,
Jakub Kicinski <kuba@kernel.org>,
Nikita Danilov <ndanilov@marvell.com>,
Igor Russkikh <irusskikh@marvell.com>
Subject: [PATCH v2 net-next 08/10] net: atlantic: use intermediate variable to improve readability a bit
Date: Wed, 15 Jul 2020 18:48:40 +0300 [thread overview]
Message-ID: <20200715154842.305-9-irusskikh@marvell.com> (raw)
In-Reply-To: <20200715154842.305-1-irusskikh@marvell.com>
From: Nikita Danilov <ndanilov@marvell.com>
This patch syncs up hw_atl_a0.c with an out-of-tree driver, where an
intermediate variable was introduced in a couple of functions to
improve the code readability a bit.
Signed-off-by: Nikita Danilov <ndanilov@marvell.com>
Signed-off-by: Mark Starovoytov <mstarovoitov@marvell.com>
Signed-off-by: Igor Russkikh <irusskikh@marvell.com>
---
.../aquantia/atlantic/hw_atl/hw_atl_a0.c | 21 +++++++++----------
1 file changed, 10 insertions(+), 11 deletions(-)
diff --git a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_a0.c b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_a0.c
index 8f8b90436ced..e1877d520135 100644
--- a/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_a0.c
+++ b/drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_a0.c
@@ -752,6 +752,7 @@ static int hw_atl_a0_hw_irq_read(struct aq_hw_s *self, u64 *mask)
static int hw_atl_a0_hw_packet_filter_set(struct aq_hw_s *self,
unsigned int packet_filter)
{
+ struct aq_nic_cfg_s *cfg = self->aq_nic_cfg;
unsigned int i = 0U;
hw_atl_rpfl2promiscuous_mode_en_set(self,
@@ -760,14 +761,13 @@ static int hw_atl_a0_hw_packet_filter_set(struct aq_hw_s *self,
IS_FILTER_ENABLED(IFF_MULTICAST), 0);
hw_atl_rpfl2broadcast_en_set(self, IS_FILTER_ENABLED(IFF_BROADCAST));
- self->aq_nic_cfg->is_mc_list_enabled =
- IS_FILTER_ENABLED(IFF_MULTICAST);
+ cfg->is_mc_list_enabled = IS_FILTER_ENABLED(IFF_MULTICAST);
for (i = HW_ATL_A0_MAC_MIN; i < HW_ATL_A0_MAC_MAX; ++i)
hw_atl_rpfl2_uc_flr_en_set(self,
- (self->aq_nic_cfg->is_mc_list_enabled &&
- (i <= self->aq_nic_cfg->mc_list_count)) ?
- 1U : 0U, i);
+ (cfg->is_mc_list_enabled &&
+ (i <= cfg->mc_list_count)) ? 1U : 0U,
+ i);
return aq_hw_err_from_flags(self);
}
@@ -780,19 +780,18 @@ static int hw_atl_a0_hw_multicast_list_set(struct aq_hw_s *self,
[ETH_ALEN],
u32 count)
{
+ struct aq_nic_cfg_s *cfg = self->aq_nic_cfg;
int err = 0;
if (count > (HW_ATL_A0_MAC_MAX - HW_ATL_A0_MAC_MIN)) {
err = EBADRQC;
goto err_exit;
}
- for (self->aq_nic_cfg->mc_list_count = 0U;
- self->aq_nic_cfg->mc_list_count < count;
- ++self->aq_nic_cfg->mc_list_count) {
- u32 i = self->aq_nic_cfg->mc_list_count;
+ for (cfg->mc_list_count = 0U; cfg->mc_list_count < count; ++cfg->mc_list_count) {
+ u32 i = cfg->mc_list_count;
u32 h = (ar_mac[i][0] << 8) | (ar_mac[i][1]);
u32 l = (ar_mac[i][2] << 24) | (ar_mac[i][3] << 16) |
- (ar_mac[i][4] << 8) | ar_mac[i][5];
+ (ar_mac[i][4] << 8) | ar_mac[i][5];
hw_atl_rpfl2_uc_flr_en_set(self, 0U, HW_ATL_A0_MAC_MIN + i);
@@ -805,7 +804,7 @@ static int hw_atl_a0_hw_multicast_list_set(struct aq_hw_s *self,
HW_ATL_A0_MAC_MIN + i);
hw_atl_rpfl2_uc_flr_en_set(self,
- (self->aq_nic_cfg->is_mc_list_enabled),
+ (cfg->is_mc_list_enabled),
HW_ATL_A0_MAC_MIN + i);
}
--
2.25.1
next prev parent reply other threads:[~2020-07-15 15:49 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-15 15:48 [PATCH v2 net-next 00/10] net: atlantic: various features Igor Russkikh
2020-07-15 15:48 ` [PATCH v2 net-next 01/10] net: atlantic: move FRAC_PER_NS to aq_hw.h Igor Russkikh
2020-07-15 15:48 ` [PATCH v2 net-next 02/10] net: atlantic: additional per-queue stats Igor Russkikh
2020-07-15 23:44 ` Jakub Kicinski
2020-07-16 11:49 ` [EXT] " Mark Starovoytov
2020-07-15 15:48 ` [PATCH v2 net-next 03/10] net: atlantic: use u64_stats_update_* to protect access to 64-bit stats Igor Russkikh
2020-07-15 15:48 ` [PATCH v2 net-next 04/10] net: atlantic: PTP statistics Igor Russkikh
2020-07-15 15:48 ` [PATCH v2 net-next 05/10] net: atlantic: enable ipv6 support for TCP LSO and UDP GSO Igor Russkikh
2020-07-15 15:48 ` [PATCH v2 net-next 06/10] net: atlantic: add support for 64-bit reads/writes Igor Russkikh
2020-07-15 15:48 ` [PATCH v2 net-next 07/10] net: atlantic: use U32_MAX in aq_hw_utils.c Igor Russkikh
2020-07-15 15:48 ` Igor Russkikh [this message]
2020-07-15 15:48 ` [PATCH v2 net-next 09/10] net: atlantic: A0 ntuple filters Igor Russkikh
2020-07-15 15:48 ` [PATCH v2 net-next 10/10] net: atlantic: add hwmon getter for MAC temperature Igor Russkikh
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=20200715154842.305-9-irusskikh@marvell.com \
--to=irusskikh@marvell.com \
--cc=davem@davemloft.net \
--cc=kuba@kernel.org \
--cc=mstarovoitov@marvell.com \
--cc=ndanilov@marvell.com \
--cc=netdev@vger.kernel.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 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).