diff mbox series

[1/5,v3] iio: st_sensors: Create extended attr macro

Message ID 20210518230722.522446-1-linus.walleij@linaro.org (mailing list archive)
State Accepted
Headers show
Series [1/5,v3] iio: st_sensors: Create extended attr macro | expand

Commit Message

Linus Walleij May 18, 2021, 11:07 p.m. UTC
Extend ST_SENSORS_LSM_CHANNELS() to a version that will accept extended
attributes named ST_SENSORS_LSM_CHANNELS_EXT() and wrap the former as a
specialized version of the former.

Cc: Hans de Goede <hdegoede@redhat.com>
Cc: Denis Ciocca <denis.ciocca@st.com>
Cc: Daniel Drake <drake@endlessm.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
ChangeLog v2->v3:
- Rebase and resend.
ChangeLog v1->v2:
- New helper patch from Stephan.
---
 include/linux/iio/common/st_sensors.h | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

Comments

Hans de Goede May 19, 2021, 1:17 p.m. UTC | #1
Hi,

On 5/19/21 1:07 AM, Linus Walleij wrote:
> Extend ST_SENSORS_LSM_CHANNELS() to a version that will accept extended
> attributes named ST_SENSORS_LSM_CHANNELS_EXT() and wrap the former as a
> specialized version of the former.
> 
> Cc: Hans de Goede <hdegoede@redhat.com>
> Cc: Denis Ciocca <denis.ciocca@st.com>
> Cc: Daniel Drake <drake@endlessm.com>
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

Thanks.

The entire series looks good to me:

Reviewed-by: Hans de Goede <hdegoede@redhat.com>

for the series.

Regards,

Hans


> ---
> ChangeLog v2->v3:
> - Rebase and resend.
> ChangeLog v1->v2:
> - New helper patch from Stephan.
> ---
>  include/linux/iio/common/st_sensors.h | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/include/linux/iio/common/st_sensors.h b/include/linux/iio/common/st_sensors.h
> index 0b9aeb479f48..8e0d76b42db9 100644
> --- a/include/linux/iio/common/st_sensors.h
> +++ b/include/linux/iio/common/st_sensors.h
> @@ -48,8 +48,8 @@
>  #define ST_SENSORS_MAX_NAME			17
>  #define ST_SENSORS_MAX_4WAI			8
>  
> -#define ST_SENSORS_LSM_CHANNELS(device_type, mask, index, mod, \
> -					ch2, s, endian, rbits, sbits, addr) \
> +#define ST_SENSORS_LSM_CHANNELS_EXT(device_type, mask, index, mod, \
> +				    ch2, s, endian, rbits, sbits, addr, ext) \
>  { \
>  	.type = device_type, \
>  	.modified = mod, \
> @@ -65,8 +65,14 @@
>  		.storagebits = sbits, \
>  		.endianness = endian, \
>  	}, \
> +	.ext_info = ext, \
>  }
>  
> +#define ST_SENSORS_LSM_CHANNELS(device_type, mask, index, mod, \
> +				ch2, s, endian, rbits, sbits, addr)	\
> +	ST_SENSORS_LSM_CHANNELS_EXT(device_type, mask, index, mod,	\
> +				    ch2, s, endian, rbits, sbits, addr, NULL)
> +
>  #define ST_SENSORS_DEV_ATTR_SAMP_FREQ_AVAIL() \
>  		IIO_DEV_ATTR_SAMP_FREQ_AVAIL( \
>  			st_sensors_sysfs_sampling_frequency_avail)
>
Jonathan Cameron May 22, 2021, 6:15 p.m. UTC | #2
On Wed, 19 May 2021 15:17:36 +0200
Hans de Goede <hdegoede@redhat.com> wrote:

> Hi,
> 
> On 5/19/21 1:07 AM, Linus Walleij wrote:
> > Extend ST_SENSORS_LSM_CHANNELS() to a version that will accept extended
> > attributes named ST_SENSORS_LSM_CHANNELS_EXT() and wrap the former as a
> > specialized version of the former.
> > 
> > Cc: Hans de Goede <hdegoede@redhat.com>
> > Cc: Denis Ciocca <denis.ciocca@st.com>
> > Cc: Daniel Drake <drake@endlessm.com>
> > Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
> > Signed-off-by: Linus Walleij <linus.walleij@linaro.org>  
> 
> Thanks.
> 
> The entire series looks good to me:
> 
> Reviewed-by: Hans de Goede <hdegoede@redhat.com>

@Linus, for IIO stuff, please put a cover letter on series as it makes it
easier for people to reply with things like this and still let me use b4
without manual tweaking.

Anyhow, manually tweaked series applied to the togreg branch of iio.git and
pushed out as testing for the autobuilders to poke at it and see what they
find.

Thanks,

Jonathan


> 
> for the series.
> 
> Regards,
> 
> Hans
> 
> 
> > ---
> > ChangeLog v2->v3:
> > - Rebase and resend.
> > ChangeLog v1->v2:
> > - New helper patch from Stephan.
> > ---
> >  include/linux/iio/common/st_sensors.h | 10 ++++++++--
> >  1 file changed, 8 insertions(+), 2 deletions(-)
> > 
> > diff --git a/include/linux/iio/common/st_sensors.h b/include/linux/iio/common/st_sensors.h
> > index 0b9aeb479f48..8e0d76b42db9 100644
> > --- a/include/linux/iio/common/st_sensors.h
> > +++ b/include/linux/iio/common/st_sensors.h
> > @@ -48,8 +48,8 @@
> >  #define ST_SENSORS_MAX_NAME			17
> >  #define ST_SENSORS_MAX_4WAI			8
> >  
> > -#define ST_SENSORS_LSM_CHANNELS(device_type, mask, index, mod, \
> > -					ch2, s, endian, rbits, sbits, addr) \
> > +#define ST_SENSORS_LSM_CHANNELS_EXT(device_type, mask, index, mod, \
> > +				    ch2, s, endian, rbits, sbits, addr, ext) \
> >  { \
> >  	.type = device_type, \
> >  	.modified = mod, \
> > @@ -65,8 +65,14 @@
> >  		.storagebits = sbits, \
> >  		.endianness = endian, \
> >  	}, \
> > +	.ext_info = ext, \
> >  }
> >  
> > +#define ST_SENSORS_LSM_CHANNELS(device_type, mask, index, mod, \
> > +				ch2, s, endian, rbits, sbits, addr)	\
> > +	ST_SENSORS_LSM_CHANNELS_EXT(device_type, mask, index, mod,	\
> > +				    ch2, s, endian, rbits, sbits, addr, NULL)
> > +
> >  #define ST_SENSORS_DEV_ATTR_SAMP_FREQ_AVAIL() \
> >  		IIO_DEV_ATTR_SAMP_FREQ_AVAIL( \
> >  			st_sensors_sysfs_sampling_frequency_avail)
> >   
>
Linus Walleij May 24, 2021, 9:43 a.m. UTC | #3
On Sat, May 22, 2021 at 8:14 PM Jonathan Cameron <jic23@kernel.org> wrote:

> @Linus, for IIO stuff, please put a cover letter on series as it makes it
> easier for people to reply with things like this

OK sorry about that, I'll try to keep it in mind.

> and still let me use b4
> without manual tweaking.

b4 only need the patches to be sent in a thread which I
actually did, at least this works fine for me from here:

tmp]$ b4 am -t 20210518230722.522446-1-linus.walleij@linaro.org
Looking up https://lore.kernel.org/r/20210518230722.522446-1-linus.walleij%40linaro.org
Grabbing thread from lore.kernel.org/linux-iio
Analyzing 7 messages in the thread
---
Writing ./v3_20210519_linus_walleij_iio_st_sensors_create_extended_attr_macro.mbx
  ✓ [PATCH 1/5 v3] iio: st_sensors: Create extended attr macro
    + Reviewed-by: Hans de Goede <hdegoede@redhat.com> (✓ DKIM/redhat.com)
  ✓ [PATCH 2/5 v3] iio: accel: st_sensors: Support generic mounting matrix
  ✓ [PATCH 3/5 v3] iio: accel: st_sensors: Stop copying channels
  ✓ [PATCH 4/5 v3] iio: magnetometer: st_magn: Support mount matrix
  ✓ [PATCH 5/5 v3] iio: gyro: st_gyro: Support mount matrix
  ---
  ✓ Attestation-by: DKIM/linaro.org (From: linus.walleij@linaro.org)
---
Total patches: 5
---
 Link: https://lore.kernel.org/r/20210518230722.522446-1-linus.walleij@linaro.org
 Base: not found
       git am ./v3_20210519_linus_walleij_iio_st_sensors_create_extended_attr_macro.mbx

But I guess that without a 00/nn it is maybe not as clear if a series was
sent as a thread.

Yours,
Linus Walleij
Jonathan Cameron May 24, 2021, 9:50 a.m. UTC | #4
On Mon, 24 May 2021 11:43:11 +0200
Linus Walleij <linus.walleij@linaro.org> wrote:

> On Sat, May 22, 2021 at 8:14 PM Jonathan Cameron <jic23@kernel.org> wrote:
> 
> > @Linus, for IIO stuff, please put a cover letter on series as it makes it
> > easier for people to reply with things like this  
> 
> OK sorry about that, I'll try to keep it in mind.
> 
> > and still let me use b4
> > without manual tweaking.  
> 
> b4 only need the patches to be sent in a thread which I
> actually did, at least this works fine for me from here:
> 
> tmp]$ b4 am -t 20210518230722.522446-1-linus.walleij@linaro.org
> Looking up https://lore.kernel.org/r/20210518230722.522446-1-linus.walleij%40linaro.org
> Grabbing thread from lore.kernel.org/linux-iio
> Analyzing 7 messages in the thread
> ---
> Writing ./v3_20210519_linus_walleij_iio_st_sensors_create_extended_attr_macro.mbx
>   ✓ [PATCH 1/5 v3] iio: st_sensors: Create extended attr macro
>     + Reviewed-by: Hans de Goede <hdegoede@redhat.com> (✓ DKIM/redhat.com)
>   ✓ [PATCH 2/5 v3] iio: accel: st_sensors: Support generic mounting matrix
>   ✓ [PATCH 3/5 v3] iio: accel: st_sensors: Stop copying channels
>   ✓ [PATCH 4/5 v3] iio: magnetometer: st_magn: Support mount matrix
>   ✓ [PATCH 5/5 v3] iio: gyro: st_gyro: Support mount matrix

That only adds the Reviewed-by for patch 1 which was not Hans'
intention.  If the reply was to a cover letter it would apply to all of the patches.

Thanks,

Jonathan


>   ---
>   ✓ Attestation-by: DKIM/linaro.org (From: linus.walleij@linaro.org)
> ---
> Total patches: 5
> ---
>  Link: https://lore.kernel.org/r/20210518230722.522446-1-linus.walleij@linaro.org
>  Base: not found
>        git am ./v3_20210519_linus_walleij_iio_st_sensors_create_extended_attr_macro.mbx
> 
> But I guess that without a 00/nn it is maybe not as clear if a series was
> sent as a thread.
> 
> Yours,
> Linus Walleij
Andy Shevchenko May 24, 2021, 10:37 a.m. UTC | #5
On Mon, May 24, 2021 at 10:50:42AM +0100, Jonathan Cameron wrote:
> On Mon, 24 May 2021 11:43:11 +0200
> Linus Walleij <linus.walleij@linaro.org> wrote:
> 
> > On Sat, May 22, 2021 at 8:14 PM Jonathan Cameron <jic23@kernel.org> wrote:
> > 
> > > @Linus, for IIO stuff, please put a cover letter on series as it makes it
> > > easier for people to reply with things like this  
> > 
> > OK sorry about that, I'll try to keep it in mind.
> > 
> > > and still let me use b4
> > > without manual tweaking.  
> > 
> > b4 only need the patches to be sent in a thread which I
> > actually did, at least this works fine for me from here:
> > 
> > tmp]$ b4 am -t 20210518230722.522446-1-linus.walleij@linaro.org
> > Looking up https://lore.kernel.org/r/20210518230722.522446-1-linus.walleij%40linaro.org
> > Grabbing thread from lore.kernel.org/linux-iio
> > Analyzing 7 messages in the thread
> > ---
> > Writing ./v3_20210519_linus_walleij_iio_st_sensors_create_extended_attr_macro.mbx
> >   ✓ [PATCH 1/5 v3] iio: st_sensors: Create extended attr macro
> >     + Reviewed-by: Hans de Goede <hdegoede@redhat.com> (✓ DKIM/redhat.com)
> >   ✓ [PATCH 2/5 v3] iio: accel: st_sensors: Support generic mounting matrix
> >   ✓ [PATCH 3/5 v3] iio: accel: st_sensors: Stop copying channels
> >   ✓ [PATCH 4/5 v3] iio: magnetometer: st_magn: Support mount matrix
> >   ✓ [PATCH 5/5 v3] iio: gyro: st_gyro: Support mount matrix
> 
> That only adds the Reviewed-by for patch 1 which was not Hans'
> intention.  If the reply was to a cover letter it would apply to all of the patches.

It's easy to fix with `git filter-branch --msg-filter ...`.
Andy Shevchenko May 24, 2021, 10:39 a.m. UTC | #6
On Mon, May 24, 2021 at 01:37:52PM +0300, Andy Shevchenko wrote:
> On Mon, May 24, 2021 at 10:50:42AM +0100, Jonathan Cameron wrote:
> > On Mon, 24 May 2021 11:43:11 +0200
> > Linus Walleij <linus.walleij@linaro.org> wrote:
> > 
> > > On Sat, May 22, 2021 at 8:14 PM Jonathan Cameron <jic23@kernel.org> wrote:
> > > 
> > > > @Linus, for IIO stuff, please put a cover letter on series as it makes it
> > > > easier for people to reply with things like this  
> > > 
> > > OK sorry about that, I'll try to keep it in mind.
> > > 
> > > > and still let me use b4
> > > > without manual tweaking.  
> > > 
> > > b4 only need the patches to be sent in a thread which I
> > > actually did, at least this works fine for me from here:
> > > 
> > > tmp]$ b4 am -t 20210518230722.522446-1-linus.walleij@linaro.org
> > > Looking up https://lore.kernel.org/r/20210518230722.522446-1-linus.walleij%40linaro.org
> > > Grabbing thread from lore.kernel.org/linux-iio
> > > Analyzing 7 messages in the thread
> > > ---
> > > Writing ./v3_20210519_linus_walleij_iio_st_sensors_create_extended_attr_macro.mbx
> > >   ✓ [PATCH 1/5 v3] iio: st_sensors: Create extended attr macro
> > >     + Reviewed-by: Hans de Goede <hdegoede@redhat.com> (✓ DKIM/redhat.com)
> > >   ✓ [PATCH 2/5 v3] iio: accel: st_sensors: Support generic mounting matrix
> > >   ✓ [PATCH 3/5 v3] iio: accel: st_sensors: Stop copying channels
> > >   ✓ [PATCH 4/5 v3] iio: magnetometer: st_magn: Support mount matrix
> > >   ✓ [PATCH 5/5 v3] iio: gyro: st_gyro: Support mount matrix
> > 
> > That only adds the Reviewed-by for patch 1 which was not Hans'
> > intention.  If the reply was to a cover letter it would apply to all of the patches.
> 
> It's easy to fix with `git filter-branch --msg-filter ...`.

But OTOH, tools may not recognize a human intention well from the natural
language, it's also recommended to the reviewers to be explicit that bots can
handle it (here: add a tag per each patch that is considered to be tagged).
Linus Walleij May 24, 2021, 12:07 p.m. UTC | #7
On Mon, May 24, 2021 at 11:52 AM Jonathan Cameron
<Jonathan.Cameron@huawei.com> wrote:

> That only adds the Reviewed-by for patch 1 which was not Hans'
> intention.  If the reply was to a cover letter it would apply to all of the patches.

Aha I see, yeah that makes a lot of sense.
I'll try to put cover letters on my series!

Yours,
Linus Walleij
diff mbox series

Patch

diff --git a/include/linux/iio/common/st_sensors.h b/include/linux/iio/common/st_sensors.h
index 0b9aeb479f48..8e0d76b42db9 100644
--- a/include/linux/iio/common/st_sensors.h
+++ b/include/linux/iio/common/st_sensors.h
@@ -48,8 +48,8 @@ 
 #define ST_SENSORS_MAX_NAME			17
 #define ST_SENSORS_MAX_4WAI			8
 
-#define ST_SENSORS_LSM_CHANNELS(device_type, mask, index, mod, \
-					ch2, s, endian, rbits, sbits, addr) \
+#define ST_SENSORS_LSM_CHANNELS_EXT(device_type, mask, index, mod, \
+				    ch2, s, endian, rbits, sbits, addr, ext) \
 { \
 	.type = device_type, \
 	.modified = mod, \
@@ -65,8 +65,14 @@ 
 		.storagebits = sbits, \
 		.endianness = endian, \
 	}, \
+	.ext_info = ext, \
 }
 
+#define ST_SENSORS_LSM_CHANNELS(device_type, mask, index, mod, \
+				ch2, s, endian, rbits, sbits, addr)	\
+	ST_SENSORS_LSM_CHANNELS_EXT(device_type, mask, index, mod,	\
+				    ch2, s, endian, rbits, sbits, addr, NULL)
+
 #define ST_SENSORS_DEV_ATTR_SAMP_FREQ_AVAIL() \
 		IIO_DEV_ATTR_SAMP_FREQ_AVAIL( \
 			st_sensors_sysfs_sampling_frequency_avail)