lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250709115228.GY452973@horms.kernel.org>
Date: Wed, 9 Jul 2025 12:52:28 +0100
From: Simon Horman <horms@...nel.org>
To: Yassine Oudjana <y.oudjana@...tonmail.com>
Cc: Konrad Dybcio <konrad.dybcio@....qualcomm.com>,
	Jonathan Cameron <jic23@...nel.org>,
	Lars-Peter Clausen <lars@...afoo.de>,
	Bjorn Andersson <andersson@...nel.org>,
	Konrad Dybcio <konradybcio@...nel.org>,
	Manivannan Sadhasivam <manivannan.sadhasivam@...aro.org>,
	"David S. Miller" <davem@...emloft.net>,
	Eric Dumazet <edumazet@...gle.com>,
	Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
	Masahiro Yamada <masahiroy@...nel.org>,
	Nathan Chancellor <nathan@...nel.org>,
	Nicolas Schier <nicolas.schier@...ux.dev>,
	Alexander Sverdlin <alexander.sverdlin@...il.com>,
	Sean Nyekjaer <sean@...nix.com>,
	Javier Carrasco <javier.carrasco.cruz@...il.com>,
	Matti Vaittinen <mazziesaccount@...il.com>,
	Antoniu Miclaus <antoniu.miclaus@...log.com>,
	Ramona Gradinariu <ramona.gradinariu@...log.com>,
	"Yo-Jung (Leo) Lin" <0xff07@...il.com>,
	Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
	Neil Armstrong <neil.armstrong@...aro.org>,
	Barnabás Czémán <barnabas.czeman@...nlining.org>,
	Danila Tikhonov <danila@...xyga.com>,
	Antoni Pokusinski <apokusinski01@...il.com>,
	Vasileios Amoiridis <vassilisamir@...il.com>,
	Petar Stoykov <pd.pstoykov@...il.com>,
	shuaijie wang <wangshuaijie@...nic.com>,
	Yasin Lee <yasin.lee.x@...il.com>,
	"Borislav Petkov (AMD)" <bp@...en8.de>,
	Dave Hansen <dave.hansen@...ux.intel.com>,
	Tony Luck <tony.luck@...el.com>,
	Pawan Gupta <pawan.kumar.gupta@...ux.intel.com>,
	Ingo Molnar <mingo@...nel.org>,
	Yassine Oudjana <yassine.oudjana@...il.com>,
	linux-kernel@...r.kernel.org, linux-iio@...r.kernel.org,
	linux-arm-msm@...r.kernel.org, netdev@...r.kernel.org,
	linux-kbuild@...r.kernel.org
Subject: Re: [PATCH 2/3] net: qrtr: Define macro to convert QMI version and
 instance to QRTR instance

On Wed, Jul 09, 2025 at 07:44:49AM +0000, Yassine Oudjana wrote:
> 
> 
> 
> 
> 
> Sent with Proton Mail secure email.
> 
> On Monday, July 7th, 2025 at 6:06 PM, Simon Horman <horms@...nel.org> wrote:
> 
> > On Sat, Jul 05, 2025 at 06:29:39PM +0000, Yassine Oudjana wrote:
> > 
> > > On Wednesday, April 9th, 2025 at 3:54 PM, Konrad Dybcio konrad.dybcio@....qualcomm.com wrote:
> > > 
> > > > On 4/6/25 4:07 PM, Yassine Oudjana wrote:
> > 
> > 
> > ...
> > 
> > > > > diff --git a/include/linux/soc/qcom/qrtr.h b/include/linux/soc/qcom/qrtr.h
> > > > > index 4d7f25c64c56..10c89a35cbb9 100644
> > > > > --- a/include/linux/soc/qcom/qrtr.h
> > > > > +++ b/include/linux/soc/qcom/qrtr.h
> > > > > @@ -13,6 +13,8 @@ struct qrtr_device {
> > > > > 
> > > > > #define to_qrtr_device(d) container_of(d, struct qrtr_device, dev)
> > > > > 
> > > > > +#define QRTR_INSTANCE(qmi_version, qmi_instance) (qmi_version | qmi_instance << 8)
> > > > 
> > > > Please use FIELD_PREP + GENMASK to avoid potential overflows
> > > > 
> > > > Konrad
> > > 
> > > Since I'm using this macro in initializing QRTR match tables I am unable to use
> > > FIELD_PREP. When I do, I get such errors:
> > 
> > 
> > Does using FIELD_PREP_CONST, say in a QRTR_INSTANCE_CONST variant, help?
> 
> That works, but do we want to have two variants? Or in this case maybe
> I should leave qmi_interface.c untouched and define the macro only for use
> in match tables?

FWIIW, my order of preference would be:

1. Two variants, declared next to each other
2. One variant (using FIELD_PREP_CONST)
3. Leave qmi_interface.c untouched

...

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ