mirror of
https://github.com/ipmitool/ipmitool.git
synced 2026-06-28 16:21:35 +00:00
Refactoring: optimize pointer checks
Remove all direct comparisons to 'NULL' for pointers. Replace them with boolean-like 'if (ptr)' and 'if (!ptr)'. This makes conditions shorter and easier to read. Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
This commit is contained in:
@@ -288,7 +288,7 @@ ipmi_get_session_info(struct ipmi_intf * intf,
|
||||
}
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (rsp == NULL)
|
||||
if (!rsp)
|
||||
{
|
||||
lprintf(LOG_ERR, "Get Session Info command failed");
|
||||
retval = -1;
|
||||
@@ -322,7 +322,7 @@ ipmi_get_session_info(struct ipmi_intf * intf,
|
||||
rqdata[0] = i++;
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
|
||||
if (rsp == NULL)
|
||||
if (!rsp)
|
||||
{
|
||||
lprintf(LOG_ERR, "Get Session Info command failed");
|
||||
retval = -1;
|
||||
|
||||
Reference in New Issue
Block a user