From patchwork Wed Jan 26 00:37:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Kicinski X-Patchwork-Id: 12724408 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0F2AEC5DF62 for ; Wed, 26 Jan 2022 00:40:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Y7KeRz2tTks7gOUxx3lbFYodLgNghu9GqOCg0evapoQ=; b=NYE/80lzfKHpLb vuxTUYdUoRjaibOb/Z/hGwF7ShItYcDmLHD1CLB95CBScAUmsdF4RU/AMmFv7c2OtkTCWCwAMqy+P LTL2Hsi8fTk0wOKoD8SKBXPJjIgX03dSu5MY+JwJ4aMFxyofSieNtSqiMRMmtE+Zls5NgAEXiCSF7 Rv2pzkCGSebmimU2o3nA6vSC47IJdMRNBmxVqU0920ePUJyKyhR9G/DIGKIHYWmqorSuyvFpG0rFU nG798HcOTeS38fct7z1gruS/B/MQqsLx1RXQ8z1fQ1WuHlyVSErksjOxvBnETeyzYqBHDQ8wYaTNZ tlTLlVARqXZPZudhUH5Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nCWKx-009k8I-Sd; Wed, 26 Jan 2022 00:39:00 +0000 Received: from ams.source.kernel.org ([145.40.68.75]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nCWK8-009ju1-6l for linux-arm-kernel@lists.infradead.org; Wed, 26 Jan 2022 00:38:10 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id D9170B81B98; Wed, 26 Jan 2022 00:38:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 585A8C340EB; Wed, 26 Jan 2022 00:38:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1643157485; bh=X4yd7Dxmu5PFhFcieA8ox30wK4paNfYa0lKukRAMuz8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oF00jcGG9O2JgCAACElzEdRtFg5cf9j5vTLHU8Ah/RaHgr6oPzA7JzxxZk/lR1hpj 8NQAhKIYgsC5o3t5soLWm+9YJkcK/ii4U6mHdkPHmAqQlf/wT+G7DXJun0GsPN4ozq ZTDl4ePzH5CCx9Isv7uFvmXrsyXVMB5/MhAzu+9dAXnbs2aFi/z7LkQ2nez3zuoa6W Lwyc/mou2FFqoMsk1wemPRVLlHbVgd0YN9lbqsLEfhEnZpDhKmvbEMPTjPmnjBH0xc 9z0TK53dUrFC+1CRU/nL+Dq8oki66vwzZJENv593auxBLa/HRsDkQCqscZ475GQ89x CpqeuXUVwFRUw== From: Jakub Kicinski To: davem@davemloft.net Cc: netdev@vger.kernel.org, dave@thedillows.org, linux@armlinux.org.uk, linux-arm-kernel@lists.infradead.org, Jakub Kicinski Subject: [PATCH net v2 1/6] ethernet: 3com/typhoon: don't write directly to netdev->dev_addr Date: Tue, 25 Jan 2022 16:37:56 -0800 Message-Id: <20220126003801.1736586-2-kuba@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220126003801.1736586-1-kuba@kernel.org> References: <20220126003801.1736586-1-kuba@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220125_163808_409178_BBB94094 X-CRM114-Status: GOOD ( 10.76 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This driver casts off the const and writes directly to netdev->dev_addr. This will result in a MAC address tree corruption and a warning. Compile tested ppc6xx_defconfig. Fixes: adeef3e32146 ("net: constify netdev->dev_addr") Signed-off-by: Jakub Kicinski --- drivers/net/ethernet/3com/typhoon.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/3com/typhoon.c b/drivers/net/ethernet/3com/typhoon.c index 481f1df3106c..8aec5d9fbfef 100644 --- a/drivers/net/ethernet/3com/typhoon.c +++ b/drivers/net/ethernet/3com/typhoon.c @@ -2278,6 +2278,7 @@ typhoon_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) struct net_device *dev; struct typhoon *tp; int card_id = (int) ent->driver_data; + u8 addr[ETH_ALEN] __aligned(4); void __iomem *ioaddr; void *shared; dma_addr_t shared_dma; @@ -2409,8 +2410,9 @@ typhoon_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) goto error_out_reset; } - *(__be16 *)&dev->dev_addr[0] = htons(le16_to_cpu(xp_resp[0].parm1)); - *(__be32 *)&dev->dev_addr[2] = htonl(le32_to_cpu(xp_resp[0].parm2)); + *(__be16 *)&addr[0] = htons(le16_to_cpu(xp_resp[0].parm1)); + *(__be32 *)&addr[2] = htonl(le32_to_cpu(xp_resp[0].parm2)); + eth_hw_addr_set(dev, addr); if (!is_valid_ether_addr(dev->dev_addr)) { err_msg = "Could not obtain valid ethernet address, aborting"; From patchwork Wed Jan 26 00:37:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Kicinski X-Patchwork-Id: 12724407 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id F117CC5AC75 for ; Wed, 26 Jan 2022 00:40:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=aSTnawni15rJyjLc8a7SRcvmV+IStUc2hfyihZ2BRbw=; b=IaNuaYCgq+o4DB syhKyyb23WQbf/HszOoIjVDzXPKYgaLPVyyFB6S0J+d9nBh8Pp3JNzyGq/4N2vsblEWdzE4+UaQ/I TfbTYvByHFQFisDMLXvyUql0vW/JpbmwfckUJb6XvkPisWo6XqYNoz+PuNFg3PuFOYkvma3WCzWrI BMPkUUyMPjgCrnY9+8zKURwVw6ThJrFhKqFFEKaOPX+iw9jDiL0XihOGfJHuQhw6wRO415Bbqpdpl x3/GnZ4mCxhAzi9KPJ+I1dyDxV00Dj3gpOoVgJVTBKVqaShXcZ2ePFEy8bdksZkyE9Pt07Q+2XncZ 85kWcGQVze/omy7NUzHQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nCWKn-009k3M-A1; Wed, 26 Jan 2022 00:38:49 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nCWK7-009jty-G1 for linux-arm-kernel@lists.infradead.org; Wed, 26 Jan 2022 00:38:10 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 9A2E9614ED; Wed, 26 Jan 2022 00:38:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C20C7C340E0; Wed, 26 Jan 2022 00:38:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1643157486; bh=8EPKyibJPLFnHUibBxFOVRIZAK8CWCm519c3Pj97zX8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XEV65wnTHrrJMFVD1o4AVGvnyx+XZkTw54t5/+klLsvCw29pnWZleaxwW2LYDes8A /l4HvF1G38v12ijoQzQNuxi30GcCoIUxv/JEn6ZK/e3Fpxfdr8rUuvLmAG9rDGyqjS HmgPtVnZyE0td0tc6HVEVBsbpcefWLd0LuS4RNp45PNZPwHQeHX6lbXFnPZihDnBqo gGhLgList6tuwUvwyfOLbEbTckvIS0MIXlhDU6gaj0PbIOfDjviuTw4/tGab+k9qxh CAlXGCvQPAcP0TwF6sfr+E3FsY5R0uRJ925BO9nISIH+z5nEwdnd0L7W4i+FP0R5lG +WBaNVH6jME5A== From: Jakub Kicinski To: davem@davemloft.net Cc: netdev@vger.kernel.org, dave@thedillows.org, linux@armlinux.org.uk, linux-arm-kernel@lists.infradead.org, Jakub Kicinski Subject: [PATCH net v2 2/6] ethernet: tundra: don't write directly to netdev->dev_addr Date: Tue, 25 Jan 2022 16:37:57 -0800 Message-Id: <20220126003801.1736586-3-kuba@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220126003801.1736586-1-kuba@kernel.org> References: <20220126003801.1736586-1-kuba@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220125_163807_636884_A268714B X-CRM114-Status: GOOD ( 15.22 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org netdev->dev_addr is const now. Maintain the questionable offsetting in ndo_set_mac_address. Compile tested holly_defconfig and mpc7448_hpc2_defconfig. Fixes: adeef3e32146 ("net: constify netdev->dev_addr") Signed-off-by: Jakub Kicinski --- drivers/net/ethernet/tundra/tsi108_eth.c | 35 ++++++++++++------------ 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/drivers/net/ethernet/tundra/tsi108_eth.c b/drivers/net/ethernet/tundra/tsi108_eth.c index cf0917b29e30..5251fc324221 100644 --- a/drivers/net/ethernet/tundra/tsi108_eth.c +++ b/drivers/net/ethernet/tundra/tsi108_eth.c @@ -1091,20 +1091,22 @@ static int tsi108_get_mac(struct net_device *dev) struct tsi108_prv_data *data = netdev_priv(dev); u32 word1 = TSI_READ(TSI108_MAC_ADDR1); u32 word2 = TSI_READ(TSI108_MAC_ADDR2); + u8 addr[ETH_ALEN]; /* Note that the octets are reversed from what the manual says, * producing an even weirder ordering... */ if (word2 == 0 && word1 == 0) { - dev->dev_addr[0] = 0x00; - dev->dev_addr[1] = 0x06; - dev->dev_addr[2] = 0xd2; - dev->dev_addr[3] = 0x00; - dev->dev_addr[4] = 0x00; + addr[0] = 0x00; + addr[1] = 0x06; + addr[2] = 0xd2; + addr[3] = 0x00; + addr[4] = 0x00; if (0x8 == data->phy) - dev->dev_addr[5] = 0x01; + addr[5] = 0x01; else - dev->dev_addr[5] = 0x02; + addr[5] = 0x02; + eth_hw_addr_set(dev, addr); word2 = (dev->dev_addr[0] << 16) | (dev->dev_addr[1] << 24); @@ -1114,12 +1116,13 @@ static int tsi108_get_mac(struct net_device *dev) TSI_WRITE(TSI108_MAC_ADDR1, word1); TSI_WRITE(TSI108_MAC_ADDR2, word2); } else { - dev->dev_addr[0] = (word2 >> 16) & 0xff; - dev->dev_addr[1] = (word2 >> 24) & 0xff; - dev->dev_addr[2] = (word1 >> 0) & 0xff; - dev->dev_addr[3] = (word1 >> 8) & 0xff; - dev->dev_addr[4] = (word1 >> 16) & 0xff; - dev->dev_addr[5] = (word1 >> 24) & 0xff; + addr[0] = (word2 >> 16) & 0xff; + addr[1] = (word2 >> 24) & 0xff; + addr[2] = (word1 >> 0) & 0xff; + addr[3] = (word1 >> 8) & 0xff; + addr[4] = (word1 >> 16) & 0xff; + addr[5] = (word1 >> 24) & 0xff; + eth_hw_addr_set(dev, addr); } if (!is_valid_ether_addr(dev->dev_addr)) { @@ -1136,14 +1139,12 @@ static int tsi108_set_mac(struct net_device *dev, void *addr) { struct tsi108_prv_data *data = netdev_priv(dev); u32 word1, word2; - int i; if (!is_valid_ether_addr(addr)) return -EADDRNOTAVAIL; - for (i = 0; i < 6; i++) - /* +2 is for the offset of the HW addr type */ - dev->dev_addr[i] = ((unsigned char *)addr)[i + 2]; + /* +2 is for the offset of the HW addr type */ + eth_hw_addr_set(dev, ((unsigned char *)addr) + 2); word2 = (dev->dev_addr[0] << 16) | (dev->dev_addr[1] << 24); From patchwork Wed Jan 26 00:37:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Kicinski X-Patchwork-Id: 12724403 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 55348C5DF62 for ; Wed, 26 Jan 2022 00:40:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=WSfmsz2Qgot07vvTwBK5A51Ed5gkxborEgwoTO0qTP8=; b=MKGRE6h0jPcE8m YijG61QLP0Q+Bzl8HmaaPK5nx1Hhe1xyiH3JU77STuUY1uPfBqnOWaFthC7Ka+cl6MsTyZWvW89ww 6v34clHrV5EKU1OSyrM/XLnaDMmEs4ZVeq0gG/VEMfzy3A69ET6AutYyBqJEVVXqkUSneYdNt+tAT dwJWKbt17ScLhuv0cRMulQB+1mGuRJOTYWh6Ax7AcPsa/guHOlhVd1CSNggYCfQZS5W3ocIEj2ZS7 mTHcXNKFidwGUzW4kwlKA4hbD8gmPBRtN8vL+P9wC91AHKSykBpHCmHb9rSA9/1HT1R+qWHnKSMl1 EUF+STlQWTOqR8UW9BTg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nCWKI-009jyC-Nr; Wed, 26 Jan 2022 00:38:18 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nCWK7-009jtz-G3 for linux-arm-kernel@lists.infradead.org; Wed, 26 Jan 2022 00:38:08 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 0F8D2614F1; Wed, 26 Jan 2022 00:38:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 35E40C340EE; Wed, 26 Jan 2022 00:38:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1643157486; bh=VTJqecm5X/zvzaE/jGRrIqxDW1iScy7AUV6tqYM48Zg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bNndjlWv82LFPFnnsSndsTmWMhAwNTi4FrfawdlBXjBlaTOngUa0rzoomz0aPxrP0 PkWWY1I3/9rzoLXkmg8V2tetmof706MO4AA+yyyEEjN3olqEr+vLMZOUXx1L/FMO5p gF+KzPrss/YhTTL5HKVYySFj8YPJhL6cFUi6b4THbl/yMxkv65huX8tECYZhCSjhF+ goajC3YT7jtxFUHBSCP6aah84FU+3YyPjUZTML2b78nRQzflVYWizxGsMknvzShzqg MneFhGCpytk5J6ZuxqhPUkr48k7WcouQINmkyQeXK0ZjQK60OsUcUBV16qGuCUIN81 8gaG3/wYXe1rg== From: Jakub Kicinski To: davem@davemloft.net Cc: netdev@vger.kernel.org, dave@thedillows.org, linux@armlinux.org.uk, linux-arm-kernel@lists.infradead.org, Jakub Kicinski Subject: [PATCH net v2 3/6] ethernet: broadcom/sb1250-mac: don't write directly to netdev->dev_addr Date: Tue, 25 Jan 2022 16:37:58 -0800 Message-Id: <20220126003801.1736586-4-kuba@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220126003801.1736586-1-kuba@kernel.org> References: <20220126003801.1736586-1-kuba@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220125_163807_600912_7B4066C0 X-CRM114-Status: GOOD ( 11.88 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org netdev->dev_addr is const now. Compile tested bigsur_defconfig and sb1250_swarm_defconfig. Fixes: adeef3e32146 ("net: constify netdev->dev_addr") Signed-off-by: Jakub Kicinski --- drivers/net/ethernet/broadcom/sb1250-mac.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/net/ethernet/broadcom/sb1250-mac.c b/drivers/net/ethernet/broadcom/sb1250-mac.c index f38f40eb966e..a1a38456c9a3 100644 --- a/drivers/net/ethernet/broadcom/sb1250-mac.c +++ b/drivers/net/ethernet/broadcom/sb1250-mac.c @@ -2183,9 +2183,7 @@ static int sbmac_init(struct platform_device *pldev, long long base) ea_reg >>= 8; } - for (i = 0; i < 6; i++) { - dev->dev_addr[i] = eaddr[i]; - } + eth_hw_addr_set(dev, eaddr); /* * Initialize context (get pointers to registers and stuff), then From patchwork Wed Jan 26 00:37:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Kicinski X-Patchwork-Id: 12724404 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C12A7C5AC75 for ; Wed, 26 Jan 2022 00:40:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=g2j1nDJSNRpydxgEpRgnwjpTmJDCYEAIpiwyr1UvpmU=; b=gAb2gf0i4swVMr 96RLAdsNbV67mzyXfgyFLnX4gn55CSjyb2AiBbqnaWoulXsmecoufLh1XlPOOxmFCSp39Zs+dEeDC 6q9PEMlMyhFv9kBIKA6rB/bW1MVw3TADtjT3O9lsiNUbv67f1fBpet4S7Hw7GCCQEkeVzO8LGolRk Q5QE/mY+OBzheoP3hxvZAz30aHYLZl5EV3q3ipt40fE0zaKMepAvpkIXOlDSVG8q5PDjQDe7unY9I 8vg6fneu+9wWUtXjikHHebZAhw4ksAXZWHGSiMGhsYbSX+EHJIfKfegxstBhdPnuFwomJUExbkj0a 3uLE19D61G9qkBz4xaZw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nCWKS-009jz5-0p; Wed, 26 Jan 2022 00:38:28 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nCWK7-009ju0-Gd for linux-arm-kernel@lists.infradead.org; Wed, 26 Jan 2022 00:38:08 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 15DBB61511; Wed, 26 Jan 2022 00:38:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9DAC1C340ED; Wed, 26 Jan 2022 00:38:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1643157486; bh=UYx5U1wg/JjtdQv0R5uX/+FrMhWvP4HtZiJJfP9ep18=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Qxp2M9TiuL4RSbr1rAIWxoPDu40LvlB1pG8/c5T6OMdFLwylz6g47hcgt+BIJr2Mb 6z8PsaJ/QMwwnBBKnbi1bzy9jow3dC1uhFZlZueeKHtv9ixzb/xonKfsw5ucadYLw+ aNQtw4jnnIPM+Oq4uflnIrZWBZmyBMoYfIYBGLxMh5DP4S7dRYrviIWUo6KTF9phWL EUZHKEPrMohjHYS7ZPHmcq3y86GiNWO7DIpcgGBGW5UWMV3KO+uAiyQZNFv/NBG725 Wemrw2ZOWXQjhQhHeX7f3xDVdYE7VKAXmwIaDNj5ch6v/WTEJzTIfHpVJwazu0+wqg nz9zfs19ehEKQ== From: Jakub Kicinski To: davem@davemloft.net Cc: netdev@vger.kernel.org, dave@thedillows.org, linux@armlinux.org.uk, linux-arm-kernel@lists.infradead.org, Jakub Kicinski Subject: [PATCH net v2 4/6] ethernet: i825xx: don't write directly to netdev->dev_addr Date: Tue, 25 Jan 2022 16:37:59 -0800 Message-Id: <20220126003801.1736586-5-kuba@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220126003801.1736586-1-kuba@kernel.org> References: <20220126003801.1736586-1-kuba@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220125_163807_620627_EEF51FDA X-CRM114-Status: GOOD ( 12.84 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org netdev->dev_addr is const now. Compile tested rpc_defconfig w/ GCC 8.5. Fixes: adeef3e32146 ("net: constify netdev->dev_addr") Signed-off-by: Jakub Kicinski Reviewed-by: Russell King (Oracle) --- drivers/net/ethernet/i825xx/ether1.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/i825xx/ether1.c b/drivers/net/ethernet/i825xx/ether1.c index c612ef526d16..3e7d7c4bafdc 100644 --- a/drivers/net/ethernet/i825xx/ether1.c +++ b/drivers/net/ethernet/i825xx/ether1.c @@ -986,6 +986,7 @@ static int ether1_probe(struct expansion_card *ec, const struct ecard_id *id) { struct net_device *dev; + u8 addr[ETH_ALEN]; int i, ret = 0; ether1_banner(); @@ -1015,7 +1016,8 @@ ether1_probe(struct expansion_card *ec, const struct ecard_id *id) } for (i = 0; i < 6; i++) - dev->dev_addr[i] = readb(IDPROM_ADDRESS + (i << 2)); + addr[i] = readb(IDPROM_ADDRESS + (i << 2)); + eth_hw_addr_set(dev, addr); if (ether1_init_2(dev)) { ret = -ENODEV; From patchwork Wed Jan 26 00:38:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Kicinski X-Patchwork-Id: 12724406 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 481F7C5AC75 for ; Wed, 26 Jan 2022 00:40:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=7BTfEom0AZQ26DcSzQnkrbK7F3CklF6VAmBTQXy090c=; b=L2ZVVIqANPtAy7 W6P2PFHJpdzTh5NNqh5uv3GWJdigwqiW+SHCwdTiHtXxxXiLFwOXTkJgNRiMiR5QWvE3vFhwOHJuh hbMFqMwfhVHTZfZQTKFzK5ntUMGHKEomLMOoq74MOu3Vpk7gF0HvUmx0entBIMZzI2oGYdVHprKTG koH5sdWB2sMCx+7mL+6Nsv8WWKK2mvm3fWvCZ81OxgKFwJkUuf9rYwuRlvFnwrcPSV+Mz3wELjlqb u6al8a/heuQgTi6YTMKieWRRz7nQ1kGwLrFf2YOQmqVFS+9sURXQ8V3eubgIYcZeSkxxqacVBT5B9 Q0deumcEvwGwZeSAdUpg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nCWKc-009k0R-3G; Wed, 26 Jan 2022 00:38:38 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nCWK7-009juc-Tg for linux-arm-kernel@lists.infradead.org; Wed, 26 Jan 2022 00:38:10 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 7F2A761512; Wed, 26 Jan 2022 00:38:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 11975C340EF; Wed, 26 Jan 2022 00:38:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1643157487; bh=LnVgHwnzz6kGeN/ldDgS21isdYgANJXvfysLOD9AdlM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cX1ybcKxR5AH7p62um6KGGPuqGN+7INBYDJRxyz95bCX/AM/0QWh3DZIF3a1X5Ciz 8EaJd53F8f+2Ia+F1k1HYsOQg97F6VY1CEQKij6WYUlGFClYYD8rf04fEkOtVsWF+L /y0q7q0FisHyUfW7PSZYgzZA1fDg551Vs+/2ksG3//R3LwSj5CgTVe49hJwfVD55in XyNRt8OkAkpnVTub76iDKPBpouxoStnfmIniX8q1WTHrUkLqX+Dj3D+9h/ltq1a+Jk ZUoKZeKuyWs16xy258fX4RjIetmgR9g7n/66fz4zlyHv9+jjuD3G0wMJVR/ooemAJf vLZIkBSRCR/vg== From: Jakub Kicinski To: davem@davemloft.net Cc: netdev@vger.kernel.org, dave@thedillows.org, linux@armlinux.org.uk, linux-arm-kernel@lists.infradead.org, Jakub Kicinski Subject: [PATCH net v2 5/6] ethernet: 8390/etherh: don't write directly to netdev->dev_addr Date: Tue, 25 Jan 2022 16:38:00 -0800 Message-Id: <20220126003801.1736586-6-kuba@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220126003801.1736586-1-kuba@kernel.org> References: <20220126003801.1736586-1-kuba@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220125_163808_014313_B23ADD2A X-CRM114-Status: GOOD ( 11.30 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org netdev->dev_addr is const now. Compile tested rpc_defconfig w/ GCC 8.5. Fixes: adeef3e32146 ("net: constify netdev->dev_addr") Signed-off-by: Jakub Kicinski Reviewed-by: Russell King (Oracle) --- drivers/net/ethernet/8390/etherh.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/8390/etherh.c b/drivers/net/ethernet/8390/etherh.c index bd22a534b1c0..e7b879123bb1 100644 --- a/drivers/net/ethernet/8390/etherh.c +++ b/drivers/net/ethernet/8390/etherh.c @@ -655,6 +655,7 @@ etherh_probe(struct expansion_card *ec, const struct ecard_id *id) struct ei_device *ei_local; struct net_device *dev; struct etherh_priv *eh; + u8 addr[ETH_ALEN]; int ret; ret = ecard_request_resources(ec); @@ -724,12 +725,13 @@ etherh_probe(struct expansion_card *ec, const struct ecard_id *id) spin_lock_init(&ei_local->page_lock); if (ec->cid.product == PROD_ANT_ETHERM) { - etherm_addr(dev->dev_addr); + etherm_addr(addr); ei_local->reg_offset = etherm_regoffsets; } else { - etherh_addr(dev->dev_addr, ec); + etherh_addr(addr, ec); ei_local->reg_offset = etherh_regoffsets; } + eth_hw_addr_set(dev, addr); ei_local->name = dev->name; ei_local->word16 = 1; From patchwork Wed Jan 26 00:38:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Kicinski X-Patchwork-Id: 12724409 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E3647C5AC75 for ; Wed, 26 Jan 2022 00:40:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=AgiLiMZp3PkN1NFaZ8DABU/iH5PfTeUr49EPQ0cGfLM=; b=BoJCQ8E/0Y4HzK e3oYXoTINlBMvdSBBewtdKpqmGs7/KBFv73G8cg8ml2lUSJd6vNTAku580RIKGh3w/6TK1LoH7WTR d5QKhS6l5AZ7jOdGWULmlA0PFRERlzEMuzIWSQjehok4zw/7z7nrpEjen+JtD4pYF5gzAIL5hK7Fh pAPeP7vIl1xgQuMPadDNhLt550mrmS5wfus6IFPlMTogto09rJQhllTTYwWhw/LtWJ/pBK3PnX6rW DePy0QgRRbMNz5Ss1VpAP7v14ex5ZoVrOEErbHTJYSrKUX1InuxuyR+h2ut08RqePMpQ/ZP+N0pbr J7B2wSPruy2jzNEUl7rQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nCWL9-009kDR-ME; Wed, 26 Jan 2022 00:39:11 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nCWK8-009juz-B0 for linux-arm-kernel@lists.infradead.org; Wed, 26 Jan 2022 00:38:11 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id E7CFE614E7; Wed, 26 Jan 2022 00:38:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7D8FDC340EB; Wed, 26 Jan 2022 00:38:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1643157487; bh=XIKhWG/yrRc9acbEBo5t9YJGBTtlszI2HeaFhi/4TRM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OgdxwivgzWmvyidgBjcRhuuUBPsgDyZ8GbOsoixEo4N6pOiXvFuVfjDYQX8sKQ8+X ws9La5cpfAd8hVymz440zUtGLWHxVcNcfCbUAbxR7FeiBjB7KcNpY1aFcay9c8PFc8 ie9NtI1mb7apCkZCi8Lnkopu/VEVRHv4LE6yM4R+MuItRfUvUFvhtB0KpEmA6hhpSC dgm87CFAeWoWFlBq0CgIdcGbHWRF1Jzo4TJgKPRtXoJt7WRzAkdNpuMFNlaJ8NcDJ0 tvMXz98xY0l9FD/RI4rzO2gjDc8SAttXvpB7ijkS9pTTlxwJSS8oKSVlz/knkTxQ3B +SeBS4fbIs6NA== From: Jakub Kicinski To: davem@davemloft.net Cc: netdev@vger.kernel.org, dave@thedillows.org, linux@armlinux.org.uk, linux-arm-kernel@lists.infradead.org, Jakub Kicinski Subject: [PATCH net v2 6/6] ethernet: seeq/ether3: don't write directly to netdev->dev_addr Date: Tue, 25 Jan 2022 16:38:01 -0800 Message-Id: <20220126003801.1736586-7-kuba@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220126003801.1736586-1-kuba@kernel.org> References: <20220126003801.1736586-1-kuba@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220125_163808_444192_3E1EF77F X-CRM114-Status: GOOD ( 11.08 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org netdev->dev_addr is const now. Compile tested rpc_defconfig w/ GCC 8.5. Fixes: adeef3e32146 ("net: constify netdev->dev_addr") Signed-off-by: Jakub Kicinski Reviewed-by: Russell King (Oracle) --- drivers/net/ethernet/seeq/ether3.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/seeq/ether3.c b/drivers/net/ethernet/seeq/ether3.c index 16a4cbae9326..c672f92d65e9 100644 --- a/drivers/net/ethernet/seeq/ether3.c +++ b/drivers/net/ethernet/seeq/ether3.c @@ -749,6 +749,7 @@ ether3_probe(struct expansion_card *ec, const struct ecard_id *id) const struct ether3_data *data = id->data; struct net_device *dev; int bus_type, ret; + u8 addr[ETH_ALEN]; ether3_banner(); @@ -776,7 +777,8 @@ ether3_probe(struct expansion_card *ec, const struct ecard_id *id) priv(dev)->seeq = priv(dev)->base + data->base_offset; dev->irq = ec->irq; - ether3_addr(dev->dev_addr, ec); + ether3_addr(addr, ec); + eth_hw_addr_set(dev, addr); priv(dev)->dev = dev; timer_setup(&priv(dev)->timer, ether3_ledoff, 0);