diff mbox

x86/dmar: place the initdata annotation after the variable type

Message ID 20170126161810.11835-1-roger.pau@citrix.com (mailing list archive)
State New, archived
Headers show

Commit Message

Roger Pau Monné Jan. 26, 2017, 4:18 p.m. UTC
clang cannot cope with the annotation being in the middle of the variable
declaration.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
---
Cc: Kevin Tian <kevin.tian@intel.com>
Cc: Feng Wu <feng.wu@intel.com>
Cc: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/drivers/passthrough/vtd/dmar.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Andrew Cooper Jan. 26, 2017, 4:20 p.m. UTC | #1
On 26/01/17 16:18, Roger Pau Monne wrote:
> clang cannot cope with the annotation being in the middle of the variable
> declaration.
>
> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>

Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Jan Beulich Jan. 26, 2017, 4:23 p.m. UTC | #2
>>> On 26.01.17 at 17:18, <roger.pau@citrix.com> wrote:
> clang cannot cope with the annotation being in the middle of the variable
> declaration.
> 
> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>

Reviewed-by: Jan Beulich <jbeulich@suse.com>

> --- a/xen/drivers/passthrough/vtd/dmar.c
> +++ b/xen/drivers/passthrough/vtd/dmar.c
> @@ -871,8 +871,8 @@ struct user_rmrr {
>      u32 sbdf[MAX_USER_RMRR_DEV];
>  };
>  
> -static __initdata unsigned int nr_rmrr;
> -static struct __initdata user_rmrr user_rmrrs[MAX_USER_RMRR];
> +static unsigned int __initdata nr_rmrr;
> +static struct user_rmrr __initdata user_rmrrs[MAX_USER_RMRR];

I'm sorry for not spotting this during review - while I wasn't aware
that this actively breaks clang, it's still stylistically better even with
gcc. I'm surprised though that (by implication) these are the only
offenders in our tree.

Jan
Tian, Kevin Feb. 8, 2017, 6:53 a.m. UTC | #3
> From: Roger Pau Monne [mailto:roger.pau@citrix.com]

> Sent: Friday, January 27, 2017 12:18 AM

> 

> clang cannot cope with the annotation being in the middle of the variable

> declaration.

> 

> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>


Acked-by: Kevin Tian <kevin.tian@intel.com>
diff mbox

Patch

diff --git a/xen/drivers/passthrough/vtd/dmar.c b/xen/drivers/passthrough/vtd/dmar.c
index 831fe1a..4a6a819 100644
--- a/xen/drivers/passthrough/vtd/dmar.c
+++ b/xen/drivers/passthrough/vtd/dmar.c
@@ -871,8 +871,8 @@  struct user_rmrr {
     u32 sbdf[MAX_USER_RMRR_DEV];
 };
 
-static __initdata unsigned int nr_rmrr;
-static struct __initdata user_rmrr user_rmrrs[MAX_USER_RMRR];
+static unsigned int __initdata nr_rmrr;
+static struct user_rmrr __initdata user_rmrrs[MAX_USER_RMRR];
 
 /* Macro for RMRR inclusive range formatting. */
 #define ERMRRU_FMT "[%lx-%lx]"