<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/lib/math, branch v6.4.16</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v6.4.16</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v6.4.16'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2022-11-21T21:30:53Z</updated>
<entry>
<title>math64: favor kernel-doc from header files</title>
<updated>2022-11-21T21:30:53Z</updated>
<author>
<name>Liam Beguin</name>
<email>liambeguin@gmail.com</email>
</author>
<published>2022-11-18T18:23:07Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=d28a1de5d1128d6caef15fdc04d3f6484dc7264b'/>
<id>urn:sha1:d28a1de5d1128d6caef15fdc04d3f6484dc7264b</id>
<content type='text'>
Fix the kernel-doc markings for div64 functions to point to the header
file instead of the lib/ directory.  This avoids having implementation
specific comments in generic documentation.  Furthermore, given that
some kernel-doc comments are identical, drop them from lib/math64 and
only keep there comments that add implementation details.

Signed-off-by: Liam Beguin &lt;liambeguin@gmail.com&gt;
Acked-by: Randy Dunlap &lt;rdunlap@infradead.org&gt;
Tested-by: Randy Dunlap &lt;rdunlap@infradead.org&gt;
Link: https://lore.kernel.org/r/20221118182309.3824530-1-liambeguin@gmail.com
Signed-off-by: Jonathan Corbet &lt;corbet@lwn.net&gt;
</content>
</entry>
<entry>
<title>math: make RATIONAL tristate</title>
<updated>2021-09-08T18:50:26Z</updated>
<author>
<name>Geert Uytterhoeven</name>
<email>geert@linux-m68k.org</email>
</author>
<published>2021-09-08T02:58:33Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=bcda5fd34417c89f653cc0912cc0608b36ea032c'/>
<id>urn:sha1:bcda5fd34417c89f653cc0912cc0608b36ea032c</id>
<content type='text'>
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 &lt;geert@linux-m68k.org&gt;
Reviewed-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Cc: Trent Piepho &lt;tpiepho@gmail.com&gt;
Cc: Colin Ian King &lt;colin.king@canonical.com&gt;
Cc: Brendan Higgins &lt;brendanhiggins@google.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>lib/math/rational: add Kunit test cases</title>
<updated>2021-07-01T18:06:05Z</updated>
<author>
<name>Trent Piepho</name>
<email>tpiepho@gmail.com</email>
</author>
<published>2021-07-01T01:55:52Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=b6c75c4afceb8bc065a4ebb5c6c381452bf96f53'/>
<id>urn:sha1:b6c75c4afceb8bc065a4ebb5c6c381452bf96f53</id>
<content type='text'>
Adds a number of test cases that cover a range of possible code paths.

[akpm@linux-foundation.org: remove non-ascii characters, fix whitespace]
[colin.king@canonical.com: fix spelling mistake "demominator" -&gt; "denominator"]
  Link: https://lkml.kernel.org/r/20210526085049.6393-1-colin.king@canonical.com

Link: https://lkml.kernel.org/r/20210525144250.214670-2-tpiepho@gmail.com
Signed-off-by: Trent Piepho &lt;tpiepho@gmail.com&gt;
Signed-off-by: Colin Ian King &lt;colin.king@canonical.com&gt;
Reviewed-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Cc: Daniel Latypov &lt;dlatypov@google.com&gt;
Cc: Oskar Schirmer &lt;oskar@scara.com&gt;
Cc: Yiyuan Guo &lt;yguoaz@gmail.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>lib/math/rational.c: fix divide by zero</title>
<updated>2021-07-01T18:06:05Z</updated>
<author>
<name>Trent Piepho</name>
<email>tpiepho@gmail.com</email>
</author>
<published>2021-07-01T01:55:49Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=65a0d3c14685663ba111038a35db70f559e39336'/>
<id>urn:sha1:65a0d3c14685663ba111038a35db70f559e39336</id>
<content type='text'>
If the input is out of the range of the allowed values, either larger than
the largest value or closer to zero than the smallest non-zero allowed
value, then a division by zero would occur.

In the case of input too large, the division by zero will occur on the
first iteration.  The best result (largest allowed value) will be found by
always choosing the semi-convergent and excluding the denominator based
limit when finding it.

In the case of the input too small, the division by zero will occur on the
second iteration.  The numerator based semi-convergent should not be
calculated to avoid the division by zero.  But the semi-convergent vs
previous convergent test is still needed, which effectively chooses
between 0 (the previous convergent) vs the smallest allowed fraction (best
semi-convergent) as the result.

Link: https://lkml.kernel.org/r/20210525144250.214670-1-tpiepho@gmail.com
Fixes: 323dd2c3ed0 ("lib/math/rational.c: fix possible incorrect result from rational fractions helper")
Signed-off-by: Trent Piepho &lt;tpiepho@gmail.com&gt;
Reported-by: Yiyuan Guo &lt;yguoaz@gmail.com&gt;
Reviewed-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Cc: Oskar Schirmer &lt;oskar@scara.com&gt;
Cc: Daniel Latypov &lt;dlatypov@google.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>Merge tag 'mips_5.13' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux</title>
<updated>2021-04-29T18:28:08Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2021-04-29T18:28:08Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=77d51337d650086643e1e96b8a7e1e6cbf0b09ff'/>
<id>urn:sha1:77d51337d650086643e1e96b8a7e1e6cbf0b09ff</id>
<content type='text'>
Pull MIPS updates from Thomas Bogendoerfer:

 - removed get_fs/set_fs

 - removed broken/unmaintained MIPS KVM trap and emulate support

 - added support for Loongson-2K1000

 - fixes and cleanups

* tag 'mips_5.13' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux: (107 commits)
  MIPS: BCM63XX: Use BUG_ON instead of condition followed by BUG.
  MIPS: select ARCH_KEEP_MEMBLOCK unconditionally
  mips: Do not include hi and lo in clobber list for R6
  MIPS:DTS:Correct the license for Loongson-2K
  MIPS:DTS:Fix label name and interrupt number of ohci for Loongson-2K
  MIPS: Avoid handcoded DIVU in `__div64_32' altogether
  lib/math/test_div64: Correct the spelling of "dividend"
  lib/math/test_div64: Fix error message formatting
  mips/bootinfo:correct some comments of fw_arg
  MIPS: Avoid DIVU in `__div64_32' is result would be zero
  MIPS: Reinstate platform `__div64_32' handler
  div64: Correct inline documentation for `do_div'
  lib/math: Add a `do_div' test module
  MIPS: Makefile: Replace -pg with CC_FLAGS_FTRACE
  MIPS: pci-legacy: revert "use generic pci_enable_resources"
  MIPS: Loongson64: Add kexec/kdump support
  MIPS: pci-legacy: use generic pci_enable_resources
  MIPS: pci-legacy: remove busn_resource field
  MIPS: pci-legacy: remove redundant info messages
  MIPS: pci-legacy: stop using of_pci_range_to_resource
  ...
</content>
</entry>
<entry>
<title>lib/math/test_div64: Correct the spelling of "dividend"</title>
<updated>2021-04-23T11:40:05Z</updated>
<author>
<name>Maciej W. Rozycki</name>
<email>macro@orcam.me.uk</email>
</author>
<published>2021-04-22T20:36:08Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=517b322c07e17787fc8a22ca9cede709b6ae9ec0'/>
<id>urn:sha1:517b322c07e17787fc8a22ca9cede709b6ae9ec0</id>
<content type='text'>
The word is spelt with a final "d" of course.  What a massive messup!

Signed-off-by: Maciej W. Rozycki &lt;macro@orcam.me.uk&gt;
Signed-off-by: Thomas Bogendoerfer &lt;tsbogend@alpha.franken.de&gt;
</content>
</entry>
<entry>
<title>lib/math/test_div64: Fix error message formatting</title>
<updated>2021-04-21T14:14:51Z</updated>
<author>
<name>Maciej W. Rozycki</name>
<email>macro@orcam.me.uk</email>
</author>
<published>2021-04-21T13:25:22Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=182dd5bad52c66a54c300fe320b772456572bf23'/>
<id>urn:sha1:182dd5bad52c66a54c300fe320b772456572bf23</id>
<content type='text'>
Align the expected result with one actually produced for easier visual
comparison; this has to take into account what the format specifiers
will actually produce rather than the characters they consist of.  E.g.:

test_div64: ERROR: 10000000ab275080 / 00000009 =&gt; 01c71c71da20d00e,00000002
test_div64: ERROR: expected value              =&gt; 0000000013045e47,00000001

(with a failure induced by setting bit #60 of the divident).

Signed-off-by: Maciej W. Rozycki &lt;macro@orcam.me.uk&gt;
Signed-off-by: Thomas Bogendoerfer &lt;tsbogend@alpha.franken.de&gt;
</content>
</entry>
<entry>
<title>lib/math: Add a `do_div' test module</title>
<updated>2021-04-21T11:45:36Z</updated>
<author>
<name>Maciej W. Rozycki</name>
<email>macro@orcam.me.uk</email>
</author>
<published>2021-04-20T02:50:28Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=5086ea4b0f58ba72c19553c4a657d7b2c0d8efc2'/>
<id>urn:sha1:5086ea4b0f58ba72c19553c4a657d7b2c0d8efc2</id>
<content type='text'>
Implement a module for correctness and performance evaluation for the
`do_div' function, often handled in an optimised manner by platform
code.  Use a somewhat randomly generated set of inputs that is supposed
to be representative, using the same set of divisors twice, expressed as
a constant and as a variable each, so as to verify the implementation
for both cases should they be handled by different code execution paths.
Reference results were produced with GNU bc.

At the conclusion output the total execution time elapsed.

Signed-off-by: Maciej W. Rozycki &lt;macro@orcam.me.uk&gt;
Signed-off-by: Thomas Bogendoerfer &lt;tsbogend@alpha.franken.de&gt;
</content>
</entry>
<entry>
<title>math: Export mul_u64_u64_div_u64</title>
<updated>2021-03-24T23:42:54Z</updated>
<author>
<name>David S. Miller</name>
<email>davem@davemloft.net</email>
</author>
<published>2021-03-24T23:42:54Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=bf45947864764548697e7515fe693e10f173f312'/>
<id>urn:sha1:bf45947864764548697e7515fe693e10f173f312</id>
<content type='text'>
Fixes: f51d7bf1dbe5 ("ptp_qoriq: fix overflow in ptp_qoriq_adjfine() u64 calcalation")
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>kernel.h: split out mathematical helpers</title>
<updated>2020-12-16T06:46:15Z</updated>
<author>
<name>Andy Shevchenko</name>
<email>andriy.shevchenko@linux.intel.com</email>
</author>
<published>2020-12-16T04:42:48Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=aa6159ab99a9ab5df835b4750b66cf132a5aa292'/>
<id>urn:sha1:aa6159ab99a9ab5df835b4750b66cf132a5aa292</id>
<content type='text'>
kernel.h is being used as a dump for all kinds of stuff for a long time.
Here is the attempt to start cleaning it up by splitting out
mathematical helpers.

At the same time convert users in header and lib folder to use new
header.  Though for time being include new header back to kernel.h to
avoid twisted indirected includes for existing users.

[sfr@canb.auug.org.au: fix powerpc build]
  Link: https://lkml.kernel.org/r/20201029150809.13059608@canb.auug.org.au

Link: https://lkml.kernel.org/r/20201028173212.41768-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Cc: "Paul E. McKenney" &lt;paulmck@kernel.org&gt;
Cc: Trond Myklebust &lt;trond.myklebust@hammerspace.com&gt;
Cc: Jeff Layton &lt;jlayton@kernel.org&gt;
Cc: Rasmus Villemoes &lt;linux@rasmusvillemoes.dk&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
</feed>
