Messages in this thread | | | From | Geert Uytterhoeven <> | Date | Wed, 13 Mar 2019 23:02:06 +0100 | Subject | Re: [PATCH 1/5] lib/sort: Make swap functions more generic |
| |
On Wed, Mar 13, 2019 at 10:23 PM Rasmus Villemoes <linux@rasmusvillemoes.dk> wrote: > On 21/02/2019 07.30, George Spelvin wrote: > > +#ifdef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS > > + (void)base; > > +#else > > + lsbits |= (unsigned int)(size_t)base; > > The kernel usually casts pointers to long or unsigned long. If some > oddball arch has size_t something other than unsigned long, this would > give a "warning: cast from pointer to integer of different size". So > just cast to unsigned long, and drop the cast to unsigned int.
The proper integer equivalent of a pointer is uintptr_t, so please use that instead of size_t.
Gr{oetje,eeting}s,
Geert
-- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds
| |