On Fri, Aug 24 2018, Ricardo Mestre <ser...@helheim.mooo.com> wrote: > Hi, > > smsc(4) needs a fix to an assignment which I found with cppcheck. FreeBSD also > made this change 2 years ago on rev 295608. > > OK?
This diff shouldn't change the semantics but it looks saner this way indeed. ok jca@ The return value of smsc_chip_init() isn't checked, should it be? > Index: if_smsc.c > =================================================================== > RCS file: /cvs/src/sys/dev/usb/if_smsc.c,v > retrieving revision 1.31 > diff -u -p -u -r1.31 if_smsc.c > --- if_smsc.c 29 Jul 2017 17:24:04 -0000 1.31 > +++ if_smsc.c 24 Aug 2018 10:31:21 -0000 > @@ -774,7 +774,7 @@ smsc_chip_init(struct smsc_softc *sc) > smsc_write_reg(sc, SMSC_PM_CTRL, SMSC_PM_CTRL_PHY_RST); > > if ((err = smsc_wait_for_bits(sc, SMSC_PM_CTRL, > - SMSC_PM_CTRL_PHY_RST) != 0)) { > + SMSC_PM_CTRL_PHY_RST)) != 0) { > smsc_warn_printf(sc, "timed-out waiting for phy reset to " > "complete\n"); > goto init_failed; > -- jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF DDCC 0DFA 74AE 1524 E7EE