aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid
diff options
context:
space:
mode:
authorJulia Lawall <julia@diku.dk>2008-02-15 07:53:11 -0500
committerJiri Kosina <jkosina@suse.cz>2008-03-18 06:20:30 -0400
commit92c4a1b9f257a242866be13c7c61e7a40616ec52 (patch)
tree9021cca1fad5e8d7888222763695106571000618 /drivers/hid
parent790c9d8d87f15827a455b191924aee9b397ce2b1 (diff)
HID: Use DIV_ROUND_UP
The kernel.h macro DIV_ROUND_UP performs the computation (((n) + (d) - 1) / (d)) but is perhaps more readable. Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid')
-rw-r--r--drivers/hid/usbhid/hid-core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c
index b38e559b7a46..d95979f0e028 100644
--- a/drivers/hid/usbhid/hid-core.c
+++ b/drivers/hid/usbhid/hid-core.c
@@ -278,7 +278,7 @@ static int hid_submit_ctrl(struct hid_device *hid)
278 usbhid->urbctrl->pipe = usb_rcvctrlpipe(hid_to_usb_dev(hid), 0); 278 usbhid->urbctrl->pipe = usb_rcvctrlpipe(hid_to_usb_dev(hid), 0);
279 maxpacket = usb_maxpacket(hid_to_usb_dev(hid), usbhid->urbctrl->pipe, 0); 279 maxpacket = usb_maxpacket(hid_to_usb_dev(hid), usbhid->urbctrl->pipe, 0);
280 if (maxpacket > 0) { 280 if (maxpacket > 0) {
281 padlen = (len + maxpacket - 1) / maxpacket; 281 padlen = DIV_ROUND_UP(len, maxpacket);
282 padlen *= maxpacket; 282 padlen *= maxpacket;
283 if (padlen > usbhid->bufsize) 283 if (padlen > usbhid->bufsize)
284 padlen = usbhid->bufsize; 284 padlen = usbhid->bufsize;