lkml.org 
[lkml]   [2021]   [Oct]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v5 4/4] tools: Introduce power/acpi/pfru/pfru
On Sat, Oct 23, 2021 at 01:10:32AM +0800, Chen Yu wrote:
> Introduce a user space tool to make use of the interface exposed by
> Platform Firmware Runtime Update and Telemetry drivers. The users
> can use this tool to do firmware code injection, driver update and
> to retrieve the telemetry data.

...

> #include <linux/ioctl.h>
> +#ifdef __KERNEL__
> #include <linux/uuid.h>
> +#else
> +#include <uuid/uuid.h>
> +#include <linux/types.h>
> +#endif

This is exactly my point why you mustn't use uuid.h in uAPI headers.

...

> + while (1) {

Why not while ((c = getopt_long(...)) != -1) ?

> + int option_index = 0;
> +
> + c = getopt_long(argc, argv, option_string,
> + long_options, &option_index);
> + if (c == -1)
> + break;

> + }
> + }
> +}

...

> + char *uuid = malloc(37);

libuuid doesn't have helpers for this?

Split assignment so if will be closer to its user.

> + if (!uuid) {
> + perror("Can not allocate uuid buffer\n");
> + exit(1);
> + }

--
With Best Regards,
Andy Shevchenko


\
 
 \ /
  Last update: 2021-10-22 22:13    [W:0.078 / U:0.344 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site