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

lib: Move mathematic helpers to separate folder

For better maintenance and expansion move the mathematic helpers to the
separate folder.

No functional change intended.

Note, the int_sqrt() is not used as a part of lib, so, moved to regular
obj.

Link: http://lkml.kernel.org/r/20190323172531.80025-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Cc: Randy Dunlap <rdunlap@infradead.org>
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: Lee Jones <lee.jones@linaro.org>
Cc: Daniel Thompson <daniel.thompson@linaro.org>
Cc: Ray Jui <rjui@broadcom.com>
[mchehab+samsung@kernel.org: fix broken doc references for div64.c and gcd.c]
Link: http://lkml.kernel.org/r/734f49bae5d4052b3c25691dfefad59bea2e5843.1555580999.git.mchehab+samsung@kernel.org
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Andy Shevchenko and committed by
Linus Torvalds
2c64e9cb b5c56e0c

+27 -24
+2 -2
Documentation/core-api/kernel-api.rst
··· 147 147 .. kernel-doc:: include/linux/math64.h 148 148 :internal: 149 149 150 - .. kernel-doc:: lib/div64.c 150 + .. kernel-doc:: lib/math/div64.c 151 151 :functions: div_s64_rem div64_u64_rem div64_u64 div64_s64 152 152 153 - .. kernel-doc:: lib/gcd.c 153 + .. kernel-doc:: lib/math/gcd.c 154 154 :export: 155 155 156 156 UUID/GUID
+2 -12
lib/Kconfig
··· 46 46 This option enables the use of hardware bit-reversal instructions on 47 47 architectures which support such operations. 48 48 49 - config RATIONAL 50 - bool 51 - 52 49 config GENERIC_STRNCPY_FROM_USER 53 50 bool 54 51 ··· 57 60 58 61 config GENERIC_FIND_FIRST_BIT 59 62 bool 63 + 64 + source "lib/math/Kconfig" 60 65 61 66 config NO_GENERIC_PCI_IOPORT_MAP 62 67 bool ··· 530 531 config CLZ_TAB 531 532 bool 532 533 533 - config CORDIC 534 - tristate "CORDIC algorithm" 535 - help 536 - This option provides an implementation of the CORDIC algorithm; 537 - calculations are in fixed point. Module will be called cordic. 538 - 539 534 config DDR 540 535 bool "JEDEC DDR data" 541 536 help ··· 620 627 621 628 config PARMAN 622 629 tristate "parman" if COMPILE_TEST 623 - 624 - config PRIME_NUMBERS 625 - tristate 626 630 627 631 config STRING_SELFTEST 628 632 tristate "Test string functions"
+6 -9
lib/Makefile
··· 30 30 31 31 lib-y := ctype.o string.o vsprintf.o cmdline.o \ 32 32 rbtree.o radix-tree.o timerqueue.o xarray.o \ 33 - idr.o int_sqrt.o extable.o \ 33 + idr.o extable.o \ 34 34 sha1.o chacha.o irq_regs.o argv_split.o \ 35 35 flex_proportions.o ratelimit.o show_mem.o \ 36 36 is_single_threaded.o plist.o decompress.o kobject_uevent.o \ ··· 44 44 lib-y += kobject.o klist.o 45 45 obj-y += lockref.o 46 46 47 - obj-y += bcd.o div64.o sort.o parser.o debug_locks.o random32.o \ 47 + obj-y += bcd.o sort.o parser.o debug_locks.o random32.o \ 48 48 bust_spinlocks.o kasprintf.o bitmap.o scatterlist.o \ 49 - gcd.o lcm.o list_sort.o uuid.o iov_iter.o clz_ctz.o \ 49 + list_sort.o uuid.o iov_iter.o clz_ctz.o \ 50 50 bsearch.o find_bit.o llist.o memweight.o kfifo.o \ 51 - percpu-refcount.o rhashtable.o reciprocal_div.o \ 51 + percpu-refcount.o rhashtable.o \ 52 52 once.o refcount.o usercopy.o errseq.o bucket_locks.o \ 53 53 generic-radix-tree.o 54 54 obj-$(CONFIG_STRING_SELFTEST) += test_string.o ··· 102 102 obj-$(CONFIG_DEBUG_INFO_REDUCED) += debug_info.o 103 103 CFLAGS_debug_info.o += $(call cc-option, -femit-struct-debug-detailed=any) 104 104 105 + obj-y += math/ 106 + 105 107 obj-$(CONFIG_GENERIC_IOMAP) += iomap.o 106 108 obj-$(CONFIG_GENERIC_PCI_IOMAP) += pci_iomap.o 107 109 obj-$(CONFIG_HAS_IOMEM) += iomap_copy.o devres.o ··· 123 121 124 122 obj-$(CONFIG_BITREVERSE) += bitrev.o 125 123 obj-$(CONFIG_PACKING) += packing.o 126 - obj-$(CONFIG_RATIONAL) += rational.o 127 124 obj-$(CONFIG_CRC_CCITT) += crc-ccitt.o 128 125 obj-$(CONFIG_CRC16) += crc16.o 129 126 obj-$(CONFIG_CRC_T10DIF)+= crc-t10dif.o ··· 196 195 197 196 obj-$(CONFIG_CPU_RMAP) += cpu_rmap.o 198 197 199 - obj-$(CONFIG_CORDIC) += cordic.o 200 - 201 198 obj-$(CONFIG_DQL) += dynamic_queue_limits.o 202 199 203 200 obj-$(CONFIG_GLOB) += glob.o ··· 236 237 obj-$(CONFIG_ASN1) += asn1_decoder.o 237 238 238 239 obj-$(CONFIG_FONT_SUPPORT) += fonts/ 239 - 240 - obj-$(CONFIG_PRIME_NUMBERS) += prime_numbers.o 241 240 242 241 hostprogs-y := gen_crc32table 243 242 hostprogs-y += gen_crc64table
lib/cordic.c lib/math/cordic.c
+1 -1
lib/div64.c lib/math/div64.c
··· 10 10 * Generic C version of 64bit/32bit division and modulo, with 11 11 * 64bit result and 32bit remainder. 12 12 * 13 - * The fast case for (n>>32 == 0) is handled inline by do_div(). 13 + * The fast case for (n>>32 == 0) is handled inline by do_div(). 14 14 * 15 15 * Code generated for this function might be very inefficient 16 16 * for some CPUs. __div64_32() can be overridden by linking arch-specific
lib/gcd.c lib/math/gcd.c
lib/int_sqrt.c lib/math/int_sqrt.c
lib/lcm.c lib/math/lcm.c
+11
lib/math/Kconfig
··· 1 + config CORDIC 2 + tristate "CORDIC algorithm" 3 + help 4 + This option provides an implementation of the CORDIC algorithm; 5 + calculations are in fixed point. Module will be called cordic. 6 + 7 + config PRIME_NUMBERS 8 + tristate 9 + 10 + config RATIONAL 11 + bool
+5
lib/math/Makefile
··· 1 + obj-y += div64.o gcd.o lcm.o int_sqrt.o reciprocal_div.o 2 + 3 + obj-$(CONFIG_CORDIC) += cordic.o 4 + obj-$(CONFIG_PRIME_NUMBERS) += prime_numbers.o 5 + obj-$(CONFIG_RATIONAL) += rational.o
lib/prime_numbers.c lib/math/prime_numbers.c
lib/rational.c lib/math/rational.c
lib/reciprocal_div.c lib/math/reciprocal_div.c