Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp2778141lqo; Tue, 14 May 2024 08:52:21 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWaha683mJDa+xOKRg5RojuxWBWdq1aPMb1bnwvOvOP1S0T7hSj84gKEPy7rl6BgeDGHCq3ve13kUwdiv5Yv+O8ikRp3dTY8Fzeew+cEA== X-Google-Smtp-Source: AGHT+IGJdcbds94BBboZbkJcn8gPzJrGR35YFyeo9YM21+izeBNyltLLxZQcJ4KI3+hVDuFlb+4S X-Received: by 2002:a50:d502:0:b0:572:9b20:fa with SMTP id 4fb4d7f45d1cf-5734d67e79fmr9692204a12.33.1715701940839; Tue, 14 May 2024 08:52:20 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715701940; cv=pass; d=google.com; s=arc-20160816; b=JGeti0OA1/5pwNmQ7pDFnKZL+FMwY01zpn1FeLZDpYu7GwnbSn4r+dL9CGJ5uZU5pV K0ZQrQKTJ87znhyyhWyKma0aSNroLZCb+j4LWRO3H5NlRj6bRg8mess6n156rA9x3BC0 YICXRGOjEJAuYsNVXvJJRggXTJG4kEmZJ+l0hTEDiT/DIiH4grslwin/d9v8KB8knP7t 5ryHWaZ+vLHp4Z3JwycN+9XWv5LmBi3d6nBtRJzXdwMkHMzcabietjJgZ56JeqwEMDPr ZdfPYxj0zFKDrvjIfk9EHAZqpU5eS6IqC6rtp5kUU6vBHXqj0XWbgHvSv40nRo0NWfMx ybIA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=/q1zVDoqEbRtn4br8zecJV6ThTUPNCtWDfIqMVXyJZQ=; fh=vcGDIN/mfbuUPvkhvpieVvHCC+YIk0wMhqt/5Fd4KJI=; b=J4b+35pVAC3uk25U2vVQYSMOzS81y22tPboC78bo/ixeahSOAQKTZEi0XDakYA5nIm FsGSy2AbC+llUYiijkTrjLmas3RKGYQ2GPpJCnd8A3k96hgdQyGUSMygeS9O3ton3Jnb 86YGRAN0uUuJd5KHz/1p9m7nixjGlkzzEtd1BMjDf4N1X7rpRSJ6g825izSa+mrUCbXb 28ym1srTfdFq7vBlelzZsq4JEMLvNvOIs+Wv1V2vkMLBhpRxq55YrhrvDsuEdRrasW+L kQqOzOhDwnughQ+EkoxRGrADYg+1K0PiJt58XM0MMPApCUmRN6YpEPkkT5TfpM1aFRjV mDhQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=QHKfaRwJ; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-178884-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-178884-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-574f26f01ebsi50750a12.220.2024.05.14.08.52.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 May 2024 08:52:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-178884-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=QHKfaRwJ; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-178884-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-178884-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id C50581F236A7 for ; Tue, 14 May 2024 15:52:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 098641802B2; Tue, 14 May 2024 15:51:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="QHKfaRwJ" Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [217.70.183.197]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C56DB17EBA5; Tue, 14 May 2024 15:51:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.197 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715701892; cv=none; b=oFqTTuzecUgV8/URWzbSbBSSz3wWjtSiUsW/NuIAVMkTzuTmWzEoUdru2GsKg2ZyoW1yc7iJZjIZq7WBgl54sc5Ks1V/cUuGeC5ADmu8JugUvIECxGIQMp5TBkUfxtGhn3wQlr45PAGeRHVSbP5eGNpmcSQzNAC5Qcu8rChxNnw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715701892; c=relaxed/simple; bh=XoA0b3u13bVRZxpHWJ41pkwszN/m5KwjeFNwYKuSfP0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=uQeoYkkPut3rmZMzA9ZgiY2GKwXyhfsqepe0CU1mQ0KuXsvsT1V7HS5M4jmSsdNDtmqQVnXJjI+yrfyYljvkvnundnRJexQNjFloppUxo3KOfsbDdntgyzo9WtHEufGWFfoi0OoMT7FbD7sg8geT4SIGhDjLrip3AoY6STOjKx8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=QHKfaRwJ; arc=none smtp.client-ip=217.70.183.197 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Received: by mail.gandi.net (Postfix) with ESMTPSA id B17E11C0006; Tue, 14 May 2024 15:51:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1715701888; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/q1zVDoqEbRtn4br8zecJV6ThTUPNCtWDfIqMVXyJZQ=; b=QHKfaRwJsSXr4ytLxa3lq+qbaeXezirBmiMbFh9mcu1vWutVz8C52TDQD//FAYAuBrgizA ugbclEjEOS72WV1ibmYdwwCzA+CYpGHuF8AcJoLjO+fZmEQv7dRqRNiHCgK02Uaz+zKJ/9 xxa+8hp0q4E4xLyHi/DFl578dMxg00gqtbOJWX7oeHVku03G/j1Ya+KN8kDRWQtxN+j31Q PGuv+JcVmmkn79ulHyxEX3nXUNaZhT38C4KxCrZfrTjgEQGhRn/okFJouU5rMAzDnm5uRo 8nLGC6Y01vgwp8haTzRIdQEqPBJkIPlnSesB1LSFV2jPCCz/aKDvH/KCcxVobA== From: =?utf-8?q?Alexis_Lothor=C3=A9?= Date: Tue, 14 May 2024 17:51:21 +0200 Subject: [PATCH v2 3/6] wifi: wilc1000: set wilc_set_mac_address parameter as const Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Message-Id: <20240514-mac_addr_at_probe-v2-3-afef09f1cd10@bootlin.com> References: <20240514-mac_addr_at_probe-v2-0-afef09f1cd10@bootlin.com> In-Reply-To: <20240514-mac_addr_at_probe-v2-0-afef09f1cd10@bootlin.com> To: Ajay Singh , Claudiu Beznea , Kalle Valo Cc: Thomas Petazzoni , linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, Heiko Thiery , =?utf-8?q?Alexis_Lothor=C3=A9?= X-Mailer: b4 0.13.0 X-GND-Sasl: alexis.lothore@bootlin.com Any attempt to provide a const mac address to wilc_set_mac_address results in the following warning: warning: passing argument 2 of 'wilc_set_mac_address' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers] [...] drivers/net/wireless/microchip/wilc1000/hif.h:170:52: note: expected 'u8 *' {aka 'unsigned char *'} but argument is of type 'const unsigned char *'a int wilc_set_mac_address(struct wilc_vif *vif, u8 *mac_addr); Instead of using an explicit cast each time we need provide a MAC address, set the function parameter as const Signed-off-by: Alexis Lothoré --- drivers/net/wireless/microchip/wilc1000/hif.c | 4 ++-- drivers/net/wireless/microchip/wilc1000/hif.h | 2 +- drivers/net/wireless/microchip/wilc1000/netdev.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/microchip/wilc1000/hif.c b/drivers/net/wireless/microchip/wilc1000/hif.c index 919de6ffb821..c6892b7e190f 100644 --- a/drivers/net/wireless/microchip/wilc1000/hif.c +++ b/drivers/net/wireless/microchip/wilc1000/hif.c @@ -1293,7 +1293,7 @@ int wilc_get_mac_address(struct wilc_vif *vif, u8 *mac_addr) return result; } -int wilc_set_mac_address(struct wilc_vif *vif, u8 *mac_addr) +int wilc_set_mac_address(struct wilc_vif *vif, const u8 *mac_addr) { struct wid wid; int result; @@ -1301,7 +1301,7 @@ int wilc_set_mac_address(struct wilc_vif *vif, u8 *mac_addr) wid.id = WID_MAC_ADDR; wid.type = WID_STR; wid.size = ETH_ALEN; - wid.val = mac_addr; + wid.val = (u8 *)mac_addr; result = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1); if (result) diff --git a/drivers/net/wireless/microchip/wilc1000/hif.h b/drivers/net/wireless/microchip/wilc1000/hif.h index 0d380586b1d9..96eeaf31d237 100644 --- a/drivers/net/wireless/microchip/wilc1000/hif.h +++ b/drivers/net/wireless/microchip/wilc1000/hif.h @@ -167,7 +167,7 @@ int wilc_add_rx_gtk(struct wilc_vif *vif, const u8 *rx_gtk, u8 gtk_key_len, u8 cipher_mode); int wilc_set_pmkid_info(struct wilc_vif *vif, struct wilc_pmkid_attr *pmkid); int wilc_get_mac_address(struct wilc_vif *vif, u8 *mac_addr); -int wilc_set_mac_address(struct wilc_vif *vif, u8 *mac_addr); +int wilc_set_mac_address(struct wilc_vif *vif, const u8 *mac_addr); int wilc_set_join_req(struct wilc_vif *vif, u8 *bssid, const u8 *ies, size_t ies_len); int wilc_disconnect(struct wilc_vif *vif); diff --git a/drivers/net/wireless/microchip/wilc1000/netdev.c b/drivers/net/wireless/microchip/wilc1000/netdev.c index 166165ee7712..2ee3d9827826 100644 --- a/drivers/net/wireless/microchip/wilc1000/netdev.c +++ b/drivers/net/wireless/microchip/wilc1000/netdev.c @@ -678,7 +678,7 @@ static int wilc_set_mac_addr(struct net_device *dev, void *p) } rcu_read_unlock(); - result = wilc_set_mac_address(vif, (u8 *)addr->sa_data); + result = wilc_set_mac_address(vif, addr->sa_data); if (result) return result; -- 2.44.0