Skip to contentSkip to conversation

Avoid a build warning on 32-bit platforms

PATCH New Chris Wedgwood 1 participant 1 message Oct 20, 2004 Random number driver

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Avoid a build warning on 32-bit platforms

Avoid a build warning on 32-bit platforms.

Signed-off-by [email protected]

Is this too ugly for words? :)

drivers/char/random.c +5 -4
diff -Nru a/drivers/char/random.c b/drivers/char/random.c
@@ -818,11 +818,12 @@
 	 * jiffies.
 	 */
 	time = get_cycles();
-	if (time != 0) {
-		if (sizeof(time) > 4)
-			num ^= (u32)(time >> 32);
-	} else {
+	if (!time)
 		time = jiffies;
+	else {
+#if (BITS_PER_LONG > 32)
+		num ^= (u32)(time >> 32);
+#endif /* (BITS_PER_LONG > 32) */
 	}
 
 	/*