summaryrefslogtreecommitdiff
path: root/lib/ipmi_lanp6.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2022-09-10 15:44:42 +0200
committerJörg Frings-Fürst <debian@jff-webhosting.net>2022-09-10 15:44:42 +0200
commitd83fb6dd0cdb8d4509fda0c6e77bbeb0fcd018a8 (patch)
tree2599d2b8a9e660bff139cbd2a32d777ad30e0c9d /lib/ipmi_lanp6.c
parent36a24e9032591da8cc7688f69e7e9f5f41ffe4ab (diff)
parenta9ee361f27e0439530387765924574e5358c8a5c (diff)
Update upstream source from tag 'upstream/1.8.19'
Update to upstream version '1.8.19' with Debian dir 820184ee2ea8eb8c4a7769d0a89d5236e5775134
Diffstat (limited to 'lib/ipmi_lanp6.c')
-rw-r--r--lib/ipmi_lanp6.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/lib/ipmi_lanp6.c b/lib/ipmi_lanp6.c
index bbffb89..4af6d8b 100644
--- a/lib/ipmi_lanp6.c
+++ b/lib/ipmi_lanp6.c
@@ -333,7 +333,7 @@ ipmi_lanp_err(const struct ipmi_rs *rsp, const struct ipmi_lanp *p,
int log_level = LOG_ERR;
int err;
- if (rsp == NULL) {
+ if (!rsp) {
reason = "No response";
err = -1;
} else {
@@ -354,7 +354,7 @@ ipmi_lanp_err(const struct ipmi_rs *rsp, const struct ipmi_lanp *p,
reason = val2str(rsp->ccode, lanp_cc_vals);
}
- if (reason == NULL) {
+ if (!reason) {
/* print completion code value */
snprintf(cc_msg, sizeof(cc_msg), "CC=%02x", rsp->ccode);
reason = cc_msg;
@@ -403,7 +403,7 @@ ipmi_get_dynamic_oem_lanp(void *priv, const struct ipmi_lanp *param,
param->name, set_selector, block_selector);
rsp = lp->intf->sendrecv(lp->intf, &req);
- if (rsp == NULL || rsp->ccode) {
+ if (!rsp || rsp->ccode) {
return ipmi_lanp_err(rsp, param, "get", quiet);
}
@@ -467,7 +467,7 @@ ipmi_set_dynamic_oem_lanp(void *priv, const struct ipmi_lanp *param,
lprintf(LOG_INFO, "Setting parameter '%s'", param->name);
rsp = lp->intf->sendrecv(lp->intf, &req);
- if (rsp == NULL || rsp->ccode) {
+ if (!rsp || rsp->ccode) {
return ipmi_lanp_err(rsp, param, "set", 0);
}
@@ -1027,9 +1027,7 @@ static void lanp_print_usage(int cmd)
printf("\n available parameters:\n");
/* 'save' shall use 'write' filter, since it outputs a block
* of 'set's */
- ipmi_cfgp_usage(lan_cfgp,
- sizeof(lan_cfgp)/sizeof(lan_cfgp[0]),
- cmd != LANP_CMD_PRINT);
+ ipmi_cfgp_usage(lan_cfgp, ARRAY_SIZE(lan_cfgp), cmd != LANP_CMD_PRINT);
}
}
@@ -1161,8 +1159,8 @@ ipmi_lan6_main(struct ipmi_intf *intf, int argc, char **argv)
*/
ipmi_cfgp_init(&ctx, lan_cfgp,
- sizeof(lan_cfgp)/sizeof(lan_cfgp[0]), "lan6 set nolock",
- lanp_ip6_cfgp, &lp);
+ ARRAY_SIZE(lan_cfgp), "lan6 set nolock",
+ lanp_ip6_cfgp, &lp);
ret = ipmi_cfgp_parse_sel(&ctx, argc, (const char **)argv, &sel);
if (ret == -1) {