Message ID | 771362e703548e55d4ccc420fa880585a5748c4f.1691053438.git.simone.ballarin@bugseng.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | xen: address violations of MISRA C:2012 Rule 7.3 | expand |
On Thu, 3 Aug 2023, Simone Ballarin wrote: > From: Gianluca Luparini <gianluca.luparini@bugseng.com> > > The xen sources contain violations of MISRA C:2012 Rule 7.3 whose headline > states: > "The lowercase character 'l' shall not be used in a literal suffix". > > Use the "L" suffix instead of the "l" suffix, to avoid potential ambiguity. > If the "u" suffix is used near "L", use the "U" suffix instead, for consistency. > > The changes in this patch are mechanical. > > Signed-off-by: Gianluca Luparini <gianluca.luparini@bugseng.com> > Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
On 03/08/23 12:22, Simone Ballarin wrote: > From: Gianluca Luparini <gianluca.luparini@bugseng.com> > > The xen sources contain violations of MISRA C:2012 Rule 7.3 whose headline > states: > "The lowercase character 'l' shall not be used in a literal suffix". > > Use the "L" suffix instead of the "l" suffix, to avoid potential ambiguity. > If the "u" suffix is used near "L", use the "U" suffix instead, for consistency. > > The changes in this patch are mechanical. > > Signed-off-by: Gianluca Luparini <gianluca.luparini@bugseng.com> > Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com> > --- > xen/common/ioreq.c | 2 +- > xen/include/xen/ioreq.h | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/xen/common/ioreq.c b/xen/common/ioreq.c > index 7cb717f7a2..62b907f4c4 100644 > --- a/xen/common/ioreq.c > +++ b/xen/common/ioreq.c > @@ -1182,7 +1182,7 @@ static int ioreq_send_buffered(struct ioreq_server *s, ioreq_t *p) > * - the count field is usually used with data_is_ptr and since we don't > * support data_is_ptr we do not waste space for the count field either > */ > - if ( (p->addr > 0xffffful) || p->data_is_ptr || (p->count != 1) ) > + if ( (p->addr > 0xfffffUL) || p->data_is_ptr || (p->count != 1) ) > return 0; > > switch ( p->size ) > diff --git a/xen/include/xen/ioreq.h b/xen/include/xen/ioreq.h > index a26614d331..cd399adf17 100644 > --- a/xen/include/xen/ioreq.h > +++ b/xen/include/xen/ioreq.h > @@ -60,7 +60,7 @@ struct ioreq_server { > static inline paddr_t ioreq_mmio_first_byte(const ioreq_t *p) > { > return unlikely(p->df) ? > - p->addr - (p->count - 1ul) * p->size : > + p->addr - (p->count - 1UL) * p->size : > p->addr; > } > This patch still applies cleanly on staging, any change of getting an Ack?
On 03/08/2023 11:22, Simone Ballarin wrote: > From: Gianluca Luparini <gianluca.luparini@bugseng.com> > > The xen sources contain violations of MISRA C:2012 Rule 7.3 whose headline > states: > "The lowercase character 'l' shall not be used in a literal suffix". > > Use the "L" suffix instead of the "l" suffix, to avoid potential ambiguity. > If the "u" suffix is used near "L", use the "U" suffix instead, for consistency. > > The changes in this patch are mechanical. > > Signed-off-by: Gianluca Luparini <gianluca.luparini@bugseng.com> > Signed-off-by: Simone Ballarin <simone.ballarin@bugseng.com> > --- > xen/common/ioreq.c | 2 +- > xen/include/xen/ioreq.h | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > Acked-by: Paul Durrant <paul@xen.org>
diff --git a/xen/common/ioreq.c b/xen/common/ioreq.c index 7cb717f7a2..62b907f4c4 100644 --- a/xen/common/ioreq.c +++ b/xen/common/ioreq.c @@ -1182,7 +1182,7 @@ static int ioreq_send_buffered(struct ioreq_server *s, ioreq_t *p) * - the count field is usually used with data_is_ptr and since we don't * support data_is_ptr we do not waste space for the count field either */ - if ( (p->addr > 0xffffful) || p->data_is_ptr || (p->count != 1) ) + if ( (p->addr > 0xfffffUL) || p->data_is_ptr || (p->count != 1) ) return 0; switch ( p->size ) diff --git a/xen/include/xen/ioreq.h b/xen/include/xen/ioreq.h index a26614d331..cd399adf17 100644 --- a/xen/include/xen/ioreq.h +++ b/xen/include/xen/ioreq.h @@ -60,7 +60,7 @@ struct ioreq_server { static inline paddr_t ioreq_mmio_first_byte(const ioreq_t *p) { return unlikely(p->df) ? - p->addr - (p->count - 1ul) * p->size : + p->addr - (p->count - 1UL) * p->size : p->addr; }