Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3493073pxb; Mon, 18 Oct 2021 16:50:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzB341oLEqvdqyAaH6pfLYGtgWWk0kASQhnOYTQaNeYJKG5OQ8KqqVsmyuKQWFmi3tVH8vi X-Received: by 2002:a50:d84c:: with SMTP id v12mr47063098edj.203.1634601053667; Mon, 18 Oct 2021 16:50:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634601053; cv=none; d=google.com; s=arc-20160816; b=tZm5IN37HIjORQ9eAPAV4nZ6gEEO17wcmgJdLxIeT+ItHZyv8WyltPnHNVmb5BUykv 4ERCFRIhuHwOVF8TSRj3BfsdlTf1yOGw4Niotz44SHU+S7IWpxCysYyHIajAzAM+Xfaa rB/xjL4ndg/KA33pA6mKXbFc16HNeR2HOXURpI5qYjzcPldPC7Y8vaGaq3XSVI8EcIn1 bIfWz2dzpELoWazgPMgBGxj7dmEioL/YNI9d9druvIuuUryiL7EPCKu5NJC+6rUAtfyP Hk9pJPZTaDUb2SNCgm9KH3C6blQ4vsazHgSHtX6hCXFpiCJ+gPtv5cS6/xDJZ1Azq8Ov 0uJw== 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=8JoeIt3aAXYkQkijAcXzouCosriUzr1laQMGA8K2dko=; b=EPr5YGwAy82jJd0NXVL6UDmUcapDfbFtU83KH1EDY7orhIH18ZYCSrVDgx7GB+rL5n na8O4dhV8gmiPbO8QVus9V3zglKi23mBOjhfE0/Vl0D/B8746/piMsj9MMBhBRTorMEb 3XhlqEpuNYLM4X7cZmoInsCoNypehBBHC1NVr7xUNvl8O+/2IBZwdeHLhwTLD3XENMcq he/HdMYrSmFBRNJSlbgudo/RsdaUKi5YU+9kfQMv/7+/Jr77nd27ujaF0g12AUBGO88U UrNymWM14hVHgjS02t6hOKhGjou/nGRXDeron2y1TinKQiHjR3sObC6dOY+KxefBnHv7 rYGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=tmxfz7bn; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-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 y15si22817152edd.182.2021.10.18.16.50.36; Mon, 18 Oct 2021 16:50:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-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=tmxfz7bn; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-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 S233252AbhJRXwl (ORCPT + 64 others); Mon, 18 Oct 2021 19:52:41 -0400 Received: from mail.kernel.org ([198.145.29.99]:34936 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232256AbhJRXwj (ORCPT ); Mon, 18 Oct 2021 19:52:39 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id E4FF061206; Mon, 18 Oct 2021 23:50:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1634601028; bh=ukd+R49DUQREErzqLqUOozd0TGISYib4Ep8MxPeGCK8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tmxfz7bndsAIXWpgf/Mr/NQD2VGTxKBNtwDolUo2Sc1xO8+iINTz7KrR7idMPmf79 rkQ+RoyFfRrvG8jyAsa46v4rhgkkmXhZBm+zQWreUP15BNy4NWf2sKRtoXC8kjl20o h8f0vnA4Bm5sWKgFrIcWE1Iap4SZQGBPzfaR83a1SZLU7PtqME9TozOPgaaOm9892C P7RnR4+RoObPGBVdW4VE4WKL8Ywdzq0QJaLnO+k6xitW8p/ANF14TAzHKzLJhS+YXa 4zjbcJ6K+zTJ7cutqdAwQOx47jRrmY88C0iAtGfCmjNf1fGIgVzDo5yweIJdjt9BHP zDdPfaFQtGxuw== From: Jakub Kicinski To: kvalo@codeaurora.org Cc: linux-wireless@vger.kernel.org, Jakub Kicinski Subject: [PATCH 03/15] wireless: use eth_hw_addr_set() for dev->addr_len cases Date: Mon, 18 Oct 2021 16:50:09 -0700 Message-Id: <20211018235021.1279697-4-kuba@kernel.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211018235021.1279697-1-kuba@kernel.org> References: <20211018235021.1279697-1-kuba@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Convert all WiFi drivers from memcpy(... dev->addr_len) to eth_hw_addr_set(): @@ expression dev, np; @@ - memcpy(dev->dev_addr, np, dev->addr_len) + eth_hw_addr_set(dev, np) Manually checked the netdevs are allocated with alloc_etherdev(), so dev->addr_len must be equal to ETH_ALEN. Signed-off-by: Jakub Kicinski --- drivers/net/wireless/atmel/atmel.c | 2 +- drivers/net/wireless/zydas/zd1201.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/atmel/atmel.c b/drivers/net/wireless/atmel/atmel.c index 3d782fabbfe6..8290cf881a1b 100644 --- a/drivers/net/wireless/atmel/atmel.c +++ b/drivers/net/wireless/atmel/atmel.c @@ -1296,7 +1296,7 @@ static int atmel_set_mac_address(struct net_device *dev, void *p) { struct sockaddr *addr = p; - memcpy (dev->dev_addr, addr->sa_data, dev->addr_len); + eth_hw_addr_set(dev, addr->sa_data); return atmel_open(dev); } diff --git a/drivers/net/wireless/zydas/zd1201.c b/drivers/net/wireless/zydas/zd1201.c index 097805b55c59..6b735fee7b18 100644 --- a/drivers/net/wireless/zydas/zd1201.c +++ b/drivers/net/wireless/zydas/zd1201.c @@ -857,7 +857,7 @@ static int zd1201_set_mac_address(struct net_device *dev, void *p) addr->sa_data, dev->addr_len, 1); if (err) return err; - memcpy(dev->dev_addr, addr->sa_data, dev->addr_len); + eth_hw_addr_set(dev, addr->sa_data); return zd1201_mac_reset(zd); } -- 2.31.1