All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] xen: Remove trigraphs from comments
@ 2022-12-06 14:48 Michal Orzel
  2022-12-06 16:46 ` Stefano Stabellini
  0 siblings, 1 reply; 2+ messages in thread
From: Michal Orzel @ 2022-12-06 14:48 UTC (permalink / raw)
  To: xen-devel
  Cc: Michal Orzel, Jan Beulich, Andrew Cooper, Roger Pau Monné,
	Wei Liu, George Dunlap, Julien Grall, Stefano Stabellini

MISRA C rule 4.2 states that trigraphs (sequences of two question marks
followed by a specified third character [=/'()!<>-]) should not be used.
This applies to both code and comments. Thankfully, we do not use them
in the code, but still there are some comments where they are
accidentally used. Fix it.

With regards to the comments and respective macros in pci_regs.h, these
were inherited from Linux. Let's knowingly accept the divergence.

Signed-off-by: Michal Orzel <michal.orzel@amd.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
Changes in v2:
 - use (?!?) for arch-x86_64.h
 - add a note in commit msg that pci_regs.h originated from Linux and we
   knowingly accept the divergence
---
 xen/arch/x86/x86_emulate/x86_emulate.h |  2 +-
 xen/include/public/arch-x86_64.h       |  2 +-
 xen/include/xen/pci_regs.h             | 12 ++++++------
 3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/xen/arch/x86/x86_emulate/x86_emulate.h b/xen/arch/x86/x86_emulate/x86_emulate.h
index 4732855c40ed..bb7af967ffee 100644
--- a/xen/arch/x86/x86_emulate/x86_emulate.h
+++ b/xen/arch/x86/x86_emulate/x86_emulate.h
@@ -228,7 +228,7 @@ struct x86_emulate_ops
      * All functions:
      *  @ctxt:  [IN ] Emulation context info as passed to the emulator.
      * All memory-access functions:
-     *  @seg:   [IN ] Segment being dereferenced (specified as x86_seg_??).
+     *  @seg:   [IN ] Segment being dereferenced (specified as x86_seg_?).
      *  @offset:[IN ] Offset within segment.
      *  @p_data:[IN ] Pointer to i/o data buffer (length is @bytes)
      * Read functions:
diff --git a/xen/include/public/arch-x86_64.h b/xen/include/public/arch-x86_64.h
index 5db52de69584..acf705f25e7a 100644
--- a/xen/include/public/arch-x86_64.h
+++ b/xen/include/public/arch-x86_64.h
@@ -22,5 +22,5 @@
  * A similar callback occurs if the segment selectors are invalid.
  * failsafe_address is used as the value of eip.
  *
- * On x86_64, event_selector and failsafe_selector are ignored (???).
+ * On x86_64, event_selector and failsafe_selector are ignored (?!?).
  */
diff --git a/xen/include/xen/pci_regs.h b/xen/include/xen/pci_regs.h
index ee8e82be36b4..a90aff1712ba 100644
--- a/xen/include/xen/pci_regs.h
+++ b/xen/include/xen/pci_regs.h
@@ -246,13 +246,13 @@
 #define  PCI_PM_CTRL_STATE_MASK	0x0003	/* Current power state (D0 to D3) */
 #define  PCI_PM_CTRL_NO_SOFT_RESET	0x0008	/* No reset for D3hot->D0 */
 #define  PCI_PM_CTRL_PME_ENABLE	0x0100	/* PME pin enable */
-#define  PCI_PM_CTRL_DATA_SEL_MASK	0x1e00	/* Data select (??) */
-#define  PCI_PM_CTRL_DATA_SCALE_MASK	0x6000	/* Data scale (??) */
+#define  PCI_PM_CTRL_DATA_SEL_MASK	0x1e00	/* Data select (?) */
+#define  PCI_PM_CTRL_DATA_SCALE_MASK	0x6000	/* Data scale (?) */
 #define  PCI_PM_CTRL_PME_STATUS	0x8000	/* PME pin status */
-#define PCI_PM_PPB_EXTENSIONS	6	/* PPB support extensions (??) */
-#define  PCI_PM_PPB_B2_B3	0x40	/* Stop clock when in D3hot (??) */
-#define  PCI_PM_BPCC_ENABLE	0x80	/* Bus power/clock control enable (??) */
-#define PCI_PM_DATA_REGISTER	7	/* (??) */
+#define PCI_PM_PPB_EXTENSIONS	6	/* PPB support extensions (?) */
+#define  PCI_PM_PPB_B2_B3	0x40	/* Stop clock when in D3hot (?) */
+#define  PCI_PM_BPCC_ENABLE	0x80	/* Bus power/clock control enable (?) */
+#define PCI_PM_DATA_REGISTER	7	/* (?) */
 #define PCI_PM_SIZEOF		8
 
 /* AGP registers */
-- 
2.25.1



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

* Re: [PATCH v2] xen: Remove trigraphs from comments
  2022-12-06 14:48 [PATCH v2] xen: Remove trigraphs from comments Michal Orzel
@ 2022-12-06 16:46 ` Stefano Stabellini
  0 siblings, 0 replies; 2+ messages in thread
From: Stefano Stabellini @ 2022-12-06 16:46 UTC (permalink / raw)
  To: Michal Orzel
  Cc: xen-devel, Jan Beulich, Andrew Cooper, Roger Pau Monné,
	Wei Liu, George Dunlap, Julien Grall, Stefano Stabellini

On Tue, 6 Dec 2022, Michal Orzel wrote:
> MISRA C rule 4.2 states that trigraphs (sequences of two question marks
> followed by a specified third character [=/'()!<>-]) should not be used.
> This applies to both code and comments. Thankfully, we do not use them
> in the code, but still there are some comments where they are
> accidentally used. Fix it.
> 
> With regards to the comments and respective macros in pci_regs.h, these
> were inherited from Linux. Let's knowingly accept the divergence.
> 
> Signed-off-by: Michal Orzel <michal.orzel@amd.com>
> Reviewed-by: Jan Beulich <jbeulich@suse.com>

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


> ---
> Changes in v2:
>  - use (?!?) for arch-x86_64.h
>  - add a note in commit msg that pci_regs.h originated from Linux and we
>    knowingly accept the divergence
> ---
>  xen/arch/x86/x86_emulate/x86_emulate.h |  2 +-
>  xen/include/public/arch-x86_64.h       |  2 +-
>  xen/include/xen/pci_regs.h             | 12 ++++++------
>  3 files changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/xen/arch/x86/x86_emulate/x86_emulate.h b/xen/arch/x86/x86_emulate/x86_emulate.h
> index 4732855c40ed..bb7af967ffee 100644
> --- a/xen/arch/x86/x86_emulate/x86_emulate.h
> +++ b/xen/arch/x86/x86_emulate/x86_emulate.h
> @@ -228,7 +228,7 @@ struct x86_emulate_ops
>       * All functions:
>       *  @ctxt:  [IN ] Emulation context info as passed to the emulator.
>       * All memory-access functions:
> -     *  @seg:   [IN ] Segment being dereferenced (specified as x86_seg_??).
> +     *  @seg:   [IN ] Segment being dereferenced (specified as x86_seg_?).
>       *  @offset:[IN ] Offset within segment.
>       *  @p_data:[IN ] Pointer to i/o data buffer (length is @bytes)
>       * Read functions:
> diff --git a/xen/include/public/arch-x86_64.h b/xen/include/public/arch-x86_64.h
> index 5db52de69584..acf705f25e7a 100644
> --- a/xen/include/public/arch-x86_64.h
> +++ b/xen/include/public/arch-x86_64.h
> @@ -22,5 +22,5 @@
>   * A similar callback occurs if the segment selectors are invalid.
>   * failsafe_address is used as the value of eip.
>   *
> - * On x86_64, event_selector and failsafe_selector are ignored (???).
> + * On x86_64, event_selector and failsafe_selector are ignored (?!?).
>   */
> diff --git a/xen/include/xen/pci_regs.h b/xen/include/xen/pci_regs.h
> index ee8e82be36b4..a90aff1712ba 100644
> --- a/xen/include/xen/pci_regs.h
> +++ b/xen/include/xen/pci_regs.h
> @@ -246,13 +246,13 @@
>  #define  PCI_PM_CTRL_STATE_MASK	0x0003	/* Current power state (D0 to D3) */
>  #define  PCI_PM_CTRL_NO_SOFT_RESET	0x0008	/* No reset for D3hot->D0 */
>  #define  PCI_PM_CTRL_PME_ENABLE	0x0100	/* PME pin enable */
> -#define  PCI_PM_CTRL_DATA_SEL_MASK	0x1e00	/* Data select (??) */
> -#define  PCI_PM_CTRL_DATA_SCALE_MASK	0x6000	/* Data scale (??) */
> +#define  PCI_PM_CTRL_DATA_SEL_MASK	0x1e00	/* Data select (?) */
> +#define  PCI_PM_CTRL_DATA_SCALE_MASK	0x6000	/* Data scale (?) */
>  #define  PCI_PM_CTRL_PME_STATUS	0x8000	/* PME pin status */
> -#define PCI_PM_PPB_EXTENSIONS	6	/* PPB support extensions (??) */
> -#define  PCI_PM_PPB_B2_B3	0x40	/* Stop clock when in D3hot (??) */
> -#define  PCI_PM_BPCC_ENABLE	0x80	/* Bus power/clock control enable (??) */
> -#define PCI_PM_DATA_REGISTER	7	/* (??) */
> +#define PCI_PM_PPB_EXTENSIONS	6	/* PPB support extensions (?) */
> +#define  PCI_PM_PPB_B2_B3	0x40	/* Stop clock when in D3hot (?) */
> +#define  PCI_PM_BPCC_ENABLE	0x80	/* Bus power/clock control enable (?) */
> +#define PCI_PM_DATA_REGISTER	7	/* (?) */
>  #define PCI_PM_SIZEOF		8
>  
>  /* AGP registers */
> -- 
> 2.25.1
> 


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

end of thread, other threads:[~2022-12-06 16:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-06 14:48 [PATCH v2] xen: Remove trigraphs from comments Michal Orzel
2022-12-06 16:46 ` Stefano Stabellini

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.