[PATCH] 64bit resource: change pnp core to use resource_size_t
authorGreg Kroah-Hartman <gregkh@suse.de>
Tue, 13 Jun 2006 00:07:07 +0000 (17:07 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 27 Jun 2006 16:24:00 +0000 (09:24 -0700)
Based on a patch series originally from Vivek Goyal <vgoyal@in.ibm.com>

Cc: Vivek Goyal <vgoyal@in.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/pnp/interface.c
drivers/pnp/manager.c
drivers/pnp/resource.c
include/linux/pnp.h

index a2d8ce7..3163e3d 100644 (file)
@@ -264,7 +264,7 @@ static ssize_t pnp_show_current_resources(struct device *dmdev, struct device_at
                        if (pnp_port_flags(dev, i) & IORESOURCE_DISABLED)
                                pnp_printf(buffer," disabled\n");
                        else
-                               pnp_printf(buffer," 0x%lx-0x%lx\n",
+                               pnp_printf(buffer," 0x%llx-0x%llx\n",
                                                pnp_port_start(dev, i),
                                                pnp_port_end(dev, i));
                }
@@ -275,7 +275,7 @@ static ssize_t pnp_show_current_resources(struct device *dmdev, struct device_at
                        if (pnp_mem_flags(dev, i) & IORESOURCE_DISABLED)
                                pnp_printf(buffer," disabled\n");
                        else
-                               pnp_printf(buffer," 0x%lx-0x%lx\n",
+                               pnp_printf(buffer," 0x%llx-0x%llx\n",
                                                pnp_mem_start(dev, i),
                                                pnp_mem_end(dev, i));
                }
@@ -286,7 +286,7 @@ static ssize_t pnp_show_current_resources(struct device *dmdev, struct device_at
                        if (pnp_irq_flags(dev, i) & IORESOURCE_DISABLED)
                                pnp_printf(buffer," disabled\n");
                        else
-                               pnp_printf(buffer," %ld\n",
+                               pnp_printf(buffer," %lld\n",
                                                pnp_irq(dev, i));
                }
        }
@@ -296,7 +296,7 @@ static ssize_t pnp_show_current_resources(struct device *dmdev, struct device_at
                        if (pnp_dma_flags(dev, i) & IORESOURCE_DISABLED)
                                pnp_printf(buffer," disabled\n");
                        else
-                               pnp_printf(buffer," %ld\n",
+                               pnp_printf(buffer," %lld\n",
                                                pnp_dma(dev, i));
                }
        }
index 6fff109..1d7a5b8 100644 (file)
@@ -20,7 +20,8 @@ DECLARE_MUTEX(pnp_res_mutex);
 
 static int pnp_assign_port(struct pnp_dev *dev, struct pnp_port *rule, int idx)
 {
-       unsigned long *start, *end, *flags;
+       resource_size_t *start, *end;
+       unsigned long *flags;
 
        if (!dev || !rule)
                return -EINVAL;
@@ -63,7 +64,8 @@ static int pnp_assign_port(struct pnp_dev *dev, struct pnp_port *rule, int idx)
 
 static int pnp_assign_mem(struct pnp_dev *dev, struct pnp_mem *rule, int idx)
 {
-       unsigned long *start, *end, *flags;
+       resource_size_t *start, *end;
+       unsigned long *flags;
 
        if (!dev || !rule)
                return -EINVAL;
@@ -116,7 +118,8 @@ static int pnp_assign_mem(struct pnp_dev *dev, struct pnp_mem *rule, int idx)
 
 static int pnp_assign_irq(struct pnp_dev * dev, struct pnp_irq *rule, int idx)
 {
-       unsigned long *start, *end, *flags;
+       resource_size_t *start, *end;
+       unsigned long *flags;
        int i;
 
        /* IRQ priority: this table is good for i386 */
@@ -168,7 +171,8 @@ static int pnp_assign_irq(struct pnp_dev * dev, struct pnp_irq *rule, int idx)
 
 static int pnp_assign_dma(struct pnp_dev *dev, struct pnp_dma *rule, int idx)
 {
-       unsigned long *start, *end, *flags;
+       resource_size_t *start, *end;
+       unsigned long *flags;
        int i;
 
        /* DMA priority: this table is good for i386 */
@@ -582,7 +586,8 @@ int pnp_disable_dev(struct pnp_dev *dev)
  * @size: size of region
  *
  */
-void pnp_resource_change(struct resource *resource, unsigned long start, unsigned long size)
+void pnp_resource_change(struct resource *resource, resource_size_t start,
+                               resource_size_t size)
 {
        if (resource == NULL)
                return;
index 6ded527..7bb892f 100644 (file)
@@ -241,7 +241,7 @@ int pnp_check_port(struct pnp_dev * dev, int idx)
 {
        int tmp;
        struct pnp_dev *tdev;
-       unsigned long *port, *end, *tport, *tend;
+       resource_size_t *port, *end, *tport, *tend;
        port = &dev->res.port_resource[idx].start;
        end = &dev->res.port_resource[idx].end;
 
@@ -297,7 +297,7 @@ int pnp_check_mem(struct pnp_dev * dev, int idx)
 {
        int tmp;
        struct pnp_dev *tdev;
-       unsigned long *addr, *end, *taddr, *tend;
+       resource_size_t *addr, *end, *taddr, *tend;
        addr = &dev->res.mem_resource[idx].start;
        end = &dev->res.mem_resource[idx].end;
 
@@ -358,7 +358,7 @@ int pnp_check_irq(struct pnp_dev * dev, int idx)
 {
        int tmp;
        struct pnp_dev *tdev;
-       unsigned long * irq = &dev->res.irq_resource[idx].start;
+       resource_size_t * irq = &dev->res.irq_resource[idx].start;
 
        /* if the resource doesn't exist, don't complain about it */
        if (cannot_compare(dev->res.irq_resource[idx].flags))
@@ -423,7 +423,7 @@ int pnp_check_dma(struct pnp_dev * dev, int idx)
 #ifndef CONFIG_IA64
        int tmp;
        struct pnp_dev *tdev;
-       unsigned long * dma = &dev->res.dma_resource[idx].start;
+       resource_size_t * dma = &dev->res.dma_resource[idx].start;
 
        /* if the resource doesn't exist, don't complain about it */
        if (cannot_compare(dev->res.dma_resource[idx].flags))
index 93b0959..ab8a8dd 100644 (file)
@@ -389,7 +389,8 @@ int pnp_start_dev(struct pnp_dev *dev);
 int pnp_stop_dev(struct pnp_dev *dev);
 int pnp_activate_dev(struct pnp_dev *dev);
 int pnp_disable_dev(struct pnp_dev *dev);
-void pnp_resource_change(struct resource *resource, unsigned long start, unsigned long size);
+void pnp_resource_change(struct resource *resource, resource_size_t start,
+                               resource_size_t size);
 
 /* protocol helpers */
 int pnp_is_active(struct pnp_dev * dev);
@@ -434,7 +435,9 @@ static inline int pnp_start_dev(struct pnp_dev *dev) { return -ENODEV; }
 static inline int pnp_stop_dev(struct pnp_dev *dev) { return -ENODEV; }
 static inline int pnp_activate_dev(struct pnp_dev *dev) { return -ENODEV; }
 static inline int pnp_disable_dev(struct pnp_dev *dev) { return -ENODEV; }
-static inline void pnp_resource_change(struct resource *resource, unsigned long start, unsigned long size) { }
+static inline void pnp_resource_change(struct resource *resource,
+                                       resource_size_t start,
+                                       resource_size_t size) { }
 
 /* protocol helpers */
 static inline int pnp_is_active(struct pnp_dev * dev) { return 0; }