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

Re: [XEN PATCH v4] xen/string: address violations of MISRA C:2012 Rules 8.2 and 8.3


  • To: Federico Serafini <federico.serafini@xxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 13 Nov 2023 15:49:44 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.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=MQ6xMiqB1se4rbE2QAVyseajCja39tDNn+qd4ERKvlU=; b=j1+Nx1NUi3ELfKcsJiFwSWPeapVZlgzOmLQNAYba4gdQBcydq60yjIa8J6ZsteeGdOljnKWrBq/R2GchccBjGXh690S4ULooV+rBopGxU8DtDMpLiSVIe23Q0X4PBSBqmNkAVJX0aVv9XvvfdqO8w5CEVQCAgCUQh8ySYuAk3KyXrleUGgbLYS/RPIoKIhUNvK39s8KwI5LJ72t85+69kbqpEjGYdn8afc6EonSY47Oh1kp82G/2uhzDWbpo6Npn4IBTi8S5iDL9w65qV7L+i/L3jJB8pLkTc+kwfXOIL1NwnlZSUPdRLKCjh3QALfE9gX1wj/FWo0P04WUPEohnOg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lHMl+6CaNbWaWCO5ORPLjOFZ1FCi0X7l21EJJsat+7HTimjmrqTA9IDMLbg5fJCXvJrb1DhE6p8FDCGzWnQOTWbD9xHORbbV9kCAjdaKRwjqTnv8NSw40fr+9JpWb3wn3ue/ajF2Ghz7J3Q7619ys3Zd8fYfEfbqzedRou98YS/cnaEYFc5YoiJ2rOT3uYUlc/l/OiLyKomdD1gnH9PSxt5FasdIXgg3phET1sAemj8HrFgNkkqsaPkjev+tTtmkmBUTeQxvtOAY32XgzLGKFhG8n6ukALgX3yG1NmOy4lGUlfgXax5R7uNsfbXcq2OvWbwOlE5L3tYtrDHuYqBk4g==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: consulting@xxxxxxxxxxx, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Mon, 13 Nov 2023 14:50:09 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 10.11.2023 09:50, Federico Serafini wrote:
> Add missing parameter names to address violations of
> MISRA C:2012 Rule 8.2.
> 
> Resolve mismatches between parameter name "count" used in
> "xen/lib/mem{cpy,move,set}.c" and parameter name "n" used in
> "xen/arch/x86/string.c" to address violations of MISRA C:2012 Rule 8.3.
> 
> No functional change.
> 
> Signed-off-by: Federico Serafini <federico.serafini@xxxxxxxxxxx>

In the interest of getting this off the plate
Acked-by: Jan Beulich <jbeulich@xxxxxxxx>

But I'm still not happy about ...

> --- 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 n);
> +void *memcpy(void *dest, const void *src, size_t n);
> +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);

... the one "count" outlier left here, with no explanation in the
description.

Jan



 


Rackspace

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