Skip to content

Commit

Permalink
USB: ohci-s3c2410: use resource_size()
Browse files Browse the repository at this point in the history
This patch uses the resource_size help function instead of
manually calculating the resource size. It can reduce the chance
of introducing off-by-one errors.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Jingoo Han authored and Greg Kroah-Hartman committed Apr 30, 2011
1 parent e7f8433 commit 3c86c07
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/usb/host/ohci-s3c2410.c
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ static int usb_hcd_s3c2410_probe (const struct hc_driver *driver,
return -ENOMEM;

hcd->rsrc_start = dev->resource[0].start;
hcd->rsrc_len = dev->resource[0].end - dev->resource[0].start + 1;
hcd->rsrc_len = resource_size(&dev->resource[0]);

if (!request_mem_region(hcd->rsrc_start, hcd->rsrc_len, hcd_name)) {
dev_err(&dev->dev, "request_mem_region failed\n");
Expand Down

0 comments on commit 3c86c07

Please sign in to comment.