Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/usb Use howmany. NFCI.
details: https://anonhg.NetBSD.org/src/rev/98d60e20798d
branches: trunk
changeset: 849825:98d60e20798d
user: skrll <skrll%NetBSD.org@localhost>
date: Sun Mar 15 13:59:20 2020 +0000
description:
Use howmany. NFCI.
diffstat:
sys/dev/usb/uhci.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diffs (36 lines):
diff -r ffe92185e4a0 -r 98d60e20798d sys/dev/usb/uhci.c
--- a/sys/dev/usb/uhci.c Sun Mar 15 13:54:28 2020 +0000
+++ b/sys/dev/usb/uhci.c Sun Mar 15 13:59:20 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: uhci.c,v 1.296 2020/03/14 02:35:33 christos Exp $ */
+/* $NetBSD: uhci.c,v 1.297 2020/03/15 13:59:20 skrll Exp $ */
/*
* Copyright (c) 1998, 2004, 2011, 2012 The NetBSD Foundation, Inc.
@@ -42,7 +42,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uhci.c,v 1.296 2020/03/14 02:35:33 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uhci.c,v 1.297 2020/03/15 13:59:20 skrll Exp $");
#ifdef _KERNEL_OPT
#include "opt_usb.h"
@@ -2006,7 +2006,7 @@
printf("%s: maxp=0\n", __func__);
return EINVAL;
}
- size_t ntd = (len + maxp - 1) / maxp;
+ size_t ntd = howmany(len, maxp);
if (!rd && (flags & USBD_FORCE_SHORT_XFER)) {
ntd++;
}
@@ -3383,7 +3383,7 @@
if (ival > UHCI_VFRAMELIST_COUNT)
ival = UHCI_VFRAMELIST_COUNT;
- npoll = (UHCI_VFRAMELIST_COUNT + ival - 1) / ival;
+ npoll = howmany(UHCI_VFRAMELIST_COUNT, ival);
DPRINTF("ival=%jd npoll=%jd", ival, npoll, 0, 0);
upipe->intr.npoll = npoll;
Home |
Main Index |
Thread Index |
Old Index