mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Re: [PATCH] random: Create new rol32/ror32 bitops
       [not found] <200503082005.j28K5lBp028415@hera.kernel.org>
@ 2005-03-10  9:33 ` Geert Uytterhoeven
  2005-03-10 22:03   ` [PATCH] rol/ror type cleanup Matt Mackall
  0 siblings, 1 reply; 2+ messages in thread
From: Geert Uytterhoeven @ 2005-03-10  9:33 UTC (permalink / raw)
  To: Matt Mackall; +Cc: Linux Kernel Development

On Tue, 8 Mar 2005, Linux Kernel Mailing List wrote:
> --- a/include/linux/bitops.h	2005-03-08 12:05:59 -08:00
> +++ b/include/linux/bitops.h	2005-03-08 12:05:59 -08:00
> @@ -134,4 +134,26 @@
>  	return sizeof(w) == 4 ? generic_hweight32(w) : generic_hweight64(w);
>  }
>  
> +/*
> + * rol32 - rotate a 32-bit value left
> + *
> + * @word: value to rotate
> + * @shift: bits to roll
> + */
> +static inline __u32 rol32(__u32 word, int shift)
                                         ^^^
> +{
> +	return (word << shift) | (word >> (32 - shift));
> +}
> +
> +/*
> + * ror32 - rotate a 32-bit value right
> + *
> + * @word: value to rotate
> + * @shift: bits to roll
> + */
> +static inline __u32 ror32(__u32 word, int shift)
                                         ^^^
> +{
> +	return (word >> shift) | (word << (32 - shift));
> +}
> +
>  #endif

`unsigned int', while we're at it?

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH] rol/ror type cleanup
  2005-03-10  9:33 ` [PATCH] random: Create new rol32/ror32 bitops Geert Uytterhoeven
@ 2005-03-10 22:03   ` Matt Mackall
  0 siblings, 0 replies; 2+ messages in thread
From: Matt Mackall @ 2005-03-10 22:03 UTC (permalink / raw)
  To: Geert Uytterhoeven, Andrew Morton; +Cc: Linux Kernel Development

On Thu, Mar 10, 2005 at 10:33:29AM +0100, Geert Uytterhoeven wrote:
> `unsigned int', while we're at it?

Minor type cleanup.

Signed-off-by: Matt Mackall <mpm@selenic.com>

Index: bk/include/linux/bitops.h
===================================================================
--- bk.orig/include/linux/bitops.h	2005-03-10 13:52:49.000000000 -0800
+++ bk/include/linux/bitops.h	2005-03-10 13:59:51.000000000 -0800
@@ -140,7 +140,7 @@ static inline unsigned long hweight_long
  * @word: value to rotate
  * @shift: bits to roll
  */
-static inline __u32 rol32(__u32 word, int shift)
+static inline __u32 rol32(__u32 word, unsigned int shift)
 {
 	return (word << shift) | (word >> (32 - shift));
 }
@@ -151,7 +151,7 @@ static inline __u32 rol32(__u32 word, in
  * @word: value to rotate
  * @shift: bits to roll
  */
-static inline __u32 ror32(__u32 word, int shift)
+static inline __u32 ror32(__u32 word, unsigned int shift)
 {
 	return (word >> shift) | (word << (32 - shift));
 }

-- 
Mathematics is the supreme nostalgia of our time.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-03-10 22:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <200503082005.j28K5lBp028415@hera.kernel.org>
2005-03-10  9:33 ` [PATCH] random: Create new rol32/ror32 bitops Geert Uytterhoeven
2005-03-10 22:03   ` [PATCH] rol/ror type cleanup Matt Mackall

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®