public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel•org>
To: Yassine Oudjana <y.oudjana@protonmail•com>
Cc: "Konrad Dybcio" <konrad.dybcio@oss•qualcomm.com>,
	"Jonathan Cameron" <jic23@kernel•org>,
	"Lars-Peter Clausen" <lars@metafoo•de>,
	"Bjorn Andersson" <andersson@kernel•org>,
	"Konrad Dybcio" <konradybcio@kernel•org>,
	"Manivannan Sadhasivam" <manivannan.sadhasivam@linaro•org>,
	"David S. Miller" <davem@davemloft•net>,
	"Eric Dumazet" <edumazet@google•com>,
	"Jakub Kicinski" <kuba@kernel•org>,
	"Paolo Abeni" <pabeni@redhat•com>,
	"Masahiro Yamada" <masahiroy@kernel•org>,
	"Nathan Chancellor" <nathan@kernel•org>,
	"Nicolas Schier" <nicolas.schier@linux•dev>,
	"Alexander Sverdlin" <alexander.sverdlin@gmail•com>,
	"Sean Nyekjaer" <sean@geanix•com>,
	"Javier Carrasco" <javier.carrasco.cruz@gmail•com>,
	"Matti Vaittinen" <mazziesaccount@gmail•com>,
	"Antoniu Miclaus" <antoniu.miclaus@analog•com>,
	"Ramona Gradinariu" <ramona.gradinariu@analog•com>,
	"Yo-Jung (Leo) Lin" <0xff07@gmail•com>,
	"Andy Shevchenko" <andriy.shevchenko@linux•intel.com>,
	"Neil Armstrong" <neil.armstrong@linaro•org>,
	"Barnabás Czémán" <barnabas.czeman@mainlining•org>,
	"Danila Tikhonov" <danila@jiaxyga•com>,
	"Antoni Pokusinski" <apokusinski01@gmail•com>,
	"Vasileios Amoiridis" <vassilisamir@gmail•com>,
	"Petar Stoykov" <pd.pstoykov@gmail•com>,
	"shuaijie wang" <wangshuaijie@awinic•com>,
	"Yasin Lee" <yasin.lee.x@gmail•com>,
	"Borislav Petkov (AMD)" <bp@alien8•de>,
	"Dave Hansen" <dave.hansen@linux•intel.com>,
	"Tony Luck" <tony.luck@intel•com>,
	"Pawan Gupta" <pawan.kumar.gupta@linux•intel.com>,
	"Ingo Molnar" <mingo@kernel•org>,
	"Yassine Oudjana" <yassine.oudjana@gmail•com>,
	linux-kernel@vger•kernel.org, linux-iio@vger•kernel.org,
	linux-arm-msm@vger•kernel.org, netdev@vger•kernel.org,
	linux-kbuild@vger•kernel.org
Subject: Re: [PATCH 2/3] net: qrtr: Define macro to convert QMI version and instance to QRTR instance
Date: Mon, 7 Jul 2025 18:06:36 +0100	[thread overview]
Message-ID: <20250707170636.GR89747@horms.kernel.org> (raw)
In-Reply-To: <aMbAZigHiAN2xupOYs9DodY2mOdNtw_oVjOaweflgA8IoXRQ5ctoZ8GYJ8PNAKDgL4f9N_UD7tFmkePUy9BCE8v20Mae2x-eL1ZpyJEdLZY=@protonmail.com>

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@oss•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?

> 
> In file included from ../arch/arm64/include/asm/sysreg.h:1108,
>                  from ../arch/arm64/include/asm/memory.h:223,
>                  from ../arch/arm64/include/asm/pgtable-prot.h:8,
>                  from ../arch/arm64/include/asm/sparsemem.h:8,
>                  from ../include/linux/numa.h:23,
>                  from ../include/linux/cpumask.h:17,
>                  from ../include/linux/smp.h:13,
>                  from ../include/linux/lockdep.h:14,
>                  from ../include/linux/mutex.h:17,
>                  from ../include/linux/kernfs.h:11,
>                  from ../include/linux/sysfs.h:16,
>                  from ../include/linux/iio/buffer.h:9,
>                  from ../drivers/iio/common/qcom_smgr/qcom_smgr.c:8:
> ../include/linux/bitfield.h:114:9: error: braced-group within expression allowed only inside a function
>   114 |         ({                                                              \
>       |         ^
> ../include/linux/soc/qcom/qrtr.h:21:10: note: in expansion of macro 'FIELD_PREP'
>    21 |         (FIELD_PREP(GENMASK(7, 0), qmi_version) | FIELD_PREP(GENMASK(15, 8), qmi_instance))
>       |          ^~~~~~~~~~
> ../drivers/iio/common/qcom_smgr/qcom_smgr.c:825:29: note: in expansion of macro 'QRTR_INSTANCE'
>   825 |                 .instance = QRTR_INSTANCE(SNS_SMGR_QMI_SVC_V1,
>       |                             ^~~~~~~~~~~~~

...

  reply	other threads:[~2025-07-07 17:06 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-06 14:07 [PATCH 0/3] QRTR bus and Qualcomm Sensor Manager IIO drivers Yassine Oudjana
2025-04-06 14:07 ` [PATCH 1/3] net: qrtr: Turn QRTR into a bus Yassine Oudjana
2025-04-06 16:01   ` Jonathan Cameron
2025-04-10 12:10     ` Yassine Oudjana
2025-04-12 10:58       ` Jonathan Cameron
2025-04-10 12:44     ` Yassine Oudjana
2025-04-12 10:59       ` Jonathan Cameron
2025-06-25 22:20     ` Yassine Oudjana
2025-04-06 14:07 ` [PATCH 2/3] net: qrtr: Define macro to convert QMI version and instance to QRTR instance Yassine Oudjana
2025-04-09 14:54   ` Konrad Dybcio
2025-07-05 18:29     ` Yassine Oudjana
2025-07-07 17:06       ` Simon Horman [this message]
2025-07-09  7:44         ` Yassine Oudjana
2025-07-09 11:52           ` Simon Horman
2025-04-06 14:08 ` [PATCH 3/3] iio: Add Qualcomm Sensor Manager drivers Yassine Oudjana
2025-04-06 16:29   ` Jonathan Cameron
2025-04-10 12:31     ` Yassine Oudjana
2025-04-12 11:21       ` Jonathan Cameron
2025-06-18 19:19   ` Luca Weiss
2025-06-25 17:09     ` Yassine Oudjana
2025-04-08 10:27 ` [PATCH 0/3] QRTR bus and Qualcomm Sensor Manager IIO drivers Luca Weiss

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250707170636.GR89747@horms.kernel.org \
    --to=horms@kernel$(echo .)org \
    --cc=0xff07@gmail$(echo .)com \
    --cc=alexander.sverdlin@gmail$(echo .)com \
    --cc=andersson@kernel$(echo .)org \
    --cc=andriy.shevchenko@linux$(echo .)intel.com \
    --cc=antoniu.miclaus@analog$(echo .)com \
    --cc=apokusinski01@gmail$(echo .)com \
    --cc=barnabas.czeman@mainlining$(echo .)org \
    --cc=bp@alien8$(echo .)de \
    --cc=danila@jiaxyga$(echo .)com \
    --cc=dave.hansen@linux$(echo .)intel.com \
    --cc=davem@davemloft$(echo .)net \
    --cc=edumazet@google$(echo .)com \
    --cc=javier.carrasco.cruz@gmail$(echo .)com \
    --cc=jic23@kernel$(echo .)org \
    --cc=konrad.dybcio@oss$(echo .)qualcomm.com \
    --cc=konradybcio@kernel$(echo .)org \
    --cc=kuba@kernel$(echo .)org \
    --cc=lars@metafoo$(echo .)de \
    --cc=linux-arm-msm@vger$(echo .)kernel.org \
    --cc=linux-iio@vger$(echo .)kernel.org \
    --cc=linux-kbuild@vger$(echo .)kernel.org \
    --cc=linux-kernel@vger$(echo .)kernel.org \
    --cc=manivannan.sadhasivam@linaro$(echo .)org \
    --cc=masahiroy@kernel$(echo .)org \
    --cc=mazziesaccount@gmail$(echo .)com \
    --cc=mingo@kernel$(echo .)org \
    --cc=nathan@kernel$(echo .)org \
    --cc=neil.armstrong@linaro$(echo .)org \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=nicolas.schier@linux$(echo .)dev \
    --cc=pabeni@redhat$(echo .)com \
    --cc=pawan.kumar.gupta@linux$(echo .)intel.com \
    --cc=pd.pstoykov@gmail$(echo .)com \
    --cc=ramona.gradinariu@analog$(echo .)com \
    --cc=sean@geanix$(echo .)com \
    --cc=tony.luck@intel$(echo .)com \
    --cc=vassilisamir@gmail$(echo .)com \
    --cc=wangshuaijie@awinic$(echo .)com \
    --cc=y.oudjana@protonmail$(echo .)com \
    --cc=yasin.lee.x@gmail$(echo .)com \
    --cc=yassine.oudjana@gmail$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox