mirror of
https://github.com/ipmitool/ipmitool.git
synced 2025-05-10 18:47:22 +00:00
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().
This commit is contained in:
parent
9d8aa74a54
commit
89243c2929
@ -2090,23 +2090,13 @@ ipmi_lan_stats_get(struct ipmi_intf * intf, uint8_t chan)
|
||||
static int
|
||||
ipmi_lan_stats_clear(struct ipmi_intf * intf, uint8_t chan)
|
||||
{
|
||||
uint8_t medium;
|
||||
int rc = 0;
|
||||
struct ipmi_rs * rsp;
|
||||
struct ipmi_rq req;
|
||||
uint8_t msg_data[2];
|
||||
|
||||
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);
|
||||
if (!is_lan_channel(intf, chan)) {
|
||||
lprintf(LOG_ERR, "Channel %d is not a LAN channel", chan);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user