extra zero'ing of variables not needed because softc is pre-zero'd.
ok jsg
-/* $OpenBSD: uchcom.c,v 1.25 2016/09/02 09:14:59 mpi Exp $ */
+/* $OpenBSD: uchcom.c,v 1.26 2017/04/06 04:48:54 deraadt Exp $ */
/* $NetBSD: uchcom.c,v 1.1 2007/09/03 17:57:37 tshiozak Exp $ */
/*
sc->sc_udev = dev;
sc->sc_dtr = sc->sc_rts = -1;
- sc->sc_lsr = sc->sc_msr = 0;
DPRINTF(("\n\nuchcom attach: sc=%p\n", sc));
-/* $OpenBSD: ucycom.c,v 1.34 2016/01/09 04:14:42 jcs Exp $ */
+/* $OpenBSD: ucycom.c,v 1.35 2017/04/06 04:48:54 deraadt Exp $ */
/* $NetBSD: ucycom.c,v 1.3 2005/08/05 07:27:47 skrll Exp $ */
/*
sc->sc_udev = dev;
- sc->sc_msr = sc->sc_mcr = 0;
-
err = uhidev_open(&sc->sc_hdev);
if (err) {
DPRINTF(("ucycom_open: uhidev_open %d\n", err));
/* bulkin, bulkout set above */
bzero(&uca, sizeof uca);
uca.bulkin = uca.bulkout = -1;
- uca.uhidev = sc->sc_hdev.sc_parent;
uca.ibufsize = sc->sc_ilen - 1;
uca.obufsize = sc->sc_olen - 1;
uca.ibufsizepad = 1;
uca.opkthdrlen = 0;
+ uca.uhidev = sc->sc_hdev.sc_parent;
uca.device = uaa->device;
uca.iface = uaa->iface;
uca.methods = &ucycom_methods;
-/* $OpenBSD: uslhcom.c,v 1.4 2016/01/09 04:14:42 jcs Exp $ */
+/* $OpenBSD: uslhcom.c,v 1.5 2017/04/06 04:48:54 deraadt Exp $ */
/*
* Copyright (c) 2015 SASANO Takayoshi <uaa@openbsd.org>
int err, repid, size, rsize;
void *desc;
- sc->sc_udev = dev;
- sc->sc_lsr = sc->sc_msr = 0;
sc->sc_hdev.sc_intr = uslhcom_intr;
sc->sc_hdev.sc_parent = uha->parent;
sc->sc_hdev.sc_report_id = uha->reportid;
- sc->sc_hdev.sc_isize = sc->sc_hdev.sc_osize = sc->sc_hdev.sc_fsize = 0;
uhidev_get_report_desc(uha->parent, &desc, &size);
for (repid = 0; repid < uha->parent->sc_nrepid; repid++) {
printf("\n");
+ sc->sc_udev = dev;
+
err = uhidev_open(&sc->sc_hdev);
if (err) {
DPRINTF(("uslhcom_attach: uhidev_open %d\n", err));
version.product_id, version.product_revision);
/* setup ucom layer */
+ bzero(&uca, sizeof uca);
uca.portno = UCOM_UNK_PORTNO;
uca.bulkin = uca.bulkout = -1;
uca.ibufsize = uca.ibufsizepad = 0;