Re: [PATCH v3] lib/math: Add int_sqrt test suite

Luis Felipe Hernandez
2024-11-01T21:01:41Z

On Thu, Oct 31, 2024 at 05:39:41PM -0700, Andrew Morton wrote:
> > > --- a/lib/math/Makefile
> > > +++ b/lib/math/Makefile
> > > @@ -9,3 +9,4 @@ obj-$(CONFIG_INT_POW_TEST) += tests/int_pow_kunit.o
> > > obj-$(CONFIG_TEST_DIV64) += test_div64.o
> > > obj-$(CONFIG_TEST_MULDIV64) += test_mul_u64_u64_div_u64.o
> > > obj-$(CONFIG_RATIONAL_KUNIT_TEST) += rational-test.o
> > > +obj-y += tests/
>
> What's this change about? It seems somewhat unrelated to adding a
> single test. I mean, there's an unrelated test listed in
> lib/math/tests/Makefile so what change does this patch have upon that
> one?
>

Hello Andrew, I apologize about the late response. I made this change in
order to try and stay aligned with this previous patch moving all
lib/math/ kunit tests into lib/math/tests/: https://lore.kernel.org/all/20241005222446.10471-1-luis.hernandez093@gmail.com/

From my understanding, kbuild wouldn't pick up the entry if it
was just specified in lib/math/tests/Makefile without a reference to it in
it's parent lib/math/Makefile. I didn't want to this
patch to end up in a situation where it would introduce an explicit
object entry in lib/math/Makefile pointing to
obj-$(CONFIG_INT_SQRT_KUNIT_TEST) += tests/int_sqrt_kunit.o
as is the case in mainline at the moment: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/lib/math/Makefile?h=v6.12-rc5#n8
This would in a sense introduce a regression in the organization of
the Makefile in lib/math/.

I apologize for not adding the reasoning behind the change in the
original patch.

Best,

Felipe