Author: araujo Date: Wed Apr 27 02:02:44 2016 New Revision: 298681 URL: https://svnweb.freebsd.org/changeset/base/298681
Log: Use macro MIN() from sys/param.h. MFC after: 2 weeks. Modified: head/sbin/ifconfig/sfp.c Modified: head/sbin/ifconfig/sfp.c ============================================================================== --- head/sbin/ifconfig/sfp.c Wed Apr 27 01:36:25 2016 (r298680) +++ head/sbin/ifconfig/sfp.c Wed Apr 27 02:02:44 2016 (r298681) @@ -738,7 +738,7 @@ read_i2c(struct i2c_info *ii, uint8_t ad req.len = len; while (len > 0) { - l = (len > sizeof(req.data)) ? sizeof(req.data) : len; + l = MIN(sizeof(req.data), len); req.len = l; if (ioctl(ii->fd, SIOCGI2C, ii->ifr) != 0) { ii->error = errno; @@ -762,7 +762,7 @@ dump_i2c_data(struct i2c_info *ii, uint8 while (len > 0) { memset(buf, 0, sizeof(buf)); - read = (len > sizeof(buf)) ? sizeof(buf) : len; + read = MIN(sizeof(buf), len); read_i2c(ii, addr, off, read, buf); if (ii->error != 0) { fprintf(stderr, "Error reading i2c info\n"); _______________________________________________ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"