From: Jakub Kicinski <kuba@kernel.org>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, Jakub Kicinski <kuba@kernel.org>,
Andrew Lunn <andrew@lunn.ch>,
hkallweit1@gmail.com, linux@armlinux.org.uk
Subject: [PATCH net-next v2 3/8] net: phy: constify netdev->dev_addr references
Date: Fri, 22 Oct 2021 16:20:58 -0700 [thread overview]
Message-ID: <20211022232103.2715312-4-kuba@kernel.org> (raw)
In-Reply-To: <20211022232103.2715312-1-kuba@kernel.org>
netdev->dev_addr will become a const soon(ish),
constify the local variables referring to it.
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
CC: hkallweit1@gmail.com
CC: linux@armlinux.org.uk
---
drivers/net/phy/dp83867.c | 4 ++--
drivers/net/phy/dp83869.c | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/net/phy/dp83867.c b/drivers/net/phy/dp83867.c
index 914619f3f0e3..8561f2d4443b 100644
--- a/drivers/net/phy/dp83867.c
+++ b/drivers/net/phy/dp83867.c
@@ -182,7 +182,7 @@ static int dp83867_set_wol(struct phy_device *phydev,
{
struct net_device *ndev = phydev->attached_dev;
u16 val_rxcfg, val_micr;
- u8 *mac;
+ const u8 *mac;
val_rxcfg = phy_read_mmd(phydev, DP83867_DEVADDR, DP83867_RXFCFG);
val_micr = phy_read(phydev, MII_DP83867_MICR);
@@ -193,7 +193,7 @@ static int dp83867_set_wol(struct phy_device *phydev,
val_micr |= MII_DP83867_MICR_WOL_INT_EN;
if (wol->wolopts & WAKE_MAGIC) {
- mac = (u8 *)ndev->dev_addr;
+ mac = (const u8 *)ndev->dev_addr;
if (!is_valid_ether_addr(mac))
return -EINVAL;
diff --git a/drivers/net/phy/dp83869.c b/drivers/net/phy/dp83869.c
index 755220c6451f..7113925606f7 100644
--- a/drivers/net/phy/dp83869.c
+++ b/drivers/net/phy/dp83869.c
@@ -246,7 +246,7 @@ static int dp83869_set_wol(struct phy_device *phydev,
{
struct net_device *ndev = phydev->attached_dev;
int val_rxcfg, val_micr;
- u8 *mac;
+ const u8 *mac;
int ret;
val_rxcfg = phy_read_mmd(phydev, DP83869_DEVADDR, DP83869_RXFCFG);
@@ -264,7 +264,7 @@ static int dp83869_set_wol(struct phy_device *phydev,
if (wol->wolopts & WAKE_MAGIC ||
wol->wolopts & WAKE_MAGICSECURE) {
- mac = (u8 *)ndev->dev_addr;
+ mac = (const u8 *)ndev->dev_addr;
if (!is_valid_ether_addr(mac))
return -EINVAL;
--
2.31.1
next prev parent reply other threads:[~2021-10-22 23:21 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-22 23:20 [PATCH net-next v2 0/8] don't write directly to netdev->dev_addr Jakub Kicinski
2021-10-22 23:20 ` [PATCH net-next v2 1/8] net: core: constify mac addrs in selftests Jakub Kicinski
2021-10-22 23:20 ` [PATCH net-next v2 2/8] net: rtnetlink: use __dev_addr_set() Jakub Kicinski
2021-10-22 23:20 ` Jakub Kicinski [this message]
2021-10-22 23:20 ` [PATCH net-next v2 4/8] net: bonding: constify and use dev_addr_set() Jakub Kicinski
2021-10-22 23:21 ` [PATCH net-next v2 5/8] net: hsr: get ready for const netdev->dev_addr Jakub Kicinski
2021-10-22 23:21 ` [PATCH net-next v2 6/8] net: caif: " Jakub Kicinski
2021-10-22 23:21 ` [PATCH net-next v2 7/8] net: drivers: " Jakub Kicinski
2021-10-22 23:21 ` [PATCH net-next v2 8/8] net: atm: use address setting helpers Jakub Kicinski
2021-10-25 12:10 ` [PATCH net-next v2 0/8] don't write directly to netdev->dev_addr patchwork-bot+netdevbpf
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=20211022232103.2715312-4-kuba@kernel.org \
--to=kuba@kernel.org \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=hkallweit1@gmail.com \
--cc=linux@armlinux.org.uk \
--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).