mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mike Jones <ashmodai@ashmodai.com>
To: linux-kernel@vger.kernel.org
Subject: [PATCH] include/linux/bitops.h "integer" constants too large for	u64
Date: Wed, 04 Jun 2003 20:15:58 -0400	[thread overview]
Message-ID: <1054772158.30802.9.camel@ashmodai.ashmodai.com> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 1405 bytes --]

Hi,

I'm using GCC 3.3 to compile 2.5.70-mm4, and am being bombarded by
warnings regarding the use of integer constants in
include/linux/bitops.h.  The attached patch, which is trivial, should
fix the problem.

Please CC me on any replies, as I am not subscribed to the linux-kernel
mailing list.

Regards,

Mike Jones

An excerpt of the warnings displayed on almost every compiled file:

include/linux/bitops.h: In function `generic_hweight64':
include/linux/bitops.h:118: warning: integer constant is too large for
"unsigned long" type
include/linux/bitops.h:118: warning: integer constant is too large for
"unsigned long" type
include/linux/bitops.h:119: warning: integer constant is too large for
"unsigned long" type
include/linux/bitops.h:119: warning: integer constant is too large for
"unsigned long" type
include/linux/bitops.h:120: warning: integer constant is too large for
"unsigned long" type
include/linux/bitops.h:120: warning: integer constant is too large for
"unsigned long" type
include/linux/bitops.h:121: warning: integer constant is too large for
"unsigned long" type
include/linux/bitops.h:121: warning: integer constant is too large for
"unsigned long" type
include/linux/bitops.h:122: warning: integer constant is too large for
"unsigned long" type
include/linux/bitops.h:122: warning: integer constant is too large for
"unsigned long" type


[-- Attachment #1.2: Type: text/plain, Size: 1229 bytes --]

--- bitops.h	2003-06-04 20:06:07.000000000 -0400
+++ linux-2.5.70/include/linux/bitops.h	2003-06-04 20:03:56.000000000 -0400
@@ -115,12 +115,12 @@
 		return generic_hweight32((unsigned int)(w >> 32)) +
 					generic_hweight32((unsigned int)w);
 
-	res = (w & 0x5555555555555555) + ((w >> 1) & 0x5555555555555555);
-	res = (res & 0x3333333333333333) + ((res >> 2) & 0x3333333333333333);
-	res = (res & 0x0F0F0F0F0F0F0F0F) + ((res >> 4) & 0x0F0F0F0F0F0F0F0F);
-	res = (res & 0x00FF00FF00FF00FF) + ((res >> 8) & 0x00FF00FF00FF00FF);
-	res = (res & 0x0000FFFF0000FFFF) + ((res >> 16) & 0x0000FFFF0000FFFF);
-	return (res & 0x00000000FFFFFFFF) + ((res >> 32) & 0x00000000FFFFFFFF);
+	res = (w & 0x5555555555555555ULL) + ((w >> 1) & 0x5555555555555555ULL);
+	res = (res & 0x3333333333333333ULL) + ((res >> 2) & 0x3333333333333333ULL);
+	res = (res & 0x0F0F0F0F0F0F0F0FULL) + ((res >> 4) & 0x0F0F0F0F0F0F0F0FULL);
+	res = (res & 0x00FF00FF00FF00FFULL) + ((res >> 8) & 0x00FF00FF00FF00FFULL);
+	res = (res & 0x0000FFFF0000FFFFULL) + ((res >> 16) & 0x0000FFFF0000FFFFULL);
+	return (res & 0x00000000FFFFFFFFULL) + ((res >> 32) & 0x00000000FFFFFFFFULL);
 }
 
 static inline unsigned long hweight_long(unsigned long w)

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 155 bytes --]

                 reply	other threads:[~2003-06-05  0:02 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1054772158.30802.9.camel@ashmodai.ashmodai.com \
    --to=ashmodai@ashmodai.com \
    --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®