similar to: [RFC][PATCH] kernel.h: Add generic roundup_64() macro

Displaying 20 results from an estimated 2000 matches similar to: "[RFC][PATCH] kernel.h: Add generic roundup_64() macro"

2019 May 23
4
[RFC][PATCH] kernel.h: Add generic roundup_64() macro
On Thu, 23 May 2019 08:10:44 -0700 Linus Torvalds <torvalds at linux-foundation.org> wrote: > On Thu, May 23, 2019 at 7:00 AM Steven Rostedt <rostedt at goodmis.org> wrote: > > > > +# define roundup_64(x, y) ( \ > > +{ \ > > + typeof(y) __y = y;
2019 May 24
1
[RFC][PATCH] kernel.h: Add generic roundup_64() macro
On 23/05/2019 16:27, Steven Rostedt wrote: > > I haven't yet tested this, but what about something like the following: > > ...perhaps forget about the constant check, and just force > the power of two check: > > \ > if (!(__y & (__y >> 1))) { \ > __x = round_up(x, y); \ > } else { \ You probably want            if (!(__y & (__y
2019 May 23
1
[RFC][PATCH] kernel.h: Add generic roundup_64() macro
On Thu, 23 May 2019 09:51:29 -0700 Linus Torvalds <torvalds at linux-foundation.org> wrote: > On Thu, May 23, 2019 at 8:27 AM Steven Rostedt <rostedt at goodmis.org> wrote: > > > > I haven't yet tested this, but what about something like the following: > > So that at least handles the constant case that the normal "roundup()" > case also
2019 May 23
0
[RFC][PATCH] kernel.h: Add generic roundup_64() macro
On Thu, May 23, 2019 at 7:00 AM Steven Rostedt <rostedt at goodmis.org> wrote: > > +# define roundup_64(x, y) ( \ > +{ \ > + typeof(y) __y = y; \ > + typeof(x) __x = (x) + (__y - 1); \ > + do_div(__x, __y);
2019 May 24
1
[RFC][PATCH] kernel.h: Add generic roundup_64() macro
On 24.05.19 г. 18:26 ч., Steven Rostedt wrote: > On Fri, 24 May 2019 16:11:14 +0100 > Roger Willcocks <roger at filmlight.ltd.uk> wrote: > >> On 23/05/2019 16:27, Steven Rostedt wrote: >>> >>> I haven't yet tested this, but what about something like the following: >>> >>> ...perhaps forget about the constant check, and just force
2019 May 24
0
[RFC][PATCH] kernel.h: Add generic roundup_64() macro
On Fri, 24 May 2019 16:11:14 +0100 Roger Willcocks <roger at filmlight.ltd.uk> wrote: > On 23/05/2019 16:27, Steven Rostedt wrote: > > > > I haven't yet tested this, but what about something like the following: > > > > ...perhaps forget about the constant check, and just force > > the power of two check: > > > > \ > > if (!(__y
2019 May 23
0
[RFC][PATCH] kernel.h: Add generic roundup_64() macro
On Thu, May 23, 2019 at 8:27 AM Steven Rostedt <rostedt at goodmis.org> wrote: > > I haven't yet tested this, but what about something like the following: So that at least handles the constant case that the normal "roundup()" case also handles. At the same time, in the case you are talking about, I really do suspect that we have a (non-constant) power of two, and that
2008 Aug 06
3
[PATCH RFC] do_settime is backwards?!
While digging through the time code, I found something very strange in do_settime: x = (secs * 1000000000ULL) + (u64)nsecs - system_time_base; y = do_div(x, 1000000000); spin_lock(&wc_lock); wc_sec = _wc_sec = (u32)x; wc_nsec = _wc_nsec = (u32)y; spin_unlock(&wc_lock); The value "x" appears to be the number of nanoseconds, while the value
2007 Apr 18
1
[PATCH 9/10] Vmi timer update.patch
Convert VMI timer to use clock events, making it properly able to use the NO_HZ infrastructure. On UP systems, with no local APIC, we just continue to route these events through the PIT. On systems with a local APIC, or SMP, we provide a single source interrupt chip which creates the local timer IRQ. It actually gets delivered by the APIC hardware, but we don't want to use the same local
2007 Apr 18
1
[PATCH 9/10] Vmi timer update.patch
Convert VMI timer to use clock events, making it properly able to use the NO_HZ infrastructure. On UP systems, with no local APIC, we just continue to route these events through the PIT. On systems with a local APIC, or SMP, we provide a single source interrupt chip which creates the local timer IRQ. It actually gets delivered by the APIC hardware, but we don't want to use the same local
2019 May 24
0
[RFC][PATCH] kernel.h: Add generic roundup_64() macro
On Fri, 24 May 2019 19:30:45 +0300 Nikolay Borisov <nborisov at suse.com> wrote: > > Yes I do. I corrected it in my next email. > > > > http://lkml.kernel.org/r/20190523133648.591f9e78 at gandalf.local.home > > Or perhaps just using is_power_of_2 from include/linux/log2.h ? Even better. Thanks, -- Steve
2018 Sep 17
2
[PATCH nbdkit v2] common: Introduce round up, down; and divide round
Since we're using ({ .. }) gcc/clang extension, let's rewrite the rounding.h change too. Rich.
2014 Oct 02
0
[PATCH] drm/nouveau: gk20a: Fix type of dividend in do_div()
From: Thierry Reding <treding at nvidia.com> The semantics of do_div() are (see include/asm-generic/div64.h): uint32_t do_div(uint64_t *n, uint32_t base) Using a different type will therefore cause the following warning (as seen on xtensa/allmodconfig): CC [M] drivers/gpu/drm/nouveau/core/subdev/clock/gk20a.o In file included from arch/xtensa/include/generated/asm/div64.h:1:0,
2019 May 17
1
[nbdkit PATCH] truncate: Detect large image overflow with round-up
It is possible for the round-up parameter to cause our desired size to exceed 2**63-1. But this error message is cryptic: $ ./nbdkit -f --filter=truncate pattern $(((1<<63)-1)) round-up=1m & $ qemu-nbd --list nbdkit: pattern[1]: error: .get_size function returned invalid value (-9223372036854775808) qemu-nbd: Failed to read initial magic: Unexpected end-of-file before all bytes were
2016 Sep 16
1
[PATCH] volt: use kernel's 64-bit signed division function
Doing direct 64 bit divisions in kernel code leads to references to undefined symbols on 32 bit architectures. Replace such divisions with calls to div64_s64 to make the module usable on 32 bit archs. Signed-off-by: Alexandre Courbot <acourbot at nvidia.com> --- drm/nouveau/nvkm/subdev/volt/base.c | 6 +++--- lib/include/nvif/os.h | 1 + 2 files changed, 4 insertions(+), 3
2013 Aug 12
2
[PATCH] drm/nouveau: fix ltcg memory initialization after suspend
Some registers were not initialized in init, this causes them to be uninitialized after suspend. Signed-off-by: Maarten Lankhorst <maarten.lankhorst at canonical.com> --- diff --git a/drivers/gpu/drm/nouveau/core/subdev/ltcg/nvc0.c b/drivers/gpu/drm/nouveau/core/subdev/ltcg/nvc0.c index bcca883..7288940 100644 --- a/drivers/gpu/drm/nouveau/core/subdev/ltcg/nvc0.c +++
2018 Aug 01
1
Re: [PATCH v2 nbdkit 5/6] Add truncate filter for truncating or extending the size of plugins.
On 08/01/2018 06:10 AM, Richard W.M. Jones wrote: > This can truncate, extend, or round up/down to a multiple. > --- > common-rules.mk | 3 +- > configure.ac | 1 + > filters/offset/nbdkit-offset-filter.pod | 7 +- > filters/partition/nbdkit-partition-filter.pod | 1 + >
2016 Oct 20
0
[PATCH] x86/vmware: Read tsc_khz only once - at boot time
Re-factor the vmware platform setup code to query the hypervisor for tsc frequency only once during boot. Since the VMware hypervisor guarantees constant TSC, calibrate_tsc now uses the saved value. Signed-off-by: Alexey Makhalov <amakhalov at vmware.com> Acked-by: Alok N Kataria <akataria at vmware.com> --- arch/x86/kernel/cpu/vmware.c | 37 ++++++++++++++++++------------------- 1
2016 Oct 20
0
[PATCH] x86/vmware: Read tsc_khz only once - at boot time
Re-factor the vmware platform setup code to query the hypervisor for tsc frequency only once during boot. Since the VMware hypervisor guarantees constant TSC, calibrate_tsc now uses the saved value. Signed-off-by: Alexey Makhalov <amakhalov at vmware.com> Acked-by: Alok N Kataria <akataria at vmware.com> --- arch/x86/kernel/cpu/vmware.c | 37 ++++++++++++++++++------------------- 1
2015 Mar 13
0
[PATCH] sd, mmc, virtio_blk, string_helpers: fix block size units
On 6 March 2015 at 03:47, James Bottomley <James.Bottomley at hansenpartnership.com> wrote: > From: James Bottomley <JBottomley at Parallels.com> > > The current string_get_size() overflows when the device size goes over > 2^64 bytes because the string helper routine computes the suffix from > the size in bytes. However, the entirety of Linux thinks in terms of >