Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

math: make RATIONAL tristate

Patch series "math: RATIONAL and RATIONAL_KUNIT_TEST improvements".

This series makes the RATIONAL symbol tristate, so it is not forced
builtin if all users are modular, and makes the RATIONAL_KUNIT_TEST depend
on RATIONAL, to avoid enabling RATIONAL if there are no real users.

This patch (of 2):

All but one symbols that select RATIONAL are tristate, but RATIONAL itself
is bool. Change it to tristate, so the rational fractions support code
can be modular if no builtin code relies on it.

Link: https://lkml.kernel.org/r/20210706100945.3803694-1-geert@linux-m68k.org
Link: https://lkml.kernel.org/r/20210706100945.3803694-2-geert@linux-m68k.org
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Trent Piepho <tpiepho@gmail.com>
Cc: Colin Ian King <colin.king@canonical.com>
Cc: Brendan Higgins <brendanhiggins@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Geert Uytterhoeven and committed by
Linus Torvalds
bcda5fd3 1c3493bb

+4 -1
+1 -1
lib/math/Kconfig
··· 14 14 If unsure, say N. 15 15 16 16 config RATIONAL 17 - bool 17 + tristate
+3
lib/math/rational.c
··· 13 13 #include <linux/export.h> 14 14 #include <linux/minmax.h> 15 15 #include <linux/limits.h> 16 + #include <linux/module.h> 16 17 17 18 /* 18 19 * calculate best rational approximation for a given fraction ··· 107 106 } 108 107 109 108 EXPORT_SYMBOL(rational_best_approximation); 109 + 110 + MODULE_LICENSE("GPL v2");