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

Jonathan Cameron jic23 at kernel.org
Sun Oct 18 16:05:23 PDT 2026


On Mon, 5 Oct 2026 15:11:54 +0530
Dileep Kumar Nagavarapu <dileepkumar.nagavarapu at amd.com> 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.

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 at amd.com>
> Signed-off-by: Sai Krishna Potthuri <sai.krishna.potthuri at amd.com>
> Signed-off-by: Dileep Kumar Nagavarapu <dileepkumar.nagavarapu at amd.com>




More information about the linux-arm-kernel mailing list