[tip:x86/vdso] x86: vdso: Fix build with older gcc

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

 



Commit-ID:  a92f101bc99d17b75021cf29f18cc57f39a37d1f
Gitweb:     http://git.kernel.org/tip/a92f101bc99d17b75021cf29f18cc57f39a37d1f
Author:     Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
AuthorDate: Sat, 1 Nov 2014 21:18:26 +0100
Committer:  Thomas Gleixner <tglx@xxxxxxxxxxxxx>
CommitDate: Sat, 1 Nov 2014 21:18:33 +0100

x86: vdso: Fix build with older gcc

gcc-4.4.4:

arch/x86/vdso/vma.c: In function 'vgetcpu_cpu_init':
arch/x86/vdso/vma.c:247: error: unknown field 'limit0' specified in initializer
arch/x86/vdso/vma.c:247: warning: missing braces around initializer
arch/x86/vdso/vma.c:247: warning: (near initialization for '(anonymous).<anonymous>')
arch/x86/vdso/vma.c:248: error: unknown field 'limit' specified in initializer
arch/x86/vdso/vma.c:248: warning: excess elements in struct initializer
arch/x86/vdso/vma.c:248: warning: (near initialization for '(anonymous)')
....

I couldn't find any way of tricking it into accepting an initializer
format :(

Reported-by: Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>
Fixes: 258801563b ("x86/vdso: Change the PER_CPU segment to use struct desc_struct")
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
Cc: Andy Lutomirski <luto@xxxxxxxxxxxxxx>
Cc: Ingo Molnar <mingo@xxxxxxxxxx>
Cc: "H. Peter Anvin" <hpa@xxxxxxxxx>
Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
---
 arch/x86/vdso/vma.c | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)

diff --git a/arch/x86/vdso/vma.c b/arch/x86/vdso/vma.c
index a280b11..009495b 100644
--- a/arch/x86/vdso/vma.c
+++ b/arch/x86/vdso/vma.c
@@ -230,7 +230,7 @@ __setup("vdso=", vdso_setup);
 static void vgetcpu_cpu_init(void *arg)
 {
 	int cpu = smp_processor_id();
-	struct desc_struct d;
+	struct desc_struct d = { };
 	unsigned long node = 0;
 #ifdef CONFIG_NUMA
 	node = cpu_to_node(cpu);
@@ -243,15 +243,13 @@ static void vgetcpu_cpu_init(void *arg)
 	 * quickly in user space in vgetcpu. (12 bits for the CPU
 	 * and 8 bits for the node)
 	 */
-	d = (struct desc_struct) {
-		.limit0 = cpu | ((node & 0xf) << 12),
-		.limit = node >> 4,
-		.type = 5,		/* RO data, expand down, accessed */
-		.dpl = 3,		/* Visible to user code */
-		.s = 1,			/* Not a system segment */
-		.p = 1,			/* Present */
-		.d = 1,			/* 32-bit */
-	};
+	d.limit0 = cpu | ((node & 0xf) << 12);
+	d.limit = node >> 4;
+	d.type = 5;		/* RO data, expand down, accessed */
+	d.dpl = 3;		/* Visible to user code */
+	d.s = 1;		/* Not a system segment */
+	d.p = 1;		/* Present */
+	d.d = 1;		/* 32-bit */
 
 	write_gdt_entry(get_cpu_gdt_table(cpu), GDT_ENTRY_PER_CPU, &d, DESCTYPE_S);
 }
--
To unsubscribe from this list: send the line "unsubscribe linux-tip-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Stable Commits]     [Linux Stable Kernel]     [Linux Kernel]     [Linux USB Devel]     [Linux Video &Media]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux