All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] common/unlzo: address violation of MISRA C Rule 7.3
@ 2024-06-21 13:40 Alessandro Zucchelli
  2024-06-21 21:31 ` Stefano Stabellini
  0 siblings, 1 reply; 3+ messages in thread
From: Alessandro Zucchelli @ 2024-06-21 13:40 UTC (permalink / raw)
  To: xen-devel
  Cc: consulting, Alessandro Zucchelli, Andrew Cooper, George Dunlap,
	Jan Beulich, Julien Grall, Stefano Stabellini

This addresses violations of MISRA C:2012 Rule 7.3 which states as
following: the lowercase character `l' shall not be used in a literal
suffix.

The file common/unlzo.c defines the non-compliant constant LZO_BLOCK_SIZE with
having a lowercase 'l'.
It is now defined as '256*1024L'.

No functional change.

Signed-off-by: Alessandro Zucchelli <alessandro.zucchelli@bugseng.com>
---
Changes from v1:
Instead of deviating /common/unlzo.c reports fro Rule 7.3 they are addressed by
changing the non-compliant definition of LZO_BLOCK_SIZE.
---
 xen/common/unlzo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/common/unlzo.c b/xen/common/unlzo.c
index bdcefa95b3..acb8dff600 100644
--- a/xen/common/unlzo.c
+++ b/xen/common/unlzo.c
@@ -52,7 +52,7 @@ static inline u32 get_unaligned_be32(const void *p)
 static const unsigned char lzop_magic[] = {
 	0x89, 0x4c, 0x5a, 0x4f, 0x00, 0x0d, 0x0a, 0x1a, 0x0a };
 
-#define LZO_BLOCK_SIZE        (256*1024l)
+#define LZO_BLOCK_SIZE        (256*1024L)
 #define HEADER_HAS_FILTER      0x00000800L
 #define HEADER_SIZE_MIN       (9 + 7     + 4 + 8     + 1       + 4)
 #define HEADER_SIZE_MAX       (9 + 7 + 1 + 8 + 8 + 4 + 1 + 255 + 4)
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] common/unlzo: address violation of MISRA C Rule 7.3
  2024-06-21 13:40 [PATCH v2] common/unlzo: address violation of MISRA C Rule 7.3 Alessandro Zucchelli
@ 2024-06-21 21:31 ` Stefano Stabellini
  2024-06-24  7:57   ` Oleksii
  0 siblings, 1 reply; 3+ messages in thread
From: Stefano Stabellini @ 2024-06-21 21:31 UTC (permalink / raw)
  To: Alessandro Zucchelli
  Cc: xen-devel, consulting, Andrew Cooper, George Dunlap, Jan Beulich,
	Julien Grall, Stefano Stabellini, oleksii.kurochko

On Fri, 21 Jun 2024, Alessandro Zucchelli wrote:
> This addresses violations of MISRA C:2012 Rule 7.3 which states as
> following: the lowercase character `l' shall not be used in a literal
> suffix.
> 
> The file common/unlzo.c defines the non-compliant constant LZO_BLOCK_SIZE with
> having a lowercase 'l'.
> It is now defined as '256*1024L'.
> 
> No functional change.
> 
> Signed-off-by: Alessandro Zucchelli <alessandro.zucchelli@bugseng.com>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>

Asking for a release ack for this trivial change


> ---
> Changes from v1:
> Instead of deviating /common/unlzo.c reports fro Rule 7.3 they are addressed by
> changing the non-compliant definition of LZO_BLOCK_SIZE.
> ---
>  xen/common/unlzo.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/xen/common/unlzo.c b/xen/common/unlzo.c
> index bdcefa95b3..acb8dff600 100644
> --- a/xen/common/unlzo.c
> +++ b/xen/common/unlzo.c
> @@ -52,7 +52,7 @@ static inline u32 get_unaligned_be32(const void *p)
>  static const unsigned char lzop_magic[] = {
>  	0x89, 0x4c, 0x5a, 0x4f, 0x00, 0x0d, 0x0a, 0x1a, 0x0a };
>  
> -#define LZO_BLOCK_SIZE        (256*1024l)
> +#define LZO_BLOCK_SIZE        (256*1024L)
>  #define HEADER_HAS_FILTER      0x00000800L
>  #define HEADER_SIZE_MIN       (9 + 7     + 4 + 8     + 1       + 4)
>  #define HEADER_SIZE_MAX       (9 + 7 + 1 + 8 + 8 + 4 + 1 + 255 + 4)
> -- 
> 2.34.1
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] common/unlzo: address violation of MISRA C Rule 7.3
  2024-06-21 21:31 ` Stefano Stabellini
@ 2024-06-24  7:57   ` Oleksii
  0 siblings, 0 replies; 3+ messages in thread
From: Oleksii @ 2024-06-24  7:57 UTC (permalink / raw)
  To: Stefano Stabellini, Alessandro Zucchelli
  Cc: xen-devel, consulting, Andrew Cooper, George Dunlap, Jan Beulich,
	Julien Grall

On Fri, 2024-06-21 at 14:31 -0700, Stefano Stabellini wrote:
> On Fri, 21 Jun 2024, Alessandro Zucchelli wrote:
> > This addresses violations of MISRA C:2012 Rule 7.3 which states as
> > following: the lowercase character `l' shall not be used in a
> > literal
> > suffix.
> > 
> > The file common/unlzo.c defines the non-compliant constant
> > LZO_BLOCK_SIZE with
> > having a lowercase 'l'.
> > It is now defined as '256*1024L'.
> > 
> > No functional change.
> > 
> > Signed-off-by: Alessandro Zucchelli
> > <alessandro.zucchelli@bugseng.com>
> 
> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
> 
> Asking for a release ack for this trivial change
Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>

~ Oleksii

> 
> 
> > ---
> > Changes from v1:
> > Instead of deviating /common/unlzo.c reports fro Rule 7.3 they are
> > addressed by
> > changing the non-compliant definition of LZO_BLOCK_SIZE.
> > ---
> >  xen/common/unlzo.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/xen/common/unlzo.c b/xen/common/unlzo.c
> > index bdcefa95b3..acb8dff600 100644
> > --- a/xen/common/unlzo.c
> > +++ b/xen/common/unlzo.c
> > @@ -52,7 +52,7 @@ static inline u32 get_unaligned_be32(const void
> > *p)
> >  static const unsigned char lzop_magic[] = {
> >  	0x89, 0x4c, 0x5a, 0x4f, 0x00, 0x0d, 0x0a, 0x1a, 0x0a };
> >  
> > -#define LZO_BLOCK_SIZE        (256*1024l)
> > +#define LZO_BLOCK_SIZE        (256*1024L)
> >  #define HEADER_HAS_FILTER      0x00000800L
> >  #define HEADER_SIZE_MIN       (9 + 7     + 4 + 8     + 1       +
> > 4)
> >  #define HEADER_SIZE_MAX       (9 + 7 + 1 + 8 + 8 + 4 + 1 + 255 +
> > 4)
> > -- 
> > 2.34.1
> > 



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-06-24  7:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-21 13:40 [PATCH v2] common/unlzo: address violation of MISRA C Rule 7.3 Alessandro Zucchelli
2024-06-21 21:31 ` Stefano Stabellini
2024-06-24  7:57   ` Oleksii

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.