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

Re: [PATCH 2/7] xsm/flask: sidtab: Fix MISRA C 2012 Rule 20.7 violations


  • To: Xenia Ragiadakou <burzalodowa@xxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>
  • Date: Fri, 26 Aug 2022 09:41:16 -0400
  • Arc-authentication-results: i=1; mx.zohomail.com; dkim=pass header.i=apertussolutions.com; spf=pass smtp.mailfrom=dpsmith@xxxxxxxxxxxxxxxxxxxx; dmarc=pass header.from=<dpsmith@xxxxxxxxxxxxxxxxxxxx>
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1661521282; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=g5CkyHHy4HTk2CiBzhtk6AvN1dey5wMabu9AKWDtSdM=; b=UjC4x6KdfCjCvVhX7XOyUbqkbj+h8P4uuRT2hGB2MaPNtiK0VnvnVRGxX8yLN1wJ5YyzQZUTBD5vgGsG3Le2HXjYmdOGa4Gl6Vz2REurxxYX3ZP/XZWJ9OWab1lYZtV/vLJvDJt+a0d35nA3+L6UcZftClz9k7P2b87vBHpckPQ=
  • Arc-seal: i=1; a=rsa-sha256; t=1661521282; cv=none; d=zohomail.com; s=zohoarc; b=mX0clpkTlQEnrqNiJ4ouPPs/DO812uqEVflmjGNaso3sKzQuD9Ju98We85BekS8emQwhtenVKVRCypqX2TlvtO9lrE7/CIsy9EL/7PsVfkRod0M0l5XV6u+FFhI1vVRl/1j7ZDY7KYckq9aunvoifL1834u1hC0Xl7+wUsoTqi4=
  • Delivery-date: Fri, 26 Aug 2022 13:41:40 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 8/19/22 15:43, Xenia Ragiadakou wrote:
> In macros SIDTAB_HASH(), INIT_SIDTAB_LOCK(), SIDTAB_LOCK() and 
> SIDTAB_UNLOCK(),
> add parentheses around the macro parameter to prevent against unintended
> expansions.
> 
> Signed-off-by: Xenia Ragiadakou <burzalodowa@xxxxxxxxx>
> ---
>  xen/xsm/flask/ss/sidtab.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/xen/xsm/flask/ss/sidtab.c b/xen/xsm/flask/ss/sidtab.c
> index 74babfac9c..69fc3389b3 100644
> --- a/xen/xsm/flask/ss/sidtab.c
> +++ b/xen/xsm/flask/ss/sidtab.c
> @@ -14,11 +14,11 @@
>  #include "security.h"
>  #include "sidtab.h"
>  
> -#define SIDTAB_HASH(sid) (sid & SIDTAB_HASH_MASK)
> +#define SIDTAB_HASH(sid) ((sid) & SIDTAB_HASH_MASK)
>  
> -#define INIT_SIDTAB_LOCK(s) spin_lock_init(&s->lock)
> -#define SIDTAB_LOCK(s) spin_lock(&s->lock)
> -#define SIDTAB_UNLOCK(s) spin_unlock(&s->lock)
> +#define INIT_SIDTAB_LOCK(s) spin_lock_init(&(s)->lock)
> +#define SIDTAB_LOCK(s) spin_lock(&(s)->lock)
> +#define SIDTAB_UNLOCK(s) spin_unlock(&(s)->lock)
>  
>  int sidtab_init(struct sidtab *s)
>  {

Acked-by: Daniel P. Smith <dpsmith@xxxxxxxxxxxxxxxxxxxx>



 


Rackspace

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