Commit 16ccdb55 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Corey Minyard

ipmi: Use defined constant for UUID representation

Instead of magic number use pre-defined constant for UUID binary and
string representations.

While here, drop the implementation details of guid_t type.
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
[Also converted a "17" in the error string to UUID_SIZE + 1]
Signed-off-by: default avatarCorey Minyard <cminyard@mvista.com>
parent 83af4194
......@@ -2749,7 +2749,7 @@ static ssize_t guid_show(struct device *dev, struct device_attribute *attr,
if (!guid_set)
return -ENOENT;
return snprintf(buf, 38, "%pUl\n", guid.b);
return snprintf(buf, UUID_STRING_LEN + 1 + 1, "%pUl\n", &guid);
}
static DEVICE_ATTR_RO(guid);
......@@ -3148,11 +3148,11 @@ static void guid_handler(struct ipmi_smi *intf, struct ipmi_recv_msg *msg)
goto out;
}
if (msg->msg.data_len < 17) {
if (msg->msg.data_len < UUID_SIZE + 1) {
bmc->dyn_guid_set = 0;
dev_warn(intf->si_dev,
"The GUID response from the BMC was too short, it was %d but should have been 17. Assuming GUID is not available.\n",
msg->msg.data_len);
"The GUID response from the BMC was too short, it was %d but should have been %d. Assuming GUID is not available.\n",
msg->msg.data_len, UUID_SIZE + 1);
goto out;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment