summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>2001-03-22 02:10:23 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>2001-03-22 02:10:23 +0000
commit44b8e549ef87f77e2b48c08e7c4994efeea39676 (patch)
tree8c7b3cc8da29e5016aca4b0f0eaa616e9edd7a73 /sys/dev
parent67bd3d3844342e5a897099cc9fb69cd6d28d89ed (diff)
contify usbdevs a little
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/usb/usb_subr.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/sys/dev/usb/usb_subr.c b/sys/dev/usb/usb_subr.c
index 2f4c7b5db4f..2d23497ce17 100644
--- a/sys/dev/usb/usb_subr.c
+++ b/sys/dev/usb/usb_subr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: usb_subr.c,v 1.16 2001/01/28 09:43:42 aaron Exp $ */
+/* $OpenBSD: usb_subr.c,v 1.17 2001/03/22 02:10:22 mickey Exp $ */
/* $NetBSD: usb_subr.c,v 1.72 2000/04/14 14:13:56 augustss Exp $ */
/* $FreeBSD: src/sys/dev/usb/usb_subr.c,v 1.18 1999/11/17 22:33:47 n_hibma Exp $ */
@@ -103,13 +103,13 @@ typedef u_int16_t usb_product_id_t;
*/
struct usb_known_vendor {
usb_vendor_id_t vendor;
- char *vendorname;
+ const char *vendorname;
};
struct usb_known_product {
usb_vendor_id_t vendor;
usb_product_id_t product;
- char *productname;
+ const char *productname;
};
#include <dev/usb/usbdevs_data.h>
@@ -213,23 +213,25 @@ usbd_get_string(usbd_device_handle dev, int si, char *buf)
return (buf);
}
-static void
+static char *
usbd_trim_trailings_spaces(char *p)
{
- char *q;
+ char *q, *r;
if (p == NULL)
- return;
+ return NULL;
+ r = p;
q = p + strlen(p);
while (--q >= p && *q == ' ')
*q = 0;
+ return r;
}
void
usbd_devinfo_vp(usbd_device_handle dev, char *v, char *p, int usedev)
{
usb_device_descriptor_t *udd = &dev->ddesc;
- char *vendor = 0, *product = 0;
+ const char *vendor = NULL, *product = NULL;
#ifdef USBVERBOSE
const struct usb_known_vendor *ukv;
const struct usb_known_product *ukp;
@@ -241,10 +243,10 @@ usbd_devinfo_vp(usbd_device_handle dev, char *v, char *p, int usedev)
}
if (usedev) {
- vendor = usbd_get_string(dev, udd->iManufacturer, v);
- usbd_trim_trailings_spaces(vendor);
- product = usbd_get_string(dev, udd->iProduct, p);
- usbd_trim_trailings_spaces(product);
+ vendor = usbd_trim_trailings_spaces(
+ usbd_get_string(dev, udd->iManufacturer, v));
+ product = usbd_trim_trailings_spaces(
+ usbd_get_string(dev, udd->iProduct, p));
} else {
vendor = NULL;
product = NULL;