Module Name: src Committed By: skrll Date: Sat Jan 26 07:52:17 UTC 2013
Modified Files: src/sys/dev/usb: if_smsc.c Log Message: Simplify the code by only checking for total_len < pktlen once. The second check was actually wrong - found by matt@ and clang. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/sys/dev/usb/if_smsc.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/usb/if_smsc.c diff -u src/sys/dev/usb/if_smsc.c:1.6 src/sys/dev/usb/if_smsc.c:1.7 --- src/sys/dev/usb/if_smsc.c:1.6 Tue Jan 22 12:40:43 2013 +++ src/sys/dev/usb/if_smsc.c Sat Jan 26 07:52:16 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: if_smsc.c,v 1.6 2013/01/22 12:40:43 jmcneill Exp $ */ +/* $NetBSD: if_smsc.c,v 1.7 2013/01/26 07:52:16 skrll Exp $ */ /* $OpenBSD: if_smsc.c,v 1.4 2012/09/27 12:38:11 jsg Exp $ */ /* $FreeBSD: src/sys/dev/usb/net/if_smsc.c,v 1.1 2012/08/15 04:03:55 gonzo Exp $ */ @@ -1295,11 +1295,7 @@ smsc_rxeof(usbd_xfer_handle xfer, usbd_p } buf += sizeof(rxhdr); - - if ((total_len - pktlen) < 0) - total_len = 0; - else - total_len -= pktlen; + total_len -= pktlen; m = smsc_newbuf(); if (m == NULL) {