From mboxrd@z Thu Jan 1 00:00:00 1970 From: broonie@opensource.wolfsonmicro.com (Mark Brown) Date: Thu, 9 Sep 2010 12:33:09 +0100 Subject: [PATCH 2/2] ARM: S3C64XX: Prototype SPI devices In-Reply-To: <011001cb5010$b2848840$178d98c0$%kim@samsung.com> References: <1283941539-3892-1-git-send-email-broonie@opensource.wolfsonmicro.com> <1283941539-3892-2-git-send-email-broonie@opensource.wolfsonmicro.com> <004201cb4f52$df6e6e20$9e4b4a60$%kim@samsung.com> <20100908124605.GA10413@rakim.wolfsonmicro.main> <011001cb5010$b2848840$178d98c0$%kim@samsung.com> Message-ID: <20100909113309.GA25855@rakim.wolfsonmicro.main> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Thu, Sep 09, 2010 at 08:18:10PM +0900, Kukjin Kim wrote: > Mark Brown wrote: > > It'll have been something along the lines of: > > 's3c64xx_device_iis0' not declared; should it be static? > > for each device. Possibly generated by sparse rather than GCC - I > > always build with sparse as well. > You mean the build warning is 's3c64xx_device_iis0' is not declared..right? Yes, or words to that effect. > Hmm...the 's3c64xx_device_iis0' used only in a mach-s3c64xx/mach-smartq.c > file. > And defined it as extern struct in a plat-samsung/include/plat/devs.h file. > ...So...why need to modify mach-s3c64xx/dev-spi.c for it? The complaint is that the symbol has been defined in the C file with global scope but there's no declaration for it. This means that either the symbol is not supposed to be global scope and should be static instead (which isn't the case here, machines are supposed to be able to reference it) or that there is nothing checking that the declaration that other files use to talk about the symbol matches the defintion. If the users are using a different declaration then the memory layout and alignment may not be correct for them, causing errors at runtime. In other words the file has: struct platform_device s3c64xx_device_iis0 = { ... }; and the compiler/sparse is expecting to see: struct platform_device s3c64xx_device_iis0; before that, which comes from devs.h.