All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Beulich <jbeulich@suse.com>
To: Julien Grall <julien@xen.org>
Cc: Julien Grall <jgrall@amazon.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH 3/3] xen/public: arch-arm: All PSR_* defines should be unsigned
Date: Fri, 18 Aug 2023 08:33:57 +0200	[thread overview]
Message-ID: <93ccb2c0-fa2c-3e84-35bf-3d86aef7a2bd@suse.com> (raw)
In-Reply-To: <20230817214356.47174-4-julien@xen.org>

On 17.08.2023 23:43, Julien Grall wrote:
> --- a/xen/include/public/arch-arm.h
> +++ b/xen/include/public/arch-arm.h
> @@ -339,36 +339,36 @@ typedef uint64_t xen_callback_t;
>  
>  /* PSR bits (CPSR, SPSR) */
>  
> -#define PSR_THUMB       (1<<5)        /* Thumb Mode enable */
> -#define PSR_FIQ_MASK    (1<<6)        /* Fast Interrupt mask */
> -#define PSR_IRQ_MASK    (1<<7)        /* Interrupt mask */
> -#define PSR_ABT_MASK    (1<<8)        /* Asynchronous Abort mask */
> -#define PSR_BIG_ENDIAN  (1<<9)        /* arm32: Big Endian Mode */
> -#define PSR_DBG_MASK    (1<<9)        /* arm64: Debug Exception mask */
> -#define PSR_IT_MASK     (0x0600fc00)  /* Thumb If-Then Mask */
> -#define PSR_JAZELLE     (1<<24)       /* Jazelle Mode */
> -#define PSR_Z           (1<<30)       /* Zero condition flag */
> +#define PSR_THUMB       (1U <<5)      /* Thumb Mode enable */
> +#define PSR_FIQ_MASK    (1U <<6)      /* Fast Interrupt mask */
> +#define PSR_IRQ_MASK    (1U <<7)      /* Interrupt mask */
> +#define PSR_ABT_MASK    (1U <<8)      /* Asynchronous Abort mask */

Nit: Did you mean to insert blanks also on the rhs of the <<, like you ...

> +#define PSR_BIG_ENDIAN  (1U << 9)     /* arm32: Big Endian Mode */
> +#define PSR_DBG_MASK    (1U << 9)     /* arm64: Debug Exception mask */
> +#define PSR_IT_MASK     (0x0600fc00U) /* Thumb If-Then Mask */
> +#define PSR_JAZELLE     (1U << 24)    /* Jazelle Mode */
> +#define PSR_Z           (1U << 30)    /* Zero condition flag */

... did everywhere here?

As an aside I wonder why they're here: They look like definitions of
processor registers, which aren't under our (Xen's) control. I ask in
part because the presence of such constants may then be taken as
justification to add similar things in new ports. Yet such definitions
shouldn't be put here.

Jan


  parent reply	other threads:[~2023-08-18  6:34 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-17 21:43 [PATCH 0/3] xen/arm: Some clean-up found with -Wconversion and -Warith-conversion Julien Grall
2023-08-17 21:43 ` [PATCH 1/3] xen/arm: vmmio: The number of entries cannot be negative Julien Grall
2023-08-17 22:57   ` Stefano Stabellini
2023-08-18  1:49   ` Henry Wang
2023-08-17 21:43 ` [PATCH 2/3] xen/arm: vgic: Use 'unsigned int' rather than 'int' whenever it is possible Julien Grall
2023-08-17 23:04   ` Stefano Stabellini
2023-08-21 16:59     ` Julien Grall
2023-08-18  1:50   ` Henry Wang
2023-08-18  7:02   ` Michal Orzel
2023-08-21 17:00     ` Julien Grall
2023-08-17 21:43 ` [PATCH 3/3] xen/public: arch-arm: All PSR_* defines should be unsigned Julien Grall
2023-08-17 23:05   ` Stefano Stabellini
2023-08-18  1:50   ` Henry Wang
2023-08-18  6:33   ` Jan Beulich [this message]
2023-08-18  7:39     ` Julien Grall
2023-08-18  8:00       ` Juergen Gross
2023-08-18  8:05         ` Julien Grall
2023-08-18  8:25           ` Juergen Gross
2023-08-18  9:15             ` Julien Grall
2023-08-18  8:14       ` Jan Beulich
2023-08-18  9:21         ` Julien Grall
2023-08-21 17:05 ` [PATCH 0/3] xen/arm: Some clean-up found with -Wconversion and -Warith-conversion Julien Grall

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=93ccb2c0-fa2c-3e84-35bf-3d86aef7a2bd@suse.com \
    --to=jbeulich@suse.com \
    --cc=Volodymyr_Babchuk@epam.com \
    --cc=bertrand.marquis@arm.com \
    --cc=jgrall@amazon.com \
    --cc=julien@xen.org \
    --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.