2024-02-21 13:17:52

by Nuno Sá

[permalink] [raw]
Subject: Re: [PATCH v5 4/5] iio: amplifiers: hmc425a: use pointers in match table

On Tue, 2024-02-20 at 17:34 +0200, Dumitru Ceclan wrote:
> Change the match table to use pointers instead of device ids.
> Remove type from state as it is not used anymore.
>
> Signed-off-by: Dumitru Ceclan <[email protected]>
> ---

One comment (Jonathan might be able to address that while applying)... With that:

Reviewed-by: Nuno Sa <[email protected]>

>  drivers/iio/amplifiers/hmc425a.c | 29 +++++++++++++++--------------
>  1 file changed, 15 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/iio/amplifiers/hmc425a.c b/drivers/iio/amplifiers/hmc425a.c
> index 13e018a59637..77872e2dfdfe 100644
> --- a/drivers/iio/amplifiers/hmc425a.c
> +++ b/drivers/iio/amplifiers/hmc425a.c
> @@ -41,15 +41,14 @@ struct hmc425a_chip_info {
>  
>  struct hmc425a_state {
>   struct mutex lock; /* protect sensor state */
> - struct hmc425a_chip_info *chip_info;
> + const struct hmc425a_chip_info *chip_info;

Since you're doing this, I believe you should also constify hmc425a_chip_info_tbl[]
and mention it in the commit message.

- Nuno Sá



2024-02-24 17:51:35

by Jonathan Cameron

[permalink] [raw]
Subject: Re: [PATCH v5 4/5] iio: amplifiers: hmc425a: use pointers in match table

On Wed, 21 Feb 2024 14:17:22 +0100
Nuno Sá <[email protected]> wrote:

> On Tue, 2024-02-20 at 17:34 +0200, Dumitru Ceclan wrote:
> > Change the match table to use pointers instead of device ids.
> > Remove type from state as it is not used anymore.
> >
> > Signed-off-by: Dumitru Ceclan <[email protected]>
> > ---
>
> One comment (Jonathan might be able to address that while applying)... With that:
>
> Reviewed-by: Nuno Sa <[email protected]>
>
> >  drivers/iio/amplifiers/hmc425a.c | 29 +++++++++++++++--------------
> >  1 file changed, 15 insertions(+), 14 deletions(-)
> >
> > diff --git a/drivers/iio/amplifiers/hmc425a.c b/drivers/iio/amplifiers/hmc425a.c
> > index 13e018a59637..77872e2dfdfe 100644
> > --- a/drivers/iio/amplifiers/hmc425a.c
> > +++ b/drivers/iio/amplifiers/hmc425a.c
> > @@ -41,15 +41,14 @@ struct hmc425a_chip_info {
> >  
> >  struct hmc425a_state {
> >   struct mutex lock; /* protect sensor state */
> > - struct hmc425a_chip_info *chip_info;
> > + const struct hmc425a_chip_info *chip_info;
>
> Since you're doing this, I believe you should also constify hmc425a_chip_info_tbl[]
> and mention it in the commit message.
>
Absolutely. I've made that change and added a note on it to commit message.

> - Nuno Sá
>