From patchwork Fri Jul 22 14:28:01 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mikael Pettersson X-Patchwork-Id: 999612 Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p6MESIoN026523 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 22 Jul 2011 14:28:39 GMT Received: from canuck.infradead.org ([2001:4978:20e::1]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QkGi1-0004WM-To; Fri, 22 Jul 2011 14:28:10 +0000 Received: from localhost ([127.0.0.1] helo=canuck.infradead.org) by canuck.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1QkGi1-00067j-HJ; Fri, 22 Jul 2011 14:28:09 +0000 Received: from fanny.its.uu.se ([130.238.4.241]) by canuck.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QkGhy-00067Q-JX for linux-arm-kernel@lists.infradead.org; Fri, 22 Jul 2011 14:28:07 +0000 Received: from fanny.its.uu.se (localhost [127.0.0.1]) by fanny.its.uu.se (Postfix) with ESMTP id 974A26276; Fri, 22 Jul 2011 16:28:02 +0200 (MSZ) Received: from pilspetsen.it.uu.se (pilspetsen.it.uu.se [130.238.18.39]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by fanny.its.uu.se (Postfix) with ESMTP id 59AF0623B; Fri, 22 Jul 2011 16:28:02 +0200 (MSZ) Received: (from mikpe@localhost) by pilspetsen.it.uu.se (8.14.4+Sun/8.14.4) id p6MES1Sj004486; Fri, 22 Jul 2011 16:28:01 +0200 (MEST) X-Authentication-Warning: pilspetsen.it.uu.se: mikpe set sender to mikpe@it.uu.se using -f MIME-Version: 1.0 Message-ID: <20009.35057.432746.47293@pilspetsen.it.uu.se> Date: Fri, 22 Jul 2011 16:28:01 +0200 From: Mikael Pettersson To: Russell King - ARM Linux Subject: Re: [PATCH 3.0] fix compile warnings in plat-iop/cp6.c In-Reply-To: <20110722132721.GA25947@n2100.arm.linux.org.uk> References: <20009.28803.497535.598471@pilspetsen.it.uu.se> <20110722132721.GA25947@n2100.arm.linux.org.uk> X-Mailer: VM 7.17 under Emacs 20.7.1 X-Virus-Scanned: ClamAV using ClamSMTP X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20110722_102806_838945_0D2D012D X-CRM114-Status: GOOD ( 15.38 ) X-Spam-Score: -3.5 (---) X-Spam-Report: SpamAssassin version 3.3.1 on canuck.infradead.org summary: Content analysis details: (-3.5 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, medium trust [130.238.4.241 listed in list.dnswl.org] -1.2 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain Cc: Dan Williams , Mikael Pettersson , Lennert Buytenhek , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Fri, 22 Jul 2011 14:29:05 +0000 (UTC) Russell King - ARM Linux writes: > On Fri, Jul 22, 2011 at 02:43:47PM +0200, Mikael Pettersson wrote: > > Building 3.0 for an n2100 (plat-iop) results in: > > > > In file included from arch/arm/plat-iop/cp6.c:20: > > /tmp/linux-3.0/arch/arm/include/asm/traps.h:12: warning: 'struct pt_regs' declared inside parameter list > > /tmp/linux-3.0/arch/arm/include/asm/traps.h:12: warning: its scope is only this definition or declaration, which is probably not what you want > > /tmp/linux-3.0/arch/arm/include/asm/traps.h:48: warning: 'struct pt_regs' declared inside parameter list > > /tmp/linux-3.0/arch/arm/include/asm/traps.h:48: warning: 'struct task_struct' declared inside parameter list > > arch/arm/plat-iop/cp6.c:45: warning: initialization from incompatible pointer type > > > > The pt_regs and incompatible pointer type warnings are fixed by including > > before . Nothing here depends on task_struct, > > so that warning can be fixed by a forward struct declaration. > > Why not add a forward declaration of struct pt_regs and task_struct > to asm/traps.h ? Sure, that works too. Revised patch below. Only tested on n2100 so far. Building kernel 3.0 for an n2100 (plat-iop) results in: In file included from arch/arm/plat-iop/cp6.c:20: /tmp/linux-3.0/arch/arm/include/asm/traps.h:12: warning: 'struct pt_regs' declared inside parameter list /tmp/linux-3.0/arch/arm/include/asm/traps.h:12: warning: its scope is only this definition or declaration, which is probably not what you want /tmp/linux-3.0/arch/arm/include/asm/traps.h:48: warning: 'struct pt_regs' declared inside parameter list /tmp/linux-3.0/arch/arm/include/asm/traps.h:48: warning: 'struct task_struct' declared inside parameter list arch/arm/plat-iop/cp6.c:45: warning: initialization from incompatible pointer type Nothing here depends on the layout of pt_regs or task_struct, so this can be fixed by adding forward struct declarations to asm/traps.h. Signed-off-by: Mikael Pettersson --- linux-3.0/arch/arm/include/asm/traps.h.~1~ 2011-05-19 06:06:34.000000000 +0200 +++ linux-3.0/arch/arm/include/asm/traps.h 2011-07-22 16:14:50.000000000 +0200 @@ -3,6 +3,9 @@ #include +struct pt_regs; +struct task_struct; + struct undef_hook { struct list_head node; u32 instr_mask;