[PATCH v2 3/3] util/uuid: Remove UUID_FMT_LEN

Cédric Le Goater posted 3 patches 1 year, 1 month ago
[PATCH v2 3/3] util/uuid: Remove UUID_FMT_LEN
Posted by Cédric Le Goater 1 year, 1 month ago
Dangerous and now unused.

Cc: Fam Zheng <fam@euphon.net>
Signed-off-by: Cédric Le Goater <clg@redhat.com>
---
 include/qemu/uuid.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/include/qemu/uuid.h b/include/qemu/uuid.h
index 4e7afaf1d5bd5d382fefbd6f6275d69cf25e7483..356efe7b5797911640ed347fc08f4ef5ebbd0476 100644
--- a/include/qemu/uuid.h
+++ b/include/qemu/uuid.h
@@ -78,8 +78,7 @@ typedef struct {
                  "%02hhx%02hhx-" \
                  "%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx"
 
-#define UUID_FMT_LEN 36
-#define UUID_STR_LEN (UUID_FMT_LEN + 1)
+#define UUID_STR_LEN (36 + 1)
 
 #define UUID_NONE "00000000-0000-0000-0000-000000000000"
 
-- 
2.41.0


Re: [PATCH v2 3/3] util/uuid: Remove UUID_FMT_LEN
Posted by Juan Quintela 1 year, 1 month ago
Cédric Le Goater <clg@redhat.com> wrote:
> Dangerous and now unused.
>
> Cc: Fam Zheng <fam@euphon.net>
> Signed-off-by: Cédric Le Goater <clg@redhat.com>

Reviewed-by: Juan Quintela <quintela@redhat.com>
Re: [PATCH v2 3/3] util/uuid: Remove UUID_FMT_LEN
Posted by Philippe Mathieu-Daudé 1 year, 1 month ago
On 26/10/23 09:06, Cédric Le Goater wrote:
> Dangerous and now unused.
> 
> Cc: Fam Zheng <fam@euphon.net>
> Signed-off-by: Cédric Le Goater <clg@redhat.com>
> ---
>   include/qemu/uuid.h | 3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/include/qemu/uuid.h b/include/qemu/uuid.h
> index 4e7afaf1d5bd5d382fefbd6f6275d69cf25e7483..356efe7b5797911640ed347fc08f4ef5ebbd0476 100644
> --- a/include/qemu/uuid.h
> +++ b/include/qemu/uuid.h
> @@ -78,8 +78,7 @@ typedef struct {
>                    "%02hhx%02hhx-" \
>                    "%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx"
>   
> -#define UUID_FMT_LEN 36
> -#define UUID_STR_LEN (UUID_FMT_LEN + 1)
> +#define UUID_STR_LEN (36 + 1)

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>

>   
>   #define UUID_NONE "00000000-0000-0000-0000-000000000000"

but just noticing that ^^^ :) So I'd go with:

   QEMU_BUILD_BUG_ON(sizeof(UUID_NONE) - 1 != 36);
   #define UUID_STR_LEN sizeof(UUID_NONE)