Re: [PATCH v5 14/16] iio: adc: xilinx-xadc: Split driver into core and platform files

From: Andy Shevchenko

Date: Tue Nov 24 2026 - 12:23:17 EST


On Tue, Nov 24, 2026 at 10:23:29PM +0530, Nagavarapu, Dileep Kumar wrote:
> On 11/24/2026 4:50 PM, Andy Shevchenko wrote:
> > On Tue, Nov 24, 2026 at 04:33:59PM +0530, Nagavarapu, Dileep Kumar wrote:
> > > On 11/10/2026 9:59 PM, Andy Shevchenko wrote:
> > > > On Tue, Nov 10, 2026 at 10:31:59AM +0530, Dileep Kumar Nagavarapu wrote:

...

> > > > > ---
> > > > > drivers/iio/adc/Kconfig | 8 +-
> > > > > drivers/iio/adc/Makefile | 5 +-
> > > > > drivers/iio/adc/xilinx-xadc-core.c | 690 +--------------
> > > > > drivers/iio/adc/xilinx-xadc-events.c | 1 +
> > > > > ...inx-xadc-core.c => xilinx-xadc-platform.c} | 818 +-----------------
> > > > > drivers/iio/adc/xilinx-xadc.h | 27 +
> > > > > 6 files changed, 72 insertions(+), 1477 deletions(-)
> > > >
> > > > This is weird statistics... I think it's a bug in Git. What it did, it copies
> > > > -core.c twice and uses statistics on each file after that without duplicating
> > > > the *original* amount of lines.
> > >
> > > I generated the patches using the following command: "git format-patch \
> > > -M \
> > > -C10% \
> > > --histogram \
> > > --base=origin/togreg \
> > > --cover-letter \
> >
> > > --subject-prefix="PATCH v5" \
> >
> > Hint: You can use -v5 instead of the above long parameter.
> >
> > > origin/togreg..HEAD"
> > >
>
> > > If I remove the 10% similarity threshold from the command,
> >
> > 10% is way too low threshold!
>
> Is it OK to use `-M -C --histogram` (default thresholds) instead?

Yes.

> With it, xilinx-xadc-platform.c is shown as a new file with all lines as
> additions rather than as a copy of xilinx-xadc-core.c. The statistics
> then look like this:
>
> drivers/iio/adc/Kconfig | 8 +-
> drivers/iio/adc/Makefile | 5 +-
> drivers/iio/adc/xilinx-xadc-core.c | 688 +------------------------
> drivers/iio/adc/xilinx-xadc-events.c | 1 +
> drivers/iio/adc/xilinx-xadc-platform.c | 677 ++++++++++++++++++++++++
> drivers/iio/adc/xilinx-xadc.h | 28 +
> 6 files changed, 733 insertions(+), 674 deletions(-)
>
> Are these statistics OK?

Yes.

> > > xilinx-xadc-platform.c is no longer detected as a copy of the original
> > > xilinx-xadc-core.c, which is not the expected output.
> > > Is there a better command or approach that would allow Git to recognize
> > > xilinx-xadc-platform.c as being split from the original file while also
> > > producing meaningful diff statistics?
> >
> > But it's not a full copy. Have you tried to apply the patch from the mailing
> > list and see if `git am` correctly recognises the split?
>
> Yes. I applied the v5 series from the mailing list with `git am`
> and all patches applied without errors

So, then it seems like a Git bug as I pointed earlier, and hence it's fine
to use 10% threshold in _this_ case.

--
With Best Regards,
Andy Shevchenko