mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: cw@f00f.org (Chris Wedgwood)
To: LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH] Avoid a build warning on 32-bit platforms
Date: Tue, 19 Oct 2004 19:37:16 -0700	[thread overview]
Message-ID: <20041020023716.GE8597@taniwha.stupidest.org> (raw)

Avoid a build warning on 32-bit platforms.

Signed-off-by: cw@f00f.org



Is this too ugly for words? :)


diff -Nru a/drivers/char/random.c b/drivers/char/random.c
--- a/drivers/char/random.c	2004-10-19 17:48:36 -07:00
+++ b/drivers/char/random.c	2004-10-19 17:48:36 -07:00
@@ -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) */
 	}
 
 	/*

             reply	other threads:[~2004-10-20  2:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-20  2:37 Chris Wedgwood [this message]
2004-10-20  9:56 Mikael Pettersson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20041020023716.GE8597@taniwha.stupidest.org \
    --to=cw@f00f.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®