usb: OHCI/EHCI-XLS: Use resource_size v3
authorThomas Meyer <thomas@m3y3r.de>
Sat, 12 Nov 2011 09:14:40 +0000 (10:14 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 15 Nov 2011 18:21:56 +0000 (10:21 -0800)
Use resource_size function on resource object
instead of explicit computation.

The semantic patch that makes this change is available
in scripts/coccinelle/api/resource_size.cocci.

Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/host/ehci-xls.c
drivers/usb/host/ohci-xls.c

index fe74bd6760187c221e79dae448005c07a25863be..1078d6746d27138250e9f4cbb82a0f5b4c299ba2 100644 (file)
@@ -69,7 +69,7 @@ int ehci_xls_probe_internal(const struct hc_driver *driver,
        }
 
        hcd->rsrc_start = res->start;
-       hcd->rsrc_len = res->end - res->start + 1;
+       hcd->rsrc_len = resource_size(res);
 
        if (!request_mem_region(hcd->rsrc_start, hcd->rsrc_len,
                                driver->description)) {
index a3a9c6f45b91a57e6f90e6047d50c19480fa9e24..a2247867af8691af341cf578c864bc86b40f5b77 100644 (file)
@@ -40,7 +40,7 @@ static int ohci_xls_probe_internal(const struct hc_driver *driver,
                goto err1;
        }
        hcd->rsrc_start = res->start;
-       hcd->rsrc_len = res->end - res->start + 1;
+       hcd->rsrc_len = resource_size(res);
 
        if (!request_mem_region(hcd->rsrc_start, hcd->rsrc_len,
                        driver->description)) {