diff options
author | 2010-12-17 13:48:06 +0000 | |
---|---|---|
committer | 2010-12-17 13:48:06 +0000 | |
commit | 64ad96997e6dfd048b61b6207b8f7e95e5aca6f7 (patch) | |
tree | ef9bc2069d782867e5b078cb17fe5feab1b98263 | |
parent | Unbreak simple passwords with SHA and salted SHA hashes. Revision 1.7 (diff) | |
download | wireguard-openbsd-64ad96997e6dfd048b61b6207b8f7e95e5aca6f7.tar.xz wireguard-openbsd-64ad96997e6dfd048b61b6207b8f7e95e5aca6f7.zip |
- use usb_lookup() instead of handrolled macro.
ok jakemsr@
-rw-r--r-- | sys/dev/usb/if_cue.c | 7 | ||||
-rw-r--r-- | sys/dev/usb/if_kue.c | 7 | ||||
-rw-r--r-- | sys/dev/usb/if_upl.c | 20 |
3 files changed, 11 insertions, 23 deletions
diff --git a/sys/dev/usb/if_cue.c b/sys/dev/usb/if_cue.c index 401c775544b..16959425ceb 100644 --- a/sys/dev/usb/if_cue.c +++ b/sys/dev/usb/if_cue.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_cue.c,v 1.57 2010/12/06 04:41:39 jakemsr Exp $ */ +/* $OpenBSD: if_cue.c,v 1.58 2010/12/17 13:48:06 jasper Exp $ */ /* $NetBSD: if_cue.c,v 1.40 2002/07/11 21:14:26 augustss Exp $ */ /* * Copyright (c) 1997, 1998, 1999, 2000 @@ -107,7 +107,6 @@ struct usb_devno cue_devs[] = { { USB_VENDOR_SMARTBRIDGES, USB_PRODUCT_SMARTBRIDGES_SMARTLINK }, /* Belkin F5U111 adapter covered by NETMATE entry */ }; -#define cue_lookup(v, p) (usb_lookup(cue_devs, v, p)) int cue_match(struct device *, void *, void *); void cue_attach(struct device *, struct device *, void *); @@ -434,8 +433,8 @@ cue_match(struct device *parent, void *match, void *aux) if (uaa->iface != NULL) return (UMATCH_NONE); - return (cue_lookup(uaa->vendor, uaa->product) != NULL ? - UMATCH_VENDOR_PRODUCT : UMATCH_NONE); + return (usb_lookup(cue_devs, uaa->vendor, uaa->product) != NULL ? + UMATCH_VENDOR_PRODUCT : UMATCH_NONE); } /* diff --git a/sys/dev/usb/if_kue.c b/sys/dev/usb/if_kue.c index ccf0b8fe8e0..43cc076aab4 100644 --- a/sys/dev/usb/if_kue.c +++ b/sys/dev/usb/if_kue.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_kue.c,v 1.61 2010/10/27 17:51:11 jakemsr Exp $ */ +/* $OpenBSD: if_kue.c,v 1.62 2010/12/17 13:48:06 jasper Exp $ */ /* $NetBSD: if_kue.c,v 1.50 2002/07/16 22:00:31 augustss Exp $ */ /* * Copyright (c) 1997, 1998, 1999, 2000 @@ -152,7 +152,6 @@ const struct usb_devno kue_devs[] = { { USB_VENDOR_SILICOM, USB_PRODUCT_SILICOM_GPE }, { USB_VENDOR_SMC, USB_PRODUCT_SMC_2102USB }, }; -#define kue_lookup(v, p) (usb_lookup(kue_devs, v, p)) int kue_match(struct device *, void *, void *); void kue_attach(struct device *, struct device *, void *); @@ -408,8 +407,8 @@ kue_match(struct device *parent, void *match, void *aux) if (uaa->iface != NULL) return (UMATCH_NONE); - return (kue_lookup(uaa->vendor, uaa->product) != NULL ? - UMATCH_VENDOR_PRODUCT : UMATCH_NONE); + return (usb_lookup(kue_devs, uaa->vendor, uaa->product) != NULL ? + UMATCH_VENDOR_PRODUCT : UMATCH_NONE); } void diff --git a/sys/dev/usb/if_upl.c b/sys/dev/usb/if_upl.c index 0c91e0773a1..4dd1d3f2391 100644 --- a/sys/dev/usb/if_upl.c +++ b/sys/dev/usb/if_upl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_upl.c,v 1.45 2010/12/06 05:46:17 jakemsr Exp $ */ +/* $OpenBSD: if_upl.c,v 1.46 2010/12/17 13:48:06 jasper Exp $ */ /* $NetBSD: if_upl.c,v 1.19 2002/07/11 21:14:26 augustss Exp $ */ /* * Copyright (c) 2000 The NetBSD Foundation, Inc. @@ -104,11 +104,6 @@ #define UPL_ENDPT_INTR 0x2 #define UPL_ENDPT_MAX 0x3 -struct upl_type { - u_int16_t upl_vid; - u_int16_t upl_did; -}; - struct upl_softc; struct upl_chain { @@ -163,10 +158,9 @@ int upldebug = 0; /* * Various supported device vendors/products. */ -struct upl_type sc_devs[] = { +struct usb_devno upl_devs[] = { { USB_VENDOR_PROLIFIC, USB_PRODUCT_PROLIFIC_PL2301 }, - { USB_VENDOR_PROLIFIC, USB_PRODUCT_PROLIFIC_PL2302 }, - { 0, 0 } + { USB_VENDOR_PROLIFIC, USB_PRODUCT_PROLIFIC_PL2302 } }; int upl_match(struct device *, void *, void *); @@ -211,16 +205,12 @@ int upl_match(struct device *parent, void *match, void *aux) { struct usb_attach_arg *uaa = aux; - struct upl_type *t; if (uaa->iface != NULL) return (UMATCH_NONE); - for (t = sc_devs; t->upl_vid != 0; t++) - if (uaa->vendor == t->upl_vid && uaa->product == t->upl_did) - return (UMATCH_VENDOR_PRODUCT); - - return (UMATCH_NONE); + return (usb_lookup(upl_devs, uaa->vendor, uaa->product) != NULL ? + UMATCH_VENDOR_PRODUCT : UMATCH_NONE); } void |