All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nicola Vetrini <nicola.vetrini@bugseng.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Xen-devel <xen-devel@lists.xenproject.org>,
	"Jan Beulich" <JBeulich@suse.com>,
	"Roger Pau Monné" <roger.pau@citrix.com>,
	"Stefano Stabellini" <sstabellini@kernel.org>,
	"consulting @ bugseng . com" <consulting@bugseng.com>
Subject: Re: [PATCH 5/5] x86: Fix missing brackets in macros
Date: Wed, 10 Dec 2025 22:11:34 +0100	[thread overview]
Message-ID: <a48dece01f70c18be88692e10120599a@bugseng.com> (raw)
In-Reply-To: <20251210183019.2241560-6-andrew.cooper3@citrix.com>

On 2025-12-10 19:30, Andrew Cooper wrote:
> With the wider testing, some more violations have been spotted.  This
> addresses violations of Rule 20.7 which requires macro parameters to be
> bracketed.
> 
> No functional change.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
> ---
> CC: Jan Beulich <JBeulich@suse.com>
> CC: Roger Pau Monné <roger.pau@citrix.com>
> CC: Stefano Stabellini <sstabellini@kernel.org>
> CC: consulting@bugseng.com <consulting@bugseng.com>
> CC: Nicola Vetrini <nicola.vetrini@bugseng.com>
> ---
>  xen/arch/x86/mm/shadow/multi.c     | 2 +-
>  xen/arch/x86/mm/shadow/private.h   | 6 +++---
>  xen/drivers/passthrough/vtd/dmar.h | 2 +-
>  xen/include/xen/kexec.h            | 4 ++--
>  4 files changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/xen/arch/x86/mm/shadow/multi.c 
> b/xen/arch/x86/mm/shadow/multi.c
> index 03be61e225c0..36ee6554b4c4 100644
> --- a/xen/arch/x86/mm/shadow/multi.c
> +++ b/xen/arch/x86/mm/shadow/multi.c
> @@ -781,7 +781,7 @@ do {                                                
>                     \
>          (_sl1e) = _sp + _i;                                            
>  \
>          if ( shadow_l1e_get_flags(*(_sl1e)) & _PAGE_PRESENT )          
>  \
>              {_code}                                                    
>  \
> -        if ( _done ) break;                                            
>  \
> +        if ( (_done) ) break;                                          
>  \
>          increment_ptr_to_guest_entry(_gl1p);                           
>  \
>      }                                                                  
>  \
>      unmap_domain_page(_sp);                                            
>  \
> diff --git a/xen/arch/x86/mm/shadow/private.h 
> b/xen/arch/x86/mm/shadow/private.h
> index cef9dbef2e77..93834ec55c42 100644
> --- a/xen/arch/x86/mm/shadow/private.h
> +++ b/xen/arch/x86/mm/shadow/private.h
> @@ -636,9 +636,9 @@ prev_pinned_shadow(struct page_info *page,
>  }
> 
>  #define foreach_pinned_shadow(dom, pos, tmp)                    \
> -    for ( pos = prev_pinned_shadow(NULL, (dom));                \
> -          pos ? (tmp = prev_pinned_shadow(pos, (dom)), 1) : 0;  \
> -          pos = tmp )
> +    for ( (pos) = prev_pinned_shadow(NULL, dom);                \
> +          (pos) ? (tmp = prev_pinned_shadow(pos, dom), 1) : 0;  \
> +          (pos) = tmp )
> 
>  /*
>   * Pin a shadow page: take an extra refcount, set the pin bit,
> diff --git a/xen/drivers/passthrough/vtd/dmar.h 
> b/xen/drivers/passthrough/vtd/dmar.h
> index 0ff4f365351f..11590f71a828 100644
> --- a/xen/drivers/passthrough/vtd/dmar.h
> +++ b/xen/drivers/passthrough/vtd/dmar.h
> @@ -124,7 +124,7 @@ struct acpi_atsr_unit 
> *acpi_find_matched_atsr_unit(const struct pci_dev *);
>  do {                                                \
>      s_time_t start_time = NOW();                    \
>      while (1) {                                     \
> -        sts = op(iommu->reg, offset);               \
> +        sts = op((iommu)->reg, offset);             \
>          if ( cond )                                 \
>              break;                                  \
>          if ( NOW() > start_time + DMAR_OPERATION_TIMEOUT ) {    \
> diff --git a/xen/include/xen/kexec.h b/xen/include/xen/kexec.h
> index e66eb6a8e593..5dd288d1a50e 100644
> --- a/xen/include/xen/kexec.h
> +++ b/xen/include/xen/kexec.h
> @@ -66,9 +66,9 @@ void vmcoreinfo_append_str(const char *fmt, ...)
>  #define VMCOREINFO_PAGESIZE(value) \
>         vmcoreinfo_append_str("PAGESIZE=%ld\n", value)
>  #define VMCOREINFO_SYMBOL(name) \
> -       vmcoreinfo_append_str("SYMBOL(%s)=%lx\n", #name, (unsigned 
> long)&name)
> +       vmcoreinfo_append_str("SYMBOL(%s)=%lx\n", #name, (unsigned 
> long)&(name))
>  #define VMCOREINFO_SYMBOL_ALIAS(alias, name) \
> -       vmcoreinfo_append_str("SYMBOL(%s)=%lx\n", #alias, (unsigned 
> long)&name)
> +       vmcoreinfo_append_str("SYMBOL(%s)=%lx\n", #alias, (unsigned 
> long)&(name))
>  #define VMCOREINFO_STRUCT_SIZE(name) \
>         vmcoreinfo_append_str("SIZE(%s)=%zu\n", #name, sizeof(struct 
> name))
>  #define VMCOREINFO_OFFSET(name, field) \

-- 
Nicola Vetrini, B.Sc.
Software Engineer
BUGSENG (https://bugseng.com)
LinkedIn: https://www.linkedin.com/in/nicola-vetrini-a42471253


  reply	other threads:[~2025-12-10 21:11 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-10 18:30 [PATCH 0/5] x86: Misc MISRA fixes Andrew Cooper
2025-12-10 18:30 ` [PATCH 1/5] x86: Misra fixes for U/L suffixes Andrew Cooper
2025-12-10 20:09   ` Nicola Vetrini
2025-12-10 20:31     ` Nicola Vetrini
2025-12-10 23:48       ` Andrew Cooper
2025-12-11  7:39         ` Nicola Vetrini
2025-12-10 18:30 ` [PATCH 2/5] x86: Name parameters in function declarations Andrew Cooper
2025-12-10 20:15   ` Nicola Vetrini
2025-12-12  1:39     ` Andrew Cooper
2025-12-10 18:30 ` [PATCH 3/5] x86/ucode: Don't cast away const-ness in cmp_patch_id() Andrew Cooper
2025-12-10 20:37   ` Nicola Vetrini
2025-12-11  0:06     ` Stefano Stabellini
2025-12-10 18:30 ` [PATCH 4/5] x86: Fix missing breaks Andrew Cooper
2025-12-10 21:04   ` Nicola Vetrini
2025-12-10 18:30 ` [PATCH 5/5] x86: Fix missing brackets in macros Andrew Cooper
2025-12-10 21:11   ` Nicola Vetrini [this message]
2025-12-11  0:07     ` Stefano Stabellini
2025-12-11  8:36   ` Jan Beulich
2025-12-11  9:15     ` Nicola Vetrini
2025-12-11  9:30       ` Jan Beulich
2025-12-11 10:38         ` Nicola Vetrini
2025-12-11 12:28           ` Nicola Vetrini
2025-12-12  1:45             ` Andrew Cooper

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a48dece01f70c18be88692e10120599a@bugseng.com \
    --to=nicola.vetrini@bugseng.com \
    --cc=JBeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=consulting@bugseng.com \
    --cc=roger.pau@citrix.com \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.