Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/pad Open code min() so we don't need to find its pro...



details:   https://anonhg.NetBSD.org/src/rev/2373479d1eed
branches:  trunk
changeset: 993669:2373479d1eed
user:      kre <kre%NetBSD.org@localhost>
date:      Sun Sep 23 23:30:51 2018 +0000

description:
Open code min() so we don't need to find its prototype ...

diffstat:

 sys/dev/pad/pad.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (28 lines):

diff -r 31ffeaea0cd3 -r 2373479d1eed sys/dev/pad/pad.c
--- a/sys/dev/pad/pad.c Sun Sep 23 23:16:34 2018 +0000
+++ b/sys/dev/pad/pad.c Sun Sep 23 23:30:51 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pad.c,v 1.54 2018/09/23 21:18:30 nakayama Exp $ */
+/* $NetBSD: pad.c,v 1.55 2018/09/23 23:30:51 kre Exp $ */
 
 /*-
  * Copyright (c) 2007 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pad.c,v 1.54 2018/09/23 21:18:30 nakayama Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pad.c,v 1.55 2018/09/23 23:30:51 kre Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -387,7 +387,8 @@
                if (sc->sc_bytes_count >= BYTESTOSLEEP)
                        sc->sc_bytes_count -= BYTESTOSLEEP;
 
-               err = pad_get_block(sc, &pb, min(uio->uio_resid, PAD_BLKSIZE));
+               err = pad_get_block(sc, &pb,
+                   uio->uio_resid<PAD_BLKSIZE ? uio->uio_resid : PAD_BLKSIZE);
                if (!err) {
                        getmicrotime(&sc->sc_last);
                        sc->sc_bytes_count += pb.pb_len;



Home | Main Index | Thread Index | Old Index