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. NFC.
details: https://anonhg.NetBSD.org/src/rev/6dad280ff767
branches: trunk
changeset: 932754:6dad280ff767
user: skrll <skrll%NetBSD.org@localhost>
date: Fri May 15 06:26:44 2020 +0000
description:
Use howmany. NFC.
diffstat:
sys/dev/usb/usb_mem.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diffs (27 lines):
diff -r 221e5ee0176e -r 6dad280ff767 sys/dev/usb/usb_mem.c
--- a/sys/dev/usb/usb_mem.c Fri May 15 06:23:54 2020 +0000
+++ b/sys/dev/usb/usb_mem.c Fri May 15 06:26:44 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: usb_mem.c,v 1.76 2020/04/05 20:59:38 skrll Exp $ */
+/* $NetBSD: usb_mem.c,v 1.77 2020/05/15 06:26:44 skrll Exp $ */
/*
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: usb_mem.c,v 1.76 2020/04/05 20:59:38 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: usb_mem.c,v 1.77 2020/05/15 06:26:44 skrll Exp $");
#ifdef _KERNEL_OPT
#include "opt_usb.h"
@@ -152,7 +152,7 @@
/* Caller wants one segment */
b->nsegs = 1;
else
- b->nsegs = (size + (PAGE_SIZE-1)) / PAGE_SIZE;
+ b->nsegs = howmany(size, PAGE_SIZE);
b->segs = kmem_alloc(b->nsegs * sizeof(*b->segs), KM_SLEEP);
b->nsegs_alloc = b->nsegs;
Home |
Main Index |
Thread Index |
Old Index