Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3385407pxb; Mon, 17 Jan 2022 19:16:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJzpyPahMN5Q308Hq9RoczDKZe9YR/12x23R/f/xGnFkQpRtk+1wqfFPpJcAurKz2Zj1Nwoh X-Received: by 2002:a17:902:ea0c:b0:14a:3b28:a336 with SMTP id s12-20020a170902ea0c00b0014a3b28a336mr25527280plg.108.1642475773960; Mon, 17 Jan 2022 19:16:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642475773; cv=none; d=google.com; s=arc-20160816; b=fMlM34ZNQqRrMcrKobi553tLGSZki1HlXIyJSHWJiNL//h1TxnWVAJM3WSF7F2t4AD c5xMcR/EH3W7ny4GwYcWG2O1hSSGrM/tKyHoBmY+KieOFJRuu16sGwzIpodpFHvCJEBI WO7w32Lyf7dcNBEXpp9eTosRfZT5kwEYmBYw02/gJk7jSXmQJAGRyE7bKrFB1eVFMha/ wRfwdAg37c6SoIykAPWNbClAIDm8PiDG0VgoV0cbSTjlx7Dscz4BaWAtJzPBTC6vcOYz SuxlBU56wx1px7LsjUfgwpgyhnlEcD/m2fRwLiB+s5996LpT5+Ld0JSysmNqFbxPTKYX RKEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=WPbdLcEuKhwFfnwuoNAauIGOp7txZXDmQ8XNsbDDJ7k=; b=zln0BVo7ZZrUWsjrXTBzqZ3tqA9Cl3wXxALFoeYswRQffAk5yFTnXPhJz3X4krqubZ of2jZ+tVGRSVXJV+fpO8n+Wuh4aGEM7BYNDDipCWV4iYWfMgDbf+er+4AAli7YpmTPCo KI0llxVyFKgul6a2qw/ikygDIVax+5Dc275aBrFkCEUD6e7XM8xFsGiW4H6Ql2zCSbQV DAOhFMzVWK9QeZdGLSzir+LdMROyrk+hKfFBJPvz4SbdqpF/Q9S8KAckCRog9D/xHsps 5a28EHXOX5287Xr9reyy69C2W1p2orAXNpfGLy25E5CptMDvNnJGUd/8nMiobUUU7N5W Kpeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="RbwJ/7iS"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y5si16499545pgk.83.2022.01.17.19.16.01; Mon, 17 Jan 2022 19:16:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="RbwJ/7iS"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244634AbiARCXD (ORCPT + 99 others); Mon, 17 Jan 2022 21:23:03 -0500 Received: from dfw.source.kernel.org ([139.178.84.217]:38972 "EHLO dfw.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244995AbiARCWY (ORCPT ); Mon, 17 Jan 2022 21:22:24 -0500 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 18EA66093C; Tue, 18 Jan 2022 02:22:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C370DC36B03; Tue, 18 Jan 2022 02:22:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1642472543; bh=HUX8zC8VUF7r0QnJ6B/WpuRDXY8O4kCl6za7Ycf6cyQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RbwJ/7iSNHGal8TsV2kSJ8UuFPFU8HfIofzSF8EBQoOmp5l16oU2xH+EpIwuRaR7W Wn/78ypJo6wVThMfoLvSHjSzYrK4hW+Nhg5VwyFkup7oM8sfaDbJj/2rD4knzj9+/F KJA93ydPjhVcFa988wiMpWsPHilTAWqrSpv0k925kdOKnR/LkMqXq7U98Jc8hn/nzr vV1ZPs9XVaodrw46HoUtRD9HoEuxFSBQ4dv6casAqxfJqiKhkRhij8ZUHa0GDNzfGh Jb91zA2SBXmivzqA6vInSfp6lHRpn0D/W2C7NHlhas5nwF4fo3K7rcKWLdOfv/R7S7 Ma7pWtenpuaAg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Jakub Kicinski , "David S . Miller" , Sasha Levin , netdev@vger.kernel.org Subject: [PATCH AUTOSEL 5.16 046/217] apple: macmace: use eth_hw_addr_set() Date: Mon, 17 Jan 2022 21:16:49 -0500 Message-Id: <20220118021940.1942199-46-sashal@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220118021940.1942199-1-sashal@kernel.org> References: <20220118021940.1942199-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jakub Kicinski [ Upstream commit e217fc4affc8c7392e4db48488b36d2a5d446e9d ] Byte by byte assignments. Fixes build on m68k. Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/apple/macmace.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/apple/macmace.c b/drivers/net/ethernet/apple/macmace.c index 95d3061c61be9..8fcaf16399201 100644 --- a/drivers/net/ethernet/apple/macmace.c +++ b/drivers/net/ethernet/apple/macmace.c @@ -92,7 +92,7 @@ static void mace_reset(struct net_device *dev); static irqreturn_t mace_interrupt(int irq, void *dev_id); static irqreturn_t mace_dma_intr(int irq, void *dev_id); static void mace_tx_timeout(struct net_device *dev, unsigned int txqueue); -static void __mace_set_address(struct net_device *dev, void *addr); +static void __mace_set_address(struct net_device *dev, const void *addr); /* * Load a receive DMA channel with a base address and ring length @@ -197,6 +197,7 @@ static int mace_probe(struct platform_device *pdev) unsigned char *addr; struct net_device *dev; unsigned char checksum = 0; + u8 macaddr[ETH_ALEN]; int err; dev = alloc_etherdev(PRIV_BYTES); @@ -229,8 +230,9 @@ static int mace_probe(struct platform_device *pdev) for (j = 0; j < 6; ++j) { u8 v = bitrev8(addr[j<<4]); checksum ^= v; - dev->dev_addr[j] = v; + macaddr[j] = v; } + eth_hw_addr_set(dev, macaddr); for (; j < 8; ++j) { checksum ^= bitrev8(addr[j<<4]); } @@ -315,11 +317,12 @@ static void mace_reset(struct net_device *dev) * Load the address on a mace controller. */ -static void __mace_set_address(struct net_device *dev, void *addr) +static void __mace_set_address(struct net_device *dev, const void *addr) { struct mace_data *mp = netdev_priv(dev); volatile struct mace *mb = mp->mace; - unsigned char *p = addr; + const unsigned char *p = addr; + u8 macaddr[ETH_ALEN]; int i; /* load up the hardware address */ @@ -331,7 +334,8 @@ static void __mace_set_address(struct net_device *dev, void *addr) ; } for (i = 0; i < 6; ++i) - mb->padr = dev->dev_addr[i] = p[i]; + mb->padr = macaddr[i] = p[i]; + eth_hw_addr_set(dev, macaddr); if (mp->chipid != BROKEN_ADDRCHG_REV) mb->iac = 0; } -- 2.34.1