Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965196AbcCONID (ORCPT ); Tue, 15 Mar 2016 09:08:03 -0400 Received: from pegase1.c-s.fr ([93.17.236.30]:56694 "EHLO mailhub1.si.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751537AbcCONHx (ORCPT ); Tue, 15 Mar 2016 09:07:53 -0400 From: Christophe Leroy Subject: [PATCH v2] powerpc/8xx: Fix do_mtspr_cpu6 build on older compilers To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Scott Wood Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Message-Id: <20160315130750.0E43C1A2375@localhost.localdomain> Date: Tue, 15 Mar 2016 14:07:49 +0100 (CET) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1026 Lines: 32 Some versions of GCC, reportedly before 4.8, fail with arch/powerpc/mm/8xx_mmu.c:139:2: error: memory input 1 is not directly addressable Change the one-element array into a simple variable to avoid this. Signed-off-by: Christophe Leroy Cc: Scott Wood --- Verified with GCC 4.4.4 and GCC 4.8.3 v2: compilation result is compliant with CPU6 ERRATA (using stw/lwz and not stwx/lwzx) arch/powerpc/include/asm/reg_8xx.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/include/asm/reg_8xx.h b/arch/powerpc/include/asm/reg_8xx.h index d41412c..94d01f8 100644 --- a/arch/powerpc/include/asm/reg_8xx.h +++ b/arch/powerpc/include/asm/reg_8xx.h @@ -53,7 +53,7 @@ #ifdef CONFIG_8xx_CPU6 #define do_mtspr_cpu6(rn, rn_addr, v) \ do { \ - int _reg_cpu6 = rn_addr, _tmp_cpu6[1]; \ + int _reg_cpu6 = rn_addr, _tmp_cpu6; \ asm volatile("stw %0, %1;" \ "lwz %0, %1;" \ "mtspr " __stringify(rn) ",%2" : \ -- 2.1.0