From: Zdenek S. <st...@us...> - 2012-02-09 12:22:40
|
Update of /cvsroot/ipmitool/ipmitool/lib In directory vz-cvs-4.sog:/tmp/cvs-serv13351/lib Modified Files: ipmi_lanp.c Log Message: Feature Requests item #3486218 - remove bloat in 'lib/ipmi_lanp.c' Commit removes bloat code in ipmi_lan_stats_clear() in 'lib/ipmi_lanp.c' and replaces duplicate code with call to is_lan_channel(). Index: ipmi_lanp.c =================================================================== RCS file: /cvsroot/ipmitool/ipmitool/lib/ipmi_lanp.c,v retrieving revision 1.59 retrieving revision 1.60 diff -C2 -d -r1.59 -r1.60 *** ipmi_lanp.c 8 Feb 2012 15:31:00 -0000 1.59 --- ipmi_lanp.c 9 Feb 2012 12:22:37 -0000 1.60 *************** *** 2013,2017 **** ipmi_lan_stats_get(struct ipmi_intf * intf, uint8_t chan) { - uint8_t medium; int rc = 0; struct ipmi_rs * rsp; --- 2013,2016 ---- *************** *** 2020,2034 **** uint16_t statsTemp; ! if (chan < 1 || chan > IPMI_CHANNEL_NUMBER_MAX) { ! lprintf(LOG_ERR, "Invalid Channel %d", chan); ! return -1; ! } ! ! /* find type of channel and only accept 802.3 LAN */ ! medium = ipmi_get_channel_medium(intf, chan); ! if (medium != IPMI_CHANNEL_MEDIUM_LAN && ! medium != IPMI_CHANNEL_MEDIUM_LAN_OTHER) { ! lprintf(LOG_ERR, "Channel %d (%s) is not a LAN channel", ! chan, val2str(medium, ipmi_channel_medium_vals), medium); return -1; } --- 2019,2024 ---- uint16_t statsTemp; ! if (!is_lan_channel(intf, chan)) { ! lprintf(LOG_ERR, "Channel %d is not a LAN channel", chan); return -1; } |