Skip to content

RFC cleanup 64bit divide API

[email protected] lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest4 patches 6 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4introduce explicit signed/unsigned 64bit divideinclude/asm-x86/div64.h include/linux/math64.h lib/div64.c+113 -24 replies
2/4convert a few do_div userkernel/time.c kernel/time/ntp.c+15 -391 reply
3/4rename div64_64 to div64_u64arch/x86/kvm/lapic.c include/asm-arm/div64.h include/asm-generic/div64.h +11 more+31 -420 replies
4/4remove div_long_long_remarch/mips/kernel/binfmt_elfn32.c arch/mips/kernel/binfmt_elfo32.c drivers/char/mmtimer.c +7 more+44 -1110 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/4] [RFC] cleanup 64bit divide API

Hi,

The primary purpose of these patches is to introduce a signed divide, which is useful for NTP. While I'm at it I cleaned up the API, so it should be a little easier to use.
It uses a new header <linux/math64.h> for it instead of using <asm-generic/div64.h>. asm-generic/div64.h has the problem of an all-or-nothing approach, so any arch not using it has to implement the whole API and usually it's enough to provide only one of them. <linux/math64.h> allows to selectively functions as needed.

In the long term we can first depricate using <asm/div64.h> and even later do_div() completely.

bye, Roman