Received: by 2002:a05:6500:1b45:b0:1f5:f2ab:c469 with SMTP id cz5csp493865lqb; Wed, 17 Apr 2024 02:35:21 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWJ6zpsXxMo5y5OGl0kqwAqdm3SrP6K1GRCiVdgu9dOF2T8pLdr1kGJ49hyccXm15hwiRvt+UmLqVByr+oGhmL99a19s/xeg5F7qZ90Qw== X-Google-Smtp-Source: AGHT+IEd9FwZmfLGiG3iLYtYlO4XG3aU9jDy11OowtWtN72LpRgRX5L6HDgG+WtwVEcrt2AYcVKI X-Received: by 2002:a17:90b:1d08:b0:2a2:930c:9a8f with SMTP id on8-20020a17090b1d0800b002a2930c9a8fmr14690985pjb.32.1713346521514; Wed, 17 Apr 2024 02:35:21 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713346521; cv=pass; d=google.com; s=arc-20160816; b=0hD5kj7R0wvGP6oWFl+xL7K6Qjgjig4ZZo9GZEvHUQB8iuSqmMhOEEa+HVdemdu8Zk jDKkGiyNJNFPEdH2l8BAKdm7+4hsz4g+sxn8Udr5d1A6OVj3O59g7Az/pDFf7GUlDUz/ HL5CV46TryY9SE65g7zBKIUyCqBTdK7SBDpf33v7NCd6SUubefU1/lPAV9XKJcl4mGz0 iMg/cydBPcLMMadi0sux+olLrZKpW6Ldjl7HTLjAEXvSt00jzxlP/1iRkqcSKI2L9u3V wfzlZIqv3VLKZ2mQGFQQSmbQ6TllK3dBgVJZGQnFR7Yrvj4RjROQekyiCYakTvxZ+lOT daTw== 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=xSQulcNZ7xVN29GXFAi9C0JHJLd/h7peOYiZQ1EcFoc=; fh=k15yWD4ZltoIGsKlbGcsGeIaHes0BFY8NEK3tQ/9pa0=; b=hfwHTfef2ivH51dalaEaLchwKZ+78ynJ4j8/qQ+4fbwRbjCTT+zmQGmKkbudn163i5 bFmOeTk1A67zAAbmuIQKBUcht/moNp952ScVD9Iqv72Ed1v6BqM+PoFCd72/dIk3/y5t stVh6DrgRb8uDHChUVUZ5y6uLD/SEnwblG1IE02tCeRMnl5xeH0OjE43zALyxkoy7xLJ YQI1MPd3hItBdRXs74+a5mAX8tvEw3G4XtQRXjfcr1GvnwuXzpmHQeHMkYTtm2/xx1C6 hpJjr3yLlk35z4+m+edS6S1KeUL/ADfTXFeE6x0rnLvm58XkaYm1LgkshAVvIY0/KOKZ Al1Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=oOeyh6gm; 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-wireless+bounces-6436-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-6436-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id d7-20020a17090a498700b0029fc4a56910si998323pjh.46.2024.04.17.02.35.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Apr 2024 02:35:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-6436-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=oOeyh6gm; 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-wireless+bounces-6436-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-6436-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 92E6F283F60 for ; Wed, 17 Apr 2024 09:35:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5CC4213BC1B; Wed, 17 Apr 2024 09:34:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="oOeyh6gm" X-Original-To: linux-wireless@vger.kernel.org Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) (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 4B96A133435; Wed, 17 Apr 2024 09:34:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.199 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713346465; cv=none; b=e2vx3GI4mGRR2sQISfrHpmAoW1waWxrBShh9pc+im6Es0XB0VB1oL8dMkf+oy9jSkUKdwLBk0K22oAJzsOLkM/ne4cxrEtnGDV+F3yC3jOyJDPAxD4ywABXv4U/IcLKans2UmrHzgldF6/QIoQpaMvP4aNR3EgDhOEBlhKMflhg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713346465; c=relaxed/simple; bh=TkDdyyxMxMzG8CP5s82byzQpJzc0TZdDk6Z4aLsoXno=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Q2ywWYk+JL5OJ3iPuU/oaHisbA4HqFmLmuij6z44fcr5q0JVHGCQuV3cLA29I6AhTDrNwVokQkLYsK/jNborNEjQGkVbu2z5cgzLpNBZ+E4odmWdFK9L9IzuA0XfV4zs9kVku1zvZ62oRBQsNlvwnytmuHcTFlglrQ+ZtlzTQ8c= 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=oOeyh6gm; arc=none smtp.client-ip=217.70.183.199 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 677CBFF80E; Wed, 17 Apr 2024 09:34:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1713346455; 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=xSQulcNZ7xVN29GXFAi9C0JHJLd/h7peOYiZQ1EcFoc=; b=oOeyh6gm8PC4Mdw5pg5UzxK/HB8J3Wqdr3vDKyNY3hkZgK2fEAfydVCAyils33EF6c7Mef eTjHvzdFqK8YbdYIDvbNFvGmoP5Q0JN+3KgsYn9kOCqEaHnKMTml7//t+Y/UpqG8m53Mim RmH+xRVHCMq+ioXu9eFuR9kH7oSLS7qQdReNpjUUYuAS+lg/qGU2sgDKv+x7v7Vc66vdrq QbpudOOzRZhBCZBhkuHACb8zOTBdl71NjGCot1UzVWlhwgJBiH/BFnEh1k7jbv0cRgZ9wn LhpPb47KxUpoq9+2PkRTZUCFOg+siR6846ux1kT5ryR9L2NqPC5vriYtYf5vmg== From: =?utf-8?q?Alexis_Lothor=C3=A9?= Date: Wed, 17 Apr 2024 11:34:10 +0200 Subject: [PATCH 3/6] wifi: wilc1000: set wilc_set_mac_address parameter as const Precedence: bulk X-Mailing-List: linux-wireless@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: <20240417-mac_addr_at_probe-v1-3-67d6c9b3bc2b@bootlin.com> References: <20240417-mac_addr_at_probe-v1-0-67d6c9b3bc2b@bootlin.com> In-Reply-To: <20240417-mac_addr_at_probe-v1-0-67d6c9b3bc2b@bootlin.com> To: Ajay Singh , Claudiu Beznea , Kalle Valo Cc: Thomas Petazzoni , linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, =?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 acc9b9a64552..5ab448d0b643 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