> -----Original Message----- > From: Tobias Klauser [mailto:tklauser@xxxxxxxxxx] > Sent: Friday, January 22, 2010 12:26 AM > To: Dmitry Torokhov; linux-input@xxxxxxxxxxxxxxx; John Linn > Cc: Tobias Klauser > Subject: [PATCH] Input: xilinx_ps2 - Use resource_size > > Use the resource_size inline function instead of manually calculating > the resource size. > > Signed-off-by: Tobias Klauser <tklauser@xxxxxxxxxx> > --- > drivers/input/serio/xilinx_ps2.c | 4 ++-- > 1 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/input/serio/xilinx_ps2.c b/drivers/input/serio/xilinx_ps2.c > index ebb22f8..4d835e9 100644 > --- a/drivers/input/serio/xilinx_ps2.c > +++ b/drivers/input/serio/xilinx_ps2.c > @@ -270,7 +270,7 @@ static int __devinit xps2_of_probe(struct of_device *ofdev, > drvdata->irq = r_irq.start; > > phys_addr = r_mem.start; > - remap_size = r_mem.end - r_mem.start + 1; > + remap_size = resource_size(r_mem); > if (!request_mem_region(phys_addr, remap_size, DRIVER_NAME)) { > dev_err(dev, "Couldn't lock memory region at 0x%08llX\n", > (unsigned long long)phys_addr); > @@ -344,7 +344,7 @@ static int __devexit xps2_of_remove(struct of_device *of_dev) > if (of_address_to_resource(of_dev->node, 0, &r_mem)) > dev_err(dev, "invalid address\n"); > else > - release_mem_region(r_mem.start, r_mem.end - r_mem.start + 1); > + release_mem_region(r_mem.start, resource_size(r_mem)); > > kfree(drvdata); > > -- > 1.6.3.3 > Thanks for the patch. Acked-by: John Linn <john.linn@xxxxxxxxxx> This email and any attachments are intended for the sole use of the named recipient(s) and contain(s) confidential information that may be proprietary, privileged or copyrighted under applicable law. If you are not the intended recipient, do not read, copy, or forward this email message or any attachments. Delete this email message and any attachments immediately. -- To unsubscribe from this list: send the line "unsubscribe linux-input" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html