summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/amd64/amd64/nvram.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/arch/amd64/amd64/nvram.c b/sys/arch/amd64/amd64/nvram.c
index c3aa137e234..3cdb28beed1 100644
--- a/sys/arch/amd64/amd64/nvram.c
+++ b/sys/arch/amd64/amd64/nvram.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nvram.c,v 1.3 2015/03/14 03:38:46 jsg Exp $ */
+/* $OpenBSD: nvram.c,v 1.4 2015/05/11 01:56:26 guenther Exp $ */
/*
* Copyright (c) 2004 Joshua Stein <jcs@openbsd.org>
@@ -94,7 +94,7 @@ nvramread(dev_t dev, struct uio *uio, int flags)
u_char buf[NVRAM_SIZE];
u_int pos = uio->uio_offset;
u_char *tmp;
- int count = min(sizeof(buf), uio->uio_resid);
+ size_t count = ulmin(sizeof(buf), uio->uio_resid);
int ret;
if (!nvram_initialized)
@@ -104,17 +104,17 @@ nvramread(dev_t dev, struct uio *uio, int flags)
return (0);
#ifdef NVRAM_DEBUG
- printf("attempting to read %d bytes at offset %d\n", count, pos);
+ printf("attempting to read %zu bytes at offset %d\n", count, pos);
#endif
for (tmp = buf; count-- > 0 && pos < NVRAM_SIZE; ++pos, ++tmp)
*tmp = nvram_get_byte(pos);
#ifdef NVRAM_DEBUG
- printf("nvramread read %d bytes (%s)\n", (tmp - buf), tmp);
+ printf("nvramread read %td bytes (%s)\n", (tmp - buf), tmp);
#endif
- ret = uiomovei((caddr_t)buf, (tmp - buf), uio);
+ ret = uiomove(buf, (tmp - buf), uio);
uio->uio_offset += uio->uio_resid;