Re: [PATCH] lib/math/rational.c: Fix divide by zero

From: Randy Dunlap
Date: Mon May 24 2021 - 18:04:29 EST


On 5/24/21 9:55 AM, Daniel Latypov wrote:
> diff --git a/lib/math/Kconfig b/lib/math/Kconfig
> index f19bc9734fa7..20460b567493 100644
> --- a/lib/math/Kconfig
> +++ b/lib/math/Kconfig
> @@ -15,3 +15,14 @@ config PRIME_NUMBERS
>
> config RATIONAL
> bool
> +
> +config RATIONAL_KUNIT_TEST
> + tristate "KUnit test for rational number support" if !KUNIT_ALL_TESTS
> + # depends on KUNIT && RATIONAL # this is how it should work, but
> + depends on KUNIT
> + select RATIONAL # I don't grok kconfig enough to know why this

Only to set the symbol CONFIG_RATIONAL.
Then when 'make' descends into the lib/math/ subdir and looks at its Makefile,
it will decide to build the binary rational.o.

obj-$(CONFIG_RATIONAL) += rational.o


> is necessary
> + default KUNIT_ALL_TESTS
> + help
> + This builds unit tests for the rational number support.
> +
> + If unsure, say N.


--
~Randy