On Thu, Jan 24, 2019 at 10:22:19PM +0200, Andy Shevchenko wrote:
> Instead of magic number use pre-defined constant for UUID binary and
> string representations.
> 
> While here, drop the implementation details of guid_t type.

This and the next patch are fine, I have them queued for 5.1.

I also changed the "17" in the string to %d with UUID_SIZE + 1, per
your comment.

Thanks,

-corey

> 
> Signed-off-by: Andy Shevchenko <andriy.shevche...@linux.intel.com>
> ---
>  drivers/char/ipmi/ipmi_msghandler.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/char/ipmi/ipmi_msghandler.c 
> b/drivers/char/ipmi/ipmi_msghandler.c
> index 5bc84fbbeee5..6a27fccd9f36 100644
> --- a/drivers/char/ipmi/ipmi_msghandler.c
> +++ b/drivers/char/ipmi/ipmi_msghandler.c
> @@ -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,7 +3148,7 @@ 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",
> -- 
> 2.20.1
> 


_______________________________________________
Openipmi-developer mailing list
Openipmi-developer@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openipmi-developer

Reply via email to