Received: by 2002:a05:7412:2a91:b0:fc:a2b0:25d7 with SMTP id u17csp428682rdh; Wed, 14 Feb 2024 00:42:54 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCX2k80ec2NptSYd5aE68pJayS2N/WYgoug/ZqKRgNFETtWB82bXHP6hepZGe6e57+hmGfvIEAveY+XwUptohkgN6JgAacH7TXxljF58Yg== X-Google-Smtp-Source: AGHT+IGzwhAeIGcg9+/LoDHWmLvbvBYrOksNbfgyibzi4/Qs2JLCsUXE3eV6RmU3MrRhmt42asZW X-Received: by 2002:a17:906:ddb:b0:a36:7b45:1304 with SMTP id p27-20020a1709060ddb00b00a367b451304mr1082339eji.77.1707900174616; Wed, 14 Feb 2024 00:42:54 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707900174; cv=pass; d=google.com; s=arc-20160816; b=ikp7Gq5n6gjszcXTQq6XrOW805v+9R5tSywK2lEGP+cdy+M/qjUKj3yWbVyDpwLgXR hBuVfmhlhNIE/0K2Tf0yiWut0Uxub8ZZlpzs5bTmdfy62RdE+aC1z9niwYREANcmYMFa 00rjMrsJxFsXf2UdzymWD/p8+13k0w+lPlMNp9Q4lwTSeAIpd3yGdW3mla9fhKfkAFh3 UTNI44AXRvSPdp6d0uW94w2U0OET/dJTNgZO0/3rdFH4XnkFZKDWEKy++DklDUt3AMeq vx/P94gcpVRgQoI9XsSq85rN+caL+Jax9C7qoEkppCxyKJqSD7JJWKsg4YyLIUzwe0gd Giqw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=Xv66vnT3uWpmwK5vL0oxQ5i9QWjHzZcZ6TRaxRZ78Z8=; fh=DdxO6hMA+J+O10CXD3qdWMe2AF66h6xeA+IJZYNBFfY=; b=R//MtIVKeghl/cNP2sAbpatPN4cxiRDxw9zgCDK9pjYZqAfDBId5gWWkk0GCWtY9uT C94MM2Odf6Bf/1eqbGg0A6/mzELr90LKEqq+kohwyg5TlAYxrNMAQFjNzkfQ/MuPAxfk PdlD8BeR3DMELlShDyIZLdDKgBPdPxvvn0G2j3kEYFgC2HYEDTLHwaFi0k9R43keQJ2B 6tzo7bflpMdssBjW5tgi8Brajyb/OEg5BKzPI9+G6SQtdjCGd6N3u+pcpiuIZWKqID0h YW7wcGs9ZBNlx+KVp9882V4C0dSFmFMGLJH4vFhhdD/p/vgaHZpleI/XioxSPirKqcLM SrzA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=nyvoMJfu; 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-3572-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-wireless+bounces-3572-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com X-Forwarded-Encrypted: i=2; AJvYcCWMSEzmHlufHuwQclB2ZoU2P1mvneg1RvyVY5WJiac0kl0go4LA5hH5GbSquHcrvjmlUVsZrYbHQddQGtwhdPq5yM88BVhWGaOmnl0clw== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id k18-20020a1709067ad200b00a3c9c1befb6si2025234ejo.799.2024.02.14.00.42.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Feb 2024 00:42:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-3572-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=nyvoMJfu; 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-3572-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-wireless+bounces-3572-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 494E01F22877 for ; Wed, 14 Feb 2024 08:42:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8BE3C6119; Wed, 14 Feb 2024 08:42:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="nyvoMJfu" X-Original-To: linux-wireless@vger.kernel.org Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.201]) (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 B3BF66FAD; Wed, 14 Feb 2024 08:42:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707900169; cv=none; b=UDFPAN20D+N4kis9HZYFTywFTd20maMVB8WqyQdQYyM07dwlbj4RhSCQcaZDP5BVSTSJ2ybDSN6C2BEX7OTXk+QSS6JViShi+KquaYuAsxLsFHbakvPhscZQ6dg4aW+zRxXLyTUVBMvBkyFQtQXGS+2rKS66CQJz3Hhkhp1Rd2Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707900169; c=relaxed/simple; bh=cQ7ey7w8wt3lNYqkfFPRTDVyX+jY3R2zNfbWoLshh74=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=WVE0hSXoepzbTRW4Iu8po1rEnomtwzSP7T0+lDq8QvWT+9mIJZjPpPgKvY2IkGomcA0y20CkVKc2rgrrMrQf1gx4hoaKa/+OTAvHJj5KS7yGRZgidKLXV+OWZiH4m04l6sHXG5NSWqqlQ054HhkBaq50u/js8RmJDhnTQ/Rqgcs= 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=nyvoMJfu; arc=none smtp.client-ip=217.70.183.201 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 D87D41BF20E; Wed, 14 Feb 2024 08:42:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1707900164; 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=Xv66vnT3uWpmwK5vL0oxQ5i9QWjHzZcZ6TRaxRZ78Z8=; b=nyvoMJfu+S5UHF57qKJYh+mmIYTAjy13qIWhIMbs7exxtbxZm7Yw0ZKy2gmJAJzcx4PXx7 uM1HIT2ZE5EKdk3DrnFvDCkGPXg6/M4ZzKYlJEuYAuw+DtYiAXJ9/QqHPwzK7qg3Q3EI2m Ma0RhhkK/oN/AUAeX7EleuVVvapcB57bHUXXo+ou6CnL8lmpRlFvQfV+Z3mrKDkiepNRkO cuKPrniyxalFJo1zcRiwPZTJi/AIQi12Gf6pJEXs49OBVPiJNUgCQSVoOrpqap+0FyBk1m I0QqDRksI2XiYGYDPQNE2vt1Vqgl/YYys9A2FRZ/OGVpLPZY90BtJgz6UARVGw== Message-ID: <09eeb7d4-c922-45ee-a1ac-59942153dbce@bootlin.com> Date: Wed, 14 Feb 2024 09:42:43 +0100 Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: drivers/net/wireless/microchip/wilc1000/cfg80211.c:361:42: sparse: sparse: incorrect type in assignment (different base types) To: Kalle Valo , kernel test robot Cc: Ajay Singh , oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org, Johannes Berg References: <202308290615.lUTIgqUl-lkp@intel.com> <877cpev0pn.fsf@kernel.org> <87a5uatfl1.fsf@kernel.org> Content-Language: en-US From: =?UTF-8?Q?Alexis_Lothor=C3=A9?= In-Reply-To: <87a5uatfl1.fsf@kernel.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-GND-Sasl: alexis.lothore@bootlin.com Hello Ajay, Kalle, On 8/29/23 10:31, Kalle Valo wrote: > Kalle Valo writes: > >> kernel test robot writes: [...] >>> sparse warnings: (new ones prefixed by >>) >>>>> drivers/net/wireless/microchip/wilc1000/cfg80211.c:361:42: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int key_mgmt_suite @@ got restricted __be32 [usertype] @@ >>> drivers/net/wireless/microchip/wilc1000/cfg80211.c:361:42: sparse: expected unsigned int key_mgmt_suite >>> drivers/net/wireless/microchip/wilc1000/cfg80211.c:361:42: sparse: got restricted __be32 [usertype] >> >> Yeah, this is an old issue but we really should try to fix this, >> especially so as I would like to make wireless code sparse warning free >> in the near future. IIRC there were some problems with nl80211 interface >> as well so this might not be simple fix still. > > For reference here's the old discussion: > > https://patchwork.kernel.org/project/linux-wireless/patch/20220720160302.231516-1-ajay.kathat@microchip.com/ > > Any volunteers to help fix this? I would prefers fixes for issues like > this compared to questionable random cleanups we always get. I'm bumping this old thread because it looks like the sparse warning is still present in WILC driver, and I would gladly help getting rid of it, but since there's already been a fair amount of discussions around it, I am not sure what is expected/what should be done. Here is my understanding so far: - Ajay has proposed a patch ([1]) which indeed fixes the warning but involves many casts - Johannes and Jouni then gave details about the original issue leading to those casts ([2]): wpa_supplicant somehow forces the AKM suites values to be be32 at some point, while it should be treated in host endianness - as pointed by Ajay, the corresponding fix has been made since then by Jouni in wpa_supplicant ([3]). The fix make sure to handle key_mgmt_suite in host endianness AND to keep compatibility with current drivers having the be32 fix. - - It could have allowed to simply get rid of the all casts on AKM suites in wilc driver ([4]), but then new kernel/drivers would break with existing userspace, so it is not an option Now, I see multiple options to fix the sparse warning: - apply the same fix as for wpa_supplicant ([3]) in wilc driver (so basically, become compatible with both endianness) - apply the same fix as for wpa_supplicant ([3]), not in wilc but in nl80211 (may need to update not only wilc but any driver having trailing be32 cast on AKM suites) - take the initial quick but not-so-nice double cast fix and call it a day What's your opinion on this ? [1] https://lore.kernel.org/linux-wireless/20220720160302.231516-1-ajay.kathat@microchip.com/ [2] https://lore.kernel.org/linux-wireless/e677e3cd1b5c34146017a65f28fabdb673a91d23.camel@sipsolutions.net/ [3] https://w1.fi/cgit/hostap/commit/?id=8392ea9e75eacf30cb09671e463d9a37c3eadd6a [4] https://lore.kernel.org/linux-wireless/20230830042300.87184-1-ajay.kathat@microchip.com/ -- Alexis Lothoré, Bootlin Embedded Linux and Kernel engineering https://bootlin.com