public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Randy Dunlap <randy.dunlap@oracle.com>
To: lkml <linux-kernel@vger.kernel.org>
Cc: ak@suse.de, akpm <akpm@linux-foundation.org>
Subject: [PATCH -mm] x86_64: kill 19000+ sparse warnings
Date: Wed, 25 Apr 2007 22:45:09 -0700	[thread overview]
Message-ID: <20070425224509.46153baa.randy.dunlap@oracle.com> (raw)

From: Randy Dunlap <randy.dunlap@oracle.com>

Eliminate 19439 (!!) sparse warnings like:
include/linux/mm.h:321:22: warning: constant 0xffff810000000000 is so big it is unsigned long

Eliminate 56 sparse warnings like:
arch/x86_64/kernel/setup.c:248:16: warning: constant 0xffffffff80000000 is so big it is unsigned long

Eliminate 5 sparse warnings like:
arch/x86_64/kernel/module.c:49:13: warning: constant 0xfffffffffff00000 is so big it is unsigned long

Eliminate 23 sparse warnings like:
arch/x86_64/mm/init.c:551:37: warning: constant 0xffffc20000000000 is so big it is unsigned long

Eliminate 6 sparse warnings like:
arch/x86_64/kernel/module.c:49:13: warning: constant 0xffffffff88000000 is so big it is unsigned long

Eliminate 23 sparse warnings like:
arch/x86_64/mm/init.c:552:6: warning: constant 0xffffe1ffffffffff is so big it is unsigned long

Eliminate 3 sparse warnings like:
arch/x86_64/kernel/e820.c:186:17: warning: constant 0x3fffffffffff is so big it is long

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
---
 include/asm-x86_64/page.h    |   11 +++++++++++
 include/asm-x86_64/pgtable.h |    9 +++++++++
 2 files changed, 20 insertions(+)

--- linux-2.6.21-rc7-mm1.orig/include/asm-x86_64/page.h
+++ linux-2.6.21-rc7-mm1/include/asm-x86_64/page.h
@@ -80,9 +80,16 @@ extern unsigned long phys_base;
 
 #define __PHYSICAL_START	CONFIG_PHYSICAL_START
 #define __KERNEL_ALIGN		0x200000
+
+#ifdef __ASSEMBLY__
 #define __START_KERNEL		(__START_KERNEL_map + __PHYSICAL_START)
 #define __START_KERNEL_map	0xffffffff80000000
 #define __PAGE_OFFSET           0xffff810000000000
+#else
+#define __START_KERNEL		(__START_KERNEL_map + __PHYSICAL_START)
+#define __START_KERNEL_map	0xffffffff80000000UL
+#define __PAGE_OFFSET           0xffff810000000000UL
+#endif
 
 /* to align the pointer to the (next) page boundary */
 #define PAGE_ALIGN(addr)	(((addr)+PAGE_SIZE-1)&PAGE_MASK)
@@ -94,7 +101,11 @@ extern unsigned long phys_base;
 #define __VIRTUAL_MASK		((_AC(1,UL) << __VIRTUAL_MASK_SHIFT) - 1)
 
 #define KERNEL_TEXT_SIZE  (40*1024*1024)
+#ifdef __ASSEMBLY__
 #define KERNEL_TEXT_START 0xffffffff80000000
+#else
+#define KERNEL_TEXT_START 0xffffffff80000000UL
+#endif
 
 #ifndef __ASSEMBLY__
 
--- linux-2.6.21-rc7-mm1.orig/include/asm-x86_64/pgtable.h
+++ linux-2.6.21-rc7-mm1/include/asm-x86_64/pgtable.h
@@ -134,12 +134,21 @@ static inline pte_t ptep_get_and_clear_f
 #define USER_PTRS_PER_PGD	((TASK_SIZE-1)/PGDIR_SIZE+1)
 #define FIRST_USER_ADDRESS	0
 
+#ifdef __ASSEMBLY__
 #define MAXMEM		 0x3fffffffffff
 #define VMALLOC_START    0xffffc20000000000
 #define VMALLOC_END      0xffffe1ffffffffff
 #define MODULES_VADDR    0xffffffff88000000
 #define MODULES_END      0xfffffffffff00000
 #define MODULES_LEN   (MODULES_END - MODULES_VADDR)
+#else
+#define MAXMEM		 0x3fffffffffffUL
+#define VMALLOC_START    0xffffc20000000000UL
+#define VMALLOC_END      0xffffe1ffffffffffUL
+#define MODULES_VADDR    0xffffffff88000000UL
+#define MODULES_END      0xfffffffffff00000UL
+#define MODULES_LEN   (MODULES_END - MODULES_VADDR)
+#endif
 
 #define _PAGE_BIT_PRESENT	0
 #define _PAGE_BIT_RW		1

             reply	other threads:[~2007-04-26  5:43 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-26  5:45 Randy Dunlap [this message]
2007-04-26  5:55 ` [PATCH -mm] x86_64: kill 19000+ sparse warnings Andrew Morton
2007-04-26  6:07   ` Randy Dunlap
2007-04-26  6:14     ` Andrew Morton
2007-04-26  6:21       ` Randy Dunlap
2007-04-26  6:28         ` Andrew Morton
2007-04-26  6:33           ` Randy Dunlap
2007-04-26  7:15   ` [PATCH -mm, v2] " Randy Dunlap
2007-04-26  9:24 ` [PATCH -mm] " Andi Kleen
2007-04-27  6:49   ` Jan Engelhardt

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=20070425224509.46153baa.randy.dunlap@oracle.com \
    --to=randy.dunlap@oracle.com \
    --cc=ak@suse.de \
    --cc=akpm@linux-foundation.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