Skip to content

Commit a2b091d

Browse files
petrvandrovecLinus Torvalds
authored andcommitted
[PATCH] Correctly report PnP 64bit resources
Change PnP resource handling code to use proper type for resource start and length. Fixes bogus regions reported in /proc/iomem. I've also made some pointer constant, as they are constant... Signed-off-by: Petr Vandrovec <petr@vandrovec.name> Cc: Bjorn Helgaas <bjorn.helgaas@hp.com> Cc: Adam Belay <ambx1@neo.rr.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 7479d2b commit a2b091d

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

‎drivers/pnp/system.c‎

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ static const struct pnp_device_id pnp_dev_table[] = {
2222
{ "", 0 }
2323
};
2424

25-
static void reserve_range(char *pnpid, int start, int end, int port)
25+
static void reserve_range(const char *pnpid, resource_size_t start, resource_size_t end, int port)
2626
{
2727
struct resource *res;
2828
char *regionid;
@@ -32,9 +32,9 @@ static void reserve_range(char *pnpid, int start, int end, int port)
3232
return;
3333
snprintf(regionid, 16, "pnp %s", pnpid);
3434
if (port)
35-
res = request_region(start,end-start+1,regionid);
35+
res = request_region(start, end-start+1, regionid);
3636
else
37-
res = request_mem_region(start,end-start+1,regionid);
37+
res = request_mem_region(start, end-start+1, regionid);
3838
if (res == NULL)
3939
kfree(regionid);
4040
else
@@ -45,12 +45,13 @@ static void reserve_range(char *pnpid, int start, int end, int port)
4545
* have double reservations.
4646
*/
4747
printk(KERN_INFO
48-
"pnp: %s: %s range 0x%x-0x%x %s reserved\n",
49-
pnpid, port ? "ioport" : "iomem", start, end,
48+
"pnp: %s: %s range 0x%llx-0x%llx %s reserved\n",
49+
pnpid, port ? "ioport" : "iomem",
50+
(unsigned long long)start, (unsigned long long)end,
5051
NULL != res ? "has been" : "could not be");
5152
}
5253

53-
static void reserve_resources_of_dev(struct pnp_dev *dev)
54+
static void reserve_resources_of_dev(const struct pnp_dev *dev)
5455
{
5556
int i;
5657

0 commit comments

Comments
 (0)