public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@suse.de>
Subject: [PATCH 12/16] 64bit resource: change resource core to use resource_size_t
Date: Mon, 12 Jun 2006 17:31:14 -0700	[thread overview]
Message-ID: <11501587193060-git-send-email-greg@kroah.com> (raw)
In-Reply-To: <11501587153872-git-send-email-greg@kroah.com>

From: Greg Kroah-Hartman <gregkh@suse.de>

Based on a patch series originally from Vivek Goyal <vgoyal@in.ibm.com>

Cc: Vivek Goyal <vgoyal@in.ibm.com>
Cc: Andrew Morton <akpm@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 arch/sparc/kernel/ioport.c |    4 ++--
 include/linux/ioport.h     |   23 +++++++++++++----------
 kernel/resource.c          |   34 ++++++++++++++++++----------------
 3 files changed, 33 insertions(+), 28 deletions(-)

diff --git a/arch/sparc/kernel/ioport.c b/arch/sparc/kernel/ioport.c
index 84e134d..571e3fa 100644
--- a/arch/sparc/kernel/ioport.c
+++ b/arch/sparc/kernel/ioport.c
@@ -206,7 +206,7 @@ _sparc_ioremap(struct resource *res, u32
 	pa &= PAGE_MASK;
 	sparc_mapiorange(bus, pa, res->start, res->end - res->start + 1);
 
-	return (void __iomem *) (res->start + offset);
+	return (void __iomem *)(unsigned long)(res->start + offset);
 }
 
 /*
@@ -279,7 +279,7 @@ void *sbus_alloc_consistent(struct sbus_
 		res->name = sdev->prom_name;
 	}
 
-	return (void *)res->start;
+	return (void *)(unsigned long)res->start;
 
 err_noiommu:
 	release_resource(res);
diff --git a/include/linux/ioport.h b/include/linux/ioport.h
index 535bd95..d489523 100644
--- a/include/linux/ioport.h
+++ b/include/linux/ioport.h
@@ -98,31 +98,34 @@ extern struct resource * ____request_res
 extern int release_resource(struct resource *new);
 extern __deprecated_for_modules int insert_resource(struct resource *parent, struct resource *new);
 extern int allocate_resource(struct resource *root, struct resource *new,
-			     unsigned long size,
-			     unsigned long min, unsigned long max,
-			     unsigned long align,
+			     resource_size_t size, resource_size_t min,
+			     resource_size_t max, resource_size_t align,
 			     void (*alignf)(void *, struct resource *,
-					    unsigned long, unsigned long),
+					    resource_size_t, resource_size_t),
 			     void *alignf_data);
-int adjust_resource(struct resource *res, unsigned long start,
-		    unsigned long size);
+int adjust_resource(struct resource *res, resource_size_t start,
+		    resource_size_t size);
 
 /* Convenience shorthand with allocation */
 #define request_region(start,n,name)	__request_region(&ioport_resource, (start), (n), (name))
 #define request_mem_region(start,n,name) __request_region(&iomem_resource, (start), (n), (name))
 #define rename_region(region, newname) do { (region)->name = (newname); } while (0)
 
-extern struct resource * __request_region(struct resource *, unsigned long start, unsigned long n, const char *name);
+extern struct resource * __request_region(struct resource *,
+					resource_size_t start,
+					resource_size_t n, const char *name);
 
 /* Compatibility cruft */
 #define release_region(start,n)	__release_region(&ioport_resource, (start), (n))
 #define check_mem_region(start,n)	__check_region(&iomem_resource, (start), (n))
 #define release_mem_region(start,n)	__release_region(&iomem_resource, (start), (n))
 
-extern int __check_region(struct resource *, unsigned long, unsigned long);
-extern void __release_region(struct resource *, unsigned long, unsigned long);
+extern int __check_region(struct resource *, resource_size_t, resource_size_t);
+extern void __release_region(struct resource *, resource_size_t,
+				resource_size_t);
 
-static inline int __deprecated check_region(unsigned long s, unsigned long n)
+static inline int __deprecated check_region(resource_size_t s,
+						resource_size_t n)
 {
 	return __check_region(&ioport_resource, s, n);
 }
diff --git a/kernel/resource.c b/kernel/resource.c
index 97a703f..ad90a70 100644
--- a/kernel/resource.c
+++ b/kernel/resource.c
@@ -151,8 +151,8 @@ #endif /* CONFIG_PROC_FS */
 /* Return the conflict entry if you can't request it */
 static struct resource * __request_resource(struct resource *root, struct resource *new)
 {
-	unsigned long start = new->start;
-	unsigned long end = new->end;
+	resource_size_t start = new->start;
+	resource_size_t end = new->end;
 	struct resource *tmp, **p;
 
 	if (end < start)
@@ -236,11 +236,10 @@ EXPORT_SYMBOL(release_resource);
  * Find empty slot in the resource tree given range and alignment.
  */
 static int find_resource(struct resource *root, struct resource *new,
-			 unsigned long size,
-			 unsigned long min, unsigned long max,
-			 unsigned long align,
+			 resource_size_t size, resource_size_t min,
+			 resource_size_t max, resource_size_t align,
 			 void (*alignf)(void *, struct resource *,
-					unsigned long, unsigned long),
+					resource_size_t, resource_size_t),
 			 void *alignf_data)
 {
 	struct resource *this = root->child;
@@ -282,11 +281,10 @@ static int find_resource(struct resource
  * Allocate empty slot in the resource tree given range and alignment.
  */
 int allocate_resource(struct resource *root, struct resource *new,
-		      unsigned long size,
-		      unsigned long min, unsigned long max,
-		      unsigned long align,
+		      resource_size_t size, resource_size_t min,
+		      resource_size_t max, resource_size_t align,
 		      void (*alignf)(void *, struct resource *,
-				     unsigned long, unsigned long),
+				     resource_size_t, resource_size_t),
 		      void *alignf_data)
 {
 	int err;
@@ -378,10 +376,10 @@ EXPORT_SYMBOL(insert_resource);
  * arguments.  Returns -EBUSY if it can't fit.  Existing children of
  * the resource are assumed to be immutable.
  */
-int adjust_resource(struct resource *res, unsigned long start, unsigned long size)
+int adjust_resource(struct resource *res, resource_size_t start, resource_size_t size)
 {
 	struct resource *tmp, *parent = res->parent;
-	unsigned long end = start + size - 1;
+	resource_size_t end = start + size - 1;
 	int result = -EBUSY;
 
 	write_lock(&resource_lock);
@@ -428,7 +426,9 @@ EXPORT_SYMBOL(adjust_resource);
  *
  * Release-region releases a matching busy region.
  */
-struct resource * __request_region(struct resource *parent, unsigned long start, unsigned long n, const char *name)
+struct resource * __request_region(struct resource *parent,
+				   resource_size_t start, resource_size_t n,
+				   const char *name)
 {
 	struct resource *res = kzalloc(sizeof(*res), GFP_KERNEL);
 
@@ -464,7 +464,8 @@ struct resource * __request_region(struc
 
 EXPORT_SYMBOL(__request_region);
 
-int __check_region(struct resource *parent, unsigned long start, unsigned long n)
+int __check_region(struct resource *parent, resource_size_t start,
+			resource_size_t n)
 {
 	struct resource * res;
 
@@ -479,10 +480,11 @@ int __check_region(struct resource *pare
 
 EXPORT_SYMBOL(__check_region);
 
-void __release_region(struct resource *parent, unsigned long start, unsigned long n)
+void __release_region(struct resource *parent, resource_size_t start,
+			resource_size_t n)
 {
 	struct resource **p;
-	unsigned long end;
+	resource_size_t end;
 
 	p = &parent->child;
 	end = start + n - 1;
-- 
1.4.0


  reply	other threads:[~2006-06-13  0:35 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-13  0:30 Reworked 64bit resource patches Greg KH
2006-06-13  0:31 ` [PATCH 01/16] 64bit resource: C99 changes for struct resource declarations Greg KH
2006-06-13  0:31   ` [PATCH 02/16] 64bit resource: fix up printks for resources in sound drivers Greg KH
2006-06-13  0:31     ` [PATCH 03/16] 64bit resource: fix up printks for resources in networks drivers Greg KH
2006-06-13  0:31       ` [PATCH 04/16] 64bit resource: fix up printks for resources in pci core and hotplug drivers Greg KH
2006-06-13  0:31         ` [PATCH 05/16] 64bit resource: fix up printks for resources in mtd drivers Greg KH
2006-06-13  0:31           ` [PATCH 06/16] 64bit resource: fix up printks for resources in ide drivers Greg KH
2006-06-13  0:31             ` [PATCH 07/16] 64bit resource: fix up printks for resources in video drivers Greg KH
2006-06-13  0:31               ` [PATCH 08/16] 64bit resource: fix up printks for resources in pcmcia drivers Greg KH
2006-06-13  0:31                 ` [PATCH 09/16] 64bit resource: fix up printks for resources in arch and core code Greg KH
2006-06-13  0:31                   ` [PATCH 10/16] 64bit resource: fix up printks for resources in misc drivers Greg KH
2006-06-13  0:31                     ` [PATCH 11/16] 64bit resource: introduce resource_size_t for the start and end of struct resource Greg KH
2006-06-13  0:31                       ` Greg KH [this message]
2006-06-13  0:31                         ` [PATCH 15/16] 64bit resource: change pci core and arch code to use resource_size_t Greg KH
2006-06-13  0:31                           ` [PATCH 14/16] 64bit resource: change pnp core " Greg KH
2006-06-13  0:31                             ` [PATCH 15/16] 64bit Resource: convert a few remaining drivers to use resource_size_t where needed Greg KH
2006-06-13  0:31                               ` [PATCH 16/16] 64bit Resource: finally enable 64bit resource sizes Greg KH
2006-06-14 12:20                                 ` Geert Uytterhoeven
2006-06-14 23:35                                   ` Greg KH
2006-06-15  4:28                                     ` Vivek Goyal
2006-06-15 11:47                                       ` Geert Uytterhoeven
2006-06-15 15:56                                         ` Vivek Goyal
2006-06-16  1:35                                           ` Greg KH
2006-06-16 20:16                                             ` Vivek Goyal
2006-06-17 14:34                                               ` Geert Uytterhoeven
2006-06-18 18:05                                                 ` Vivek Goyal
2006-06-19  8:05                                                   ` Geert Uytterhoeven
2006-06-19 10:17                                                     ` Roman Zippel
2006-06-19 11:08                                                       ` Geert Uytterhoeven
2006-06-19 11:34                                                         ` Roman Zippel
2006-06-19 11:45                                                           ` Geert Uytterhoeven
2006-06-19 13:57                                                       ` Vivek Goyal
2006-06-13 16:24       ` [PATCH 03/16] 64bit resource: fix up printks for resources in networks drivers Jesse Brandeburg
2006-06-13 16:30         ` Greg KH

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=11501587193060-git-send-email-greg@kroah.com \
    --to=greg@kroah.com \
    --cc=gregkh@suse.de \
    --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