Re: [PATCH v2] iio: frequency: ad9832: Use FIELD_PREP macro to set bit fields

From: Siddharth Menon
Date: Tue Mar 18 2025 - 01:15:16 EST


On Tue, 18 Mar 2025 at 10:12, Marcelo Schmitt
<marcelo.schmitt1@xxxxxxxxx> wrote:
>
> Hi Siddharth,
>
> On 03/17, Siddharth Menon wrote:
> > Refactor code to use the FIELD_PREP macro for setting bit fields
> > instead of manual bit manipulation.
> >
> > Suggested-by: Marcelo Schmitt <marcelo.schmitt1@xxxxxxxxx>
> > Signed-off-by: Siddharth Menon <simeddon@xxxxxxxxx>
> > ---
> ...
> > +#define CMD_MASK_2 GENMASK(15, 12)
> > +#define ADD_MASK_2 GENMASK(11, 8)
> > +#define DATA_MASK_2 GENMASK(7, 0)
>
> DATA_MASK_2? Did we already have a data mask?
> What about adding the device prefix to the mask name (e.g. AD9832_CMD_MASK)?

I'm sorry, I was comparing the values in a custom driver and copy pasted
the wrong variable names.

> Also, this patch fails to compile. Please, apply your patches and build the
> kernel before sending the patches to the mailing list. Also, run checkpatch on them.
> E.g.
> ./scripts/checkpatch.pl --terse --codespell --color=always -strict my_patch.patch

I shall send in a new patch after testing.