[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [XEN PATCH v2] xen/string: add missing parameter names


  • To: Federico Serafini <federico.serafini@xxxxxxxxxxx>
  • From: Luca Fancellu <Luca.Fancellu@xxxxxxx>
  • Date: Thu, 3 Aug 2023 10:28:24 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=F9r9HetsJDprQeKfL5CvjTbWMKMTHnuWnREm361MzuU=; b=GaJ/5lj8H0X60f6WYY7NallDOoz1Cdebn5v6OJQ1wp4IGDilwG2hYLobTWcG0+g/wdD6bCvy4O5/yP8OaB2veIUEIEF+Cv03ha1ZA5qvj8PkYqmeO37y/fn6orKUoXpp5nKBjH108nGqYExtKFVLfMPDFQECzNd12e92A+/o5rQJ1X1dFo1wUilIBnx621P2NBNbdvybNRJLtCixqqcDhoMrz1NnJAvkLXcsPE/O2dDP0SFxrKKOq3dbHzIeMB4iX9RMx+MyyyD9C5SE/pAbZhjUQDjP197LAcoV0mHjmNxI40gKR5fFChJBY9ypL2b+n0yFHHc0SUU9OG3fdGBM9A==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lodZzfBkCsdbLmKJi0XtEdXCVsEDdEx8UjV49aN8hg31fHcyvuvcB/3lwcuusThSBNHNkSF74fJwsBaV/la9UEcnJPDSIcQD25Q48LbdypP94Ooif1u0WNATZ2kaPCWSDxkjzsVT0H33zUahyrWbKciEw08q4JtL6jE1byvt6lTcYCCAIFdMK40VGVQ74wEGnFCAiCTnyGfAzDCAYdEki9PH8VaEOswHSeG/o3YocESnM2ttBC/cYIjiDtDsYiDI1Osj0zpOThecai92f+qQoQWRZZzEjwvDKwqhtsvfMvo4h1SSI0WnEFpFvsjP+KV/zEQoCG1UaudXL7hMuGfBjg==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, "consulting@xxxxxxxxxxx" <consulting@xxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Thu, 03 Aug 2023 10:29:38 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHZxeRL9pSVXV1k9k69k8jE/HqUO6/YXqGA
  • Thread-topic: [XEN PATCH v2] xen/string: add missing parameter names


> On 3 Aug 2023, at 09:26, Federico Serafini <federico.serafini@xxxxxxxxxxx> 
> wrote:
> 
> Add missing parameter names to address violation of MISRA C:2012
> rule 8.2 ("Function types shall be in prototype form with named
> parameters").
> 
> No functional changes.
> 
> Signed-off-by: Federico Serafini <federico.serafini@xxxxxxxxxxx>
> ---
> Changes in v2:
>  - memset() adjusted.
> ---
> xen/include/xen/string.h | 42 ++++++++++++++++++++--------------------
> 1 file changed, 21 insertions(+), 21 deletions(-)
> 
> diff --git a/xen/include/xen/string.h b/xen/include/xen/string.h
> index b4d2217a96..e91e3112e0 100644
> --- a/xen/include/xen/string.h
> +++ b/xen/include/xen/string.h
> @@ -12,27 +12,27 @@
> #define strncpy __xen_has_no_strncpy__
> #define strncat __xen_has_no_strncat__
> 
> -size_t strlcpy(char *, const char *, size_t);
> -size_t strlcat(char *, const char *, size_t);
> -int strcmp(const char *, const char *);
> -int strncmp(const char *, const char *, size_t);
> -int strcasecmp(const char *, const char *);
> -int strncasecmp(const char *, const char *, size_t);
> -char *strchr(const char *, int);
> -char *strrchr(const char *, int);
> -char *strstr(const char *, const char *);
> -size_t strlen(const char *);
> -size_t strnlen(const char *, size_t);
> -char *strpbrk(const char *, const char *);
> -char *strsep(char **, const char *);
> -size_t strspn(const char *, const char *);
> -
> -void *memset(void *, int, size_t);
> -void *memcpy(void *, const void *, size_t);
> -void *memmove(void *, const void *, size_t);
> -int memcmp(const void *, const void *, size_t);
> -void *memchr(const void *, int, size_t);
> -void *memchr_inv(const void *, int, size_t);
> +size_t strlcpy(char *dest, const char *src, size_t size);
> +size_t strlcat(char *dest, const char *src, size_t size);
> +int strcmp(const char *cs, const char *ct);
> +int strncmp(const char *cs, const char *ct, size_t count);
> +int strcasecmp(const char *s1, const char *s2);
> +int strncasecmp(const char *s1, const char *s2, size_t len);
> +char *strchr(const char *s, int c);
> +char *strrchr(const char *s, int c);
> +char *strstr(const char *s1, const char *s2);
> +size_t strlen(const char *s);
> +size_t strnlen(const char *s, size_t count);
> +char *strpbrk(const char *cs, const char *ct);
> +char *strsep(char **s, const char *ct);
> +size_t strspn(const char *s, const char *accept);
> +
> +void *memset(void *s, int c, size_t count);
> +void *memcpy(void *dest, const void *src, size_t count);

There is a comment in arch/arm/rm32/lib/memcpy.S with this:
/* Prototype: void *memcpy(void *dest, const void *src, size_t n); */

> +void *memmove(void *dest, const void *src, size_t count);

There is a comment in arch/arm/rm32/lib/memmove.S with this:
 * Prototype: void *memmove(void *dest, const void *src, size_t n);

> +int memcmp(const void *cs, const void *ct, size_t count);
> +void *memchr(const void *s, int c, size_t n);
> +void *memchr_inv(const void *s, int c, size_t n);

@Stefano: would it make sense to remove it as part of this patch or maybe not?

Apart from that, the patch looks good to me:

Reviewed-by: Luca Fancellu <luca.fancellu@xxxxxxx>





 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.