netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sean Anderson <seanga2@gmail.com>
To: "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
Cc: linux-kernel@vger.kernel.org,
	Simon Horman <simon.horman@corigine.com>,
	Sean Anderson <seanga2@gmail.com>
Subject: [PATCH net-next v2 7/9] net: sunhme: Clean up mac address init
Date: Sat, 11 Mar 2023 13:19:03 -0500	[thread overview]
Message-ID: <20230311181905.3593904-8-seanga2@gmail.com> (raw)
In-Reply-To: <20230311181905.3593904-1-seanga2@gmail.com>

Clean up some oddities suggested during review.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
---

Changes in v2:
- New

 drivers/net/ethernet/sun/sunhme.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/sun/sunhme.c b/drivers/net/ethernet/sun/sunhme.c
index c4280bce69d4..41b2f941c607 100644
--- a/drivers/net/ethernet/sun/sunhme.c
+++ b/drivers/net/ethernet/sun/sunhme.c
@@ -2348,9 +2348,7 @@ static int find_eth_addr_in_vpd(void __iomem *rom_base, int len, int index, unsi
 		p += 6;
 
 		if (index == 0) {
-			int i;
-
-			for (i = 0; i < 6; i++)
+			for (int i = 0; i < 6; i++)
 				dev_addr[i] = readb(p + i);
 			return 1;
 		}
@@ -2362,9 +2360,10 @@ static int find_eth_addr_in_vpd(void __iomem *rom_base, int len, int index, unsi
 static void __maybe_unused get_hme_mac_nonsparc(struct pci_dev *pdev,
 						unsigned char *dev_addr)
 {
+	void __iomem *p;
 	size_t size;
-	void __iomem *p = pci_map_rom(pdev, &size);
 
+	p = pci_map_rom(pdev, &size);
 	if (p) {
 		int index = 0;
 		int found;
@@ -2386,7 +2385,7 @@ static void __maybe_unused get_hme_mac_nonsparc(struct pci_dev *pdev,
 	dev_addr[2] = 0x20;
 	get_random_bytes(&dev_addr[3], 3);
 }
-#endif /* !(CONFIG_SPARC) */
+#endif
 
 static void happy_meal_addr_init(struct happy_meal *hp,
 				 struct device_node *dp, int qfe_slot)
-- 
2.37.1


  parent reply	other threads:[~2023-03-11 18:19 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-11 18:18 [PATCH net-next v2 0/9] net: sunhme: Probe/IRQ cleanups Sean Anderson
2023-03-11 18:18 ` [PATCH net-next v2 1/9] net: sunhme: Just restart autonegotiation if we can't bring the link up Sean Anderson
2023-03-11 18:18 ` [PATCH net-next v2 2/9] net: sunhme: Remove residual polling code Sean Anderson
2023-03-11 18:18 ` [PATCH net-next v2 3/9] net: sunhme: Unify IRQ requesting Sean Anderson
2023-03-11 18:19 ` [PATCH net-next v2 4/9] net: sunhme: Alphabetize includes Sean Anderson
2023-03-11 18:19 ` [PATCH net-next v2 5/9] net: sunhme: Switch SBUS to devres Sean Anderson
2023-03-11 18:19 ` [PATCH net-next v2 6/9] net: sunhme: Consolidate mac address initialization Sean Anderson
2023-03-11 18:19 ` Sean Anderson [this message]
2023-03-11 18:19 ` [PATCH net-next v2 8/9] net: sunhme: Inline error returns Sean Anderson
2023-03-11 18:19 ` [PATCH net-next v2 9/9] net: sunhme: Consolidate common probe tasks Sean Anderson
2023-03-14  0:27 ` [PATCH net-next v2 0/9] net: sunhme: Probe/IRQ cleanups Jakub Kicinski
2023-03-14  0:36   ` Sean Anderson

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=20230311181905.3593904-8-seanga2@gmail.com \
    --to=seanga2@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=simon.horman@corigine.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).