Re: [PATCH v4 04/15] iio: adc: xilinx-xadc: Drop unnecessary masking and dead code

From: Nagavarapu, Dileep Kumar

Date: Thu Oct 22 2026 - 01:06:20 EST




On 10/19/2026 4:35 AM, Jonathan Cameron wrote:
Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding.


Hi Jonathan,


On Mon, 5 Oct 2026 15:11:54 +0530
Dileep Kumar Nagavarapu <dileepkumar.nagavarapu@xxxxxxx> wrote:

Remove a no-operation bitwise-OR with zero (dead code) and the redundant
16-bit masking when storing values into u16 destinations, where the
mask has no effect. Also remove the unused macros.

Hi Dileep,

Why? If they are expressing the rest of the fields in a register
simply knowing there is stuff there an be useful even if not
explicitly used. There are three approaches I tend to accept to
such defines.

Thanks for the review. I removed these macros as they are currently unused by the driver.

I agree that they are useful for documenting the relevant register fields, so I’ll retain them.

1) Comprehensive. Sometimes it is just easier to define anything -
particularly if codegen involved.
2) Comprehensive for a subset of registers + nothing for the contents
of other registers - fits the above definition of useful by defining
what the bits we are leaving alone do.
3) Exactly what is used. I actually don't particularly like this and
prefer option (2) but I don't tend to consider it a reason to not
merge a driver.

Now, if the stuff you are dropping is inconsistent across IPs or similar
then that is fine, but say so here.

Jonathan



No functional change intended.

Co-developed-by: Sai Krishna Potthuri <sai.krishna.potthuri@xxxxxxx>
Signed-off-by: Sai Krishna Potthuri <sai.krishna.potthuri@xxxxxxx>
Signed-off-by: Dileep Kumar Nagavarapu <dileepkumar.nagavarapu@xxxxxxx>


Thanks,
Dileep