summaryrefslogtreecommitdiff
path: root/sys/dev/usb
diff options
context:
space:
mode:
authorchristos <christos@NetBSD.org>2016-05-02 19:18:29 +0000
committerchristos <christos@NetBSD.org>2016-05-02 19:18:29 +0000
commitd591b4e8741370bd42e79d22ed4da3f966edb669 (patch)
tree569fca075f4a14393f3a043c914a43f8ba82b500 /sys/dev/usb
parent0da5af96a0e50d94b3caf3b0f7da1563aeb673af (diff)
move scsipi_strvis -> libkern:strnvisx()
change the prototype to match userland fix sizes of strings passed to it
Diffstat (limited to 'sys/dev/usb')
-rw-r--r--sys/dev/usb/umass_scsipi.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/sys/dev/usb/umass_scsipi.c b/sys/dev/usb/umass_scsipi.c
index 68ad318df87..613d4dceabb 100644
--- a/sys/dev/usb/umass_scsipi.c
+++ b/sys/dev/usb/umass_scsipi.c
@@ -1,4 +1,4 @@
-/* $NetBSD: umass_scsipi.c,v 1.50 2016/04/23 10:15:32 skrll Exp $ */
+/* $NetBSD: umass_scsipi.c,v 1.51 2016/05/02 19:18:29 christos Exp $ */
/*
* Copyright (c) 2001, 2003, 2012 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: umass_scsipi.c,v 1.50 2016/04/23 10:15:32 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: umass_scsipi.c,v 1.51 2016/05/02 19:18:29 christos Exp $");
#ifdef _KERNEL_OPT
#include "opt_usb.h"
@@ -555,9 +555,12 @@ umass_atapi_probe_device(struct atapibus_softc *atapi, int target)
return;
}
- scsipi_strvis(vendor, 33, inqbuf.vendor, 8);
- scsipi_strvis(product, 65, inqbuf.product, 16);
- scsipi_strvis(revision, 17, inqbuf.revision, 4);
+ strnvisx(vendor, sizeof(vendor), inqbuf.vendor, 8,
+ VIS_TRIM|VIS_SAFE|VIS_OCTAL);
+ strnvisx(product, sizeof(product), inqbuf.product, 16,
+ VIS_TRIM|VIS_SAFE|VIS_OCTAL);
+ strnvisx(revision, sizeof(revision), inqbuf.revision, 4,
+ VIS_TRIM|VIS_SAFE|VIS_OCTAL);
sa.sa_periph = periph;
sa.sa_inqbuf.type = inqbuf.device;