From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out.smtpout.orange.fr (out-16.smtpout.orange.fr [193.252.22.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D132A1CD3B for ; Sat, 11 May 2024 21:48:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.252.22.16 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715464105; cv=none; b=nAyBYZdY9Ts9VQEQsFwWsXCF0OXY1fzfZLkVAocl0E2XuQvCLJDbJm4ygvRDpxpXL/u4xkUGjbE3oB/k99sV8MM4oL/M67YiHlb05wCEnUv6cMsiI3mWYdNYDriOJGABkoy18dvlhkK7KPqt2D8gM4Sh1QIcycPpPOXG0Dq1UCc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715464105; c=relaxed/simple; bh=XrIw190D2Ru6GLS6Uv81QKXbs3DvnUd1ALwBneTiACw=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=t6mrpSwhk4RIc9UZEEu52QfltFoMrfNFIYWkcYfNjh9biQ/vvbjAACP+BaEhzPRfZUhZStyQ14vxC6Zt2ntD09Yz7aAgeUGwDy1l6AaPOoCPFA1N83Rrbpxv0XbzUkXU19kG2W9eBWp/FvI7iI4FO5Sq7kEUUW8OXOqsc2RMLLQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wanadoo.fr; spf=pass smtp.mailfrom=wanadoo.fr; dkim=pass (2048-bit key) header.d=wanadoo.fr header.i=@wanadoo.fr header.b=QAsXepkg; arc=none smtp.client-ip=193.252.22.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wanadoo.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wanadoo.fr Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=wanadoo.fr header.i=@wanadoo.fr header.b="QAsXepkg" Received: from [192.168.1.37] ([86.243.17.157]) by smtp.orange.fr with ESMTPA id 5uYesvZngeVUY5uYesPRMx; Sat, 11 May 2024 23:47:13 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1715464033; bh=ZhbcaDdA7Fy7VE1PV5H3DrbN6+rvJ8gDiUpw7Uijlp4=; h=Message-ID:Date:MIME-Version:Subject:To:From; b=QAsXepkg/x2QADx7ZZWiLyt/bNOl85WNj+qBeEb/5KgPZj68YGbCAZA6/NzW3d6tZ RZkKaIQ0eNAJTcq30MZXPrOJVr/8hgotpXWB4COZ6xK8VKtUlogTE6DkUi0QJL0w5f vE6gmSMErjIvQitt7Y9cZvy9TFz69xei9PkVTcJRUpBbwL/awlLSAi5c0yM+lqKdK1 rozMHGh+q+ch5L6FVE7HDElK2UVKNgv1tqDoXkDF0ERMI6u6rfV8LsPTsEULV0jVWa pFg7JGviM70axuV7EhXLjwguhttqWN0cvTZyydKzBOJjnq7GiWikZ+yZyNR2okvJce jPklDxE6KitSw== X-ME-Helo: [192.168.1.37] X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sat, 11 May 2024 23:47:13 +0200 X-ME-IP: 86.243.17.157 Message-ID: Date: Sat, 11 May 2024 23:47:08 +0200 Precedence: bulk X-Mailing-List: linux-staging@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/3] lib80211: Handle const struct lib80211_crypto_ops in lib80211 To: Simon Horman Cc: gregkh@linuxfoundation.org, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, johannes@sipsolutions.net, philipp.g.hortmann@gmail.com, tdavies@darkphysics.net, garyrookard@fastmail.org, straube.linux@gmail.com, linux-staging@lists.linux.dev, netdev@vger.kernel.org, linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org References: <20240511203104.GW2347895@kernel.org> Content-Language: en-MW From: Christophe JAILLET In-Reply-To: <20240511203104.GW2347895@kernel.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Le 11/05/2024 à 22:31, Simon Horman a écrit : > On Sat, May 11, 2024 at 06:32:38PM +0200, Christophe JAILLET wrote: >> lib80211_register_crypto_ops() and lib80211_unregister_crypto_ops() don't >> modify their "struct lib80211_crypto_ops *ops" argument. So, it can be >> declared as const. >> >> Doing so, some adjustments are needed to also constify some date in >> "struct lib80211_crypt_data", "struct lib80211_crypto_alg" and the >> return value of lib80211_get_crypto_ops(). >> >> Signed-off-by: Christophe JAILLET >> --- >> Compile tested only. > > Hi Christophe, > > Unfortunately allmodconfig W=1 build on x86_64 with Clang says: > > .../libipw_wx.c:587:6: error: assigning to 'struct lib80211_crypto_ops *' from 'const struct lib80211_crypto_ops *' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers] > 587 | ops = lib80211_get_crypto_ops(alg); > | ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > .../libipw_wx.c:590:7: error: assigning to 'struct lib80211_crypto_ops *' from 'const struct lib80211_crypto_ops *' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers] > 590 | ops = lib80211_get_crypto_ops(alg); > | ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > Hi, I'll dig more tomorrow, but I don't see this error (with gcc), even with W=1. The following part of the patch is here to avoid the exact compilation error that you see. Strange. CJ diff --git a/drivers/staging/rtl8192e/rtllib_wx.c b/drivers/staging/rtl8192e/rtllib_wx.c index fbd4ec824084..c730d921463d 100644 --- a/drivers/staging/rtl8192e/rtllib_wx.c +++ b/drivers/staging/rtl8192e/rtllib_wx.c @@ -474,7 +474,7 @@ int rtllib_wx_set_encode_ext(struct rtllib_device *ieee, int i, idx; int group_key = 0; const char *alg, *module; - struct lib80211_crypto_ops *ops; + const struct lib80211_crypto_ops *ops; struct lib80211_crypt_data **crypt; struct rtllib_security sec = {