warning fixes for v3.7-rc4
Subsystems (9)
cover warning fixes for v3.7-rc4
Hi everyone,
Here are a few patches for remaining or newly introduced build warnings in the ARM defconfig builds. The MTD patches have been around for some time, but I had not submitted them because I had to redo most of them first.
The only build error in this series is the exynos drm patch, which is a very recent regression.
Please apply in to the respective maintainer trees.
Arnd
Arnd Bergmann (8):
mtd: diskonchip: don't warn about ARM architecture
mtd: diskonchip: use inline functions for DocRead/DocWrite
mtd: uninitialized variable warning in map.h
sched: warnings in kernel/sched/fair.c
mmc: dw_mmc: fix modular build for exynos back-end
mmc: dw_mmc: constify dw_mci_idmac_ops in exynos back-end
ata: highbank: mark ahci_highbank_probe as __devinit drm/exynos: don't include plat/gpio-cfg.h
drivers/ata/sata_highbank.c | 2 +- drivers/gpu/drm/exynos/exynos_hdmi.c | 1 - drivers/mmc/host/dw_mmc-exynos.c | 8 ++++---- drivers/mmc/host/dw_mmc-pltfm.c | 2 +- drivers/mmc/host/dw_mmc-pltfm.h | 2 +- drivers/mmc/host/dw_mmc.c | 2 +- drivers/mtd/devices/docprobe.c | 2 -- drivers/mtd/nand/diskonchip.c | 2 -- include/linux/mmc/dw_mmc.h | 4 ++-- include/linux/mtd/doc2000.h | 22 ++++++++++++++++++---- include/linux/mtd/map.h | 2 +- kernel/sched/fair.c | 2 +- 12 files changed, 30 insertions(+), 21 deletions(-)
Signature · 1 line
1.7.10
PATCH 1/8 mtd: diskonchip: don't warn about ARM architecture
Enabling the diskonchip drivers on most architectures results in a pointless warning "#warning Unknown architecture for DiskOnChip. No default probe locations defined". The driver can in fact handle the default location already through the CONFIG_MTD_DOCPROBE_ADDRESS, which gets set on the platforms that need it, and we get a run-time error if this is not set correctly.
--- drivers/mtd/devices/docprobe.c | 2 -- drivers/mtd/nand/diskonchip.c | 2 -- 2 files changed, 4 deletions(-)
drivers/mtd/devices/docprobe.c +0 -2
@@ -70,8 +70,6 @@ static unsigned long __initdata doc_locations[] = { 0xe0000, 0xe2000, 0xe4000, 0xe6000, 0xe8000, 0xea000, 0xec000, 0xee000, #endif /* CONFIG_MTD_DOCPROBE_HIGH */ -#else -#warning Unknown architecture for DiskOnChip. No default probe locations defined #endif 0xffffffff };
drivers/mtd/nand/diskonchip.c +0 -2
@@ -53,8 +53,6 @@ static unsigned long __initdata doc_locations[] = { 0xe0000, 0xe2000, 0xe4000, 0xe6000, 0xe8000, 0xea000, 0xec000, 0xee000, #endif /* CONFIG_MTD_DOCPROBE_HIGH */ -#else -#warning Unknown architecture for DiskOnChip. No default probe locations defined #endif 0xffffffff };
Signature · 1 line
1.7.10
Re: [PATCH 1/8] mtd: diskonchip: don't warn about ARM architecture
Quoted 7 lines · Arnd Bergmann
Enabling the diskonchip drivers on most architectures results in a pointless warning "#warning Unknown architecture for DiskOnChip. No default probe locations defined". The driver can in fact handle the default location already through the
CONFIG_MTD_DOCPROBE_ADDRESS, which gets set on the platforms that need it, and we get a run-time error if this is not set correctly.
Pushed patches 1, 2, and 3 to l2-mtd.git, thanks!
Signature · 2 lines
Best Regards, Artem Bityutskiy
PATCH 2/8 mtd: diskonchip: use inline functions for DocRead/DocWrite
In reply to Arnd BergmannThe diskonchip drivers traditionally use home-grown macros for doing MMIO accesses, which cause a lot of warnings, at least on ARM machines:
drivers/mtd/devices/doc2000.c: In function 'doc_write':drivers/mtd/devices/doc2000.c:854:5: warning: value computed is not used [-Wunused-value] drivers/mtd/devices/doc2000.c: In function 'doc_erase':drivers/mtd/devices/doc2000.c:1123:5: warning: value computed is not used [-Wunused-value drivers/mtd/nand/diskonchip.c: In function 'doc2000_read_byte':drivers/mtd/nand/diskonchip.c:318:3: warning: value computed is not used [-Wunused-value]
A nicer solution is to use the architecture-defined I/O accessors. Here, we use the __raw_readl/__raw_writel style, instead of the proper readl/writel ones, in order to preserve the odd semantics of the existing macros that have their own barrier implementation and no byte swap. It would be nice to fix this properly and use the correct accessors as well as make the word size independent from the architecture, but I guess the hardware is obsolete enough that we should better not mess the driver an more than necessary.
--- include/linux/mtd/doc2000.h | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-)
include/linux/mtd/doc2000.h +18 -4
@@ -92,12 +92,26 @@* Others use readb/writeb */ #if defined(__arm__) -#define ReadDOC_ (adr, reg) ((unsigned char)(*(volatile __u32 *)(((unsigned long)adr)+((reg)<<2)))) -#define WriteDOC_ (d, adr, reg) do{ *(volatile __u32 *)(((unsigned long)adr)+((reg)<<2)) = (__u32)d; wmb();} while(0) +static inline u8 ReadDOC_ (u32 __iomem *addr,unsigned long reg) +{ +return __raw_readl (addr + reg); +} +static inline void WriteDOC_ (u8 data,u32 __iomem *addr,unsigned long reg) +{ +__raw_writel (data, addr + reg); +wmb (); +}#define DOC_IOREMAP_LEN 0x8000#elif defined(__ppc__) -#define ReadDOC_ (adr, reg) ((unsigned char)(*(volatile __u16 *)(((unsigned long)adr)+((reg)<<1)))) -#define WriteDOC_ (d, adr, reg) do{ *(volatile __u16 *)(((unsigned long)adr)+((reg)<<1)) = (__u16)d; wmb();} while(0) +static inline u8 ReadDOC_ (u16 __iomem *addr,unsigned long reg) +{ +return __raw_readw (addr + reg); +} +static inline void WriteDOC_ (u8 data,u16 __iomem *addr,unsigned long reg) +{ +__raw_writew (data, addr + reg); +wmb (); +}#define DOC_IOREMAP_LEN 0x4000#else #define ReadDOC_ (adr, reg) readb((void __iomem *)(adr) + (reg))
Signature · 1 line
1.7.10
PATCH 3/8 mtd: uninitialized variable warning in map.h
In reply to Arnd BergmannThe map_word_load() function initializes exactly as many words in the buffer as required, but gcc cannot figure this out and gives a misleading warning. Marking the local variable as uninitialized_var shuts up that warning.
Without this patch, building acs5k_defconfig results in:
drivers/mtd/chips/cfi_cmdset_0002.c: In function 'cfi_amdstd_panic_write':include/linux/mtd/map.h:331:11: warning: 'r.x[0]' may be used uninitialized in this function [-Wuninitialized] drivers/mtd/chips/cfi_cmdset_0002.c: In function 'cfi_amdstd_write_words':include/linux/mtd/map.h:331:11: warning: 'r.x[0]' may be used uninitialized in this function [-Wuninitialized] drivers/mtd/chips/cfi_cmdset_0001.c: In function 'cfi_intelext_write_words':include/linux/mtd/map.h:331:11: warning: 'r.x[0]' may be used uninitialized in this function [-Wuninitialized]
--- include/linux/mtd/map.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/mtd/map.h +1 -1
@@ -328,7 +328,7 @@ static inline int map_word_bitsset(struct map_info *map, map_word val1, map_wordstatic inline map_word map_word_load (struct map_info *map,const void *ptr) { -map_word r; +map_word uninitialized_var (r );if (map_bankwidth_is_1 (map)) r.x[0 ] = *(unsigned char *)ptr;
Signature · 1 line
1.7.10
PATCH 4/8 sched: warnings in kernel/sched/fair.c
In reply to Arnd Bergmanna4c96ae319 "sched: Unthrottle rt runqueues in __disable_runtime()" turned the unthrottle_offline_cfs_rqs function into a static symbol, which now triggers a warning about it being potentially unused:
kernel/sched/fair.c:2055:13: warning: 'unthrottle_offline_cfs_rqs' defined but not used [-Wunused-function]
Marking it __maybe_unused shuts up the gcc warning and lets the compiler safely drop the function body when it's not being used.
To reproduce, build the ARM bcm2835_defconfig.
--- kernel/sched/fair.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/sched/fair.c +1 -1
@@ -2052,7 +2052,7 @@ static void destroy_cfs_bandwidth(struct cfs_bandwidth *cfs_b)hrtimer_cancel (&cfs_b->slack_timer); } -static void unthrottle_offline_cfs_rqs (struct rq *rq) +static void __maybe_unused unthrottle_offline_cfs_rqs (struct rq *rq) {struct cfs_rq *cfs_rq;
Signature · 1 line
1.7.10
PATCH 5/8 mmc: dw_mmc: fix modular build for exynos back-end
In reply to Arnd BergmannThe MODULE_DEVICE_TABLE entry for dw_mci_exynos_match was incorrectly copied from the platform back-end, which causes this error when building the driver as a loadable module:
drivers/mmc/host/dw_mmc-exynos.c: At top level:drivers/mmc/host/dw_mmc-exynos.c:226:34: error: '__mod_of_device_table' aliased to undefined symbol 'dw_mci_pltfm_match'
This patch fixes the problem by just using the correct string.
--- drivers/mmc/host/dw_mmc-exynos.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mmc/host/dw_mmc-exynos.c +1 -1
@@ -223,7 +223,7 @@ static const struct of_device_id dw_mci_exynos_match[] = { .data = (void *)&exynos5250_drv_data, }, {}, }; -MODULE_DEVICE_TABLE (of, dw_mci_pltfm_match); +MODULE_DEVICE_TABLE (of, dw_mci_exynos_match);int dw_mci_exynos_probe (struct platform_device *pdev) {
Signature · 1 line
1.7.10
Re: [PATCH 5/8] mmc: dw_mmc: fix modular build for exynos back-end
Hi Arnd,
Quoted 24 lines · Arnd Bergmann
The
MODULE_DEVICE_TABLEentry fordw_mci_exynos_matchwas incorrectly copied from the platform back-end, which causes this error when building the driver as a loadable module:
drivers/mmc/host/dw_mmc-exynos.c: At top level:drivers/mmc/host/dw_mmc-exynos.c:226:34: error: '__mod_of_device_table' aliased to undefined symbol 'dw_mci_pltfm_match'This patch fixes the problem by just using the correct string.
Signed-off-by Arnd Bergmann <[email protected]>Cc Thomas Abraham <[email protected]>Cc Will Newton <[email protected]>Cc Chris Ball <[email protected]>--- drivers/mmc/host/dw_mmc-exynos.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/mmc/host/dw_mmc-exynos.c +0
-0
drivers/mmc/host/dw_mmc-exynos.c static const struct of_device_id dw_mci_exynos_match[] = { · line 229
Quoted 8 lines
drivers/mmc/host/dw_mmc-exynos.c +1
-1@@ -223,7 +223,7 @@ static const struct of_device_id dw_mci_exynos_match[] = { .data = (void *)&exynos5250_drv_data, }, {}, }; -MODULE_DEVICE_TABLE (of, dw_mci_pltfm_match); +MODULE_DEVICE_TABLE (of, dw_mci_exynos_match);int dw_mci_exynos_probe (struct platform_device *pdev) {
Thanks, pushed to mmc-next for 3.7.
- Chris.
Signature · 2 lines
Chris Ball <[email protected]> <http://printf.net/> One Laptop Per Child
PATCH 6/8 mmc: dw_mmc: constify dw_mci_idmac_ops in exynos back-end
In reply to Arnd BergmannThe of_device_id match data is now marked as const and must not be modified. This changes the dw_mmc to mark all pointers passing the dw_mci_drv_data or dw_mci_dma_ops structures as const, and also marks the static definitions as const.
drivers/mmc/host/dw_mmc-exynos.c: In function 'dw_mci_exynos_probe':drivers/mmc/host/dw_mmc-exynos.c:234:11: warning: assignment discards 'const' qualifier from pointer target type [enabled by default]
--- drivers/mmc/host/dw_mmc-exynos.c | 6 +++--- drivers/mmc/host/dw_mmc-pltfm.c | 2 +- drivers/mmc/host/dw_mmc-pltfm.h | 2 +- drivers/mmc/host/dw_mmc.c | 2 +- include/linux/mmc/dw_mmc.h | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-)
drivers/mmc/host/dw_mmc-exynos.c +3 -3
@@ -208,7 +208,7 @@ static unsigned long exynos5250_dwmmc_caps[4] = { MMC_CAP_CMD23, }; -static struct dw_mci_drv_data exynos5250_drv_data = { +static const struct dw_mci_drv_data exynos5250_drv_data = { .caps = exynos5250_dwmmc_caps, .init = dw_mci_exynos_priv_init, .setup_clock = dw_mci_exynos_setup_clock,
@@ -220,14 +220,14 @@ static struct dw_mci_drv_data exynos5250_drv_data = {static const struct of_device_id dw_mci_exynos_match[] = { { .compatible ="samsung,exynos5250-dw-mshc" , - .data = (void *)&exynos5250_drv_data, }, + .data = &exynos5250_drv_data, }, {}, };MODULE_DEVICE_TABLE (of, dw_mci_exynos_match);int dw_mci_exynos_probe (struct platform_device *pdev) { -struct dw_mci_drv_data *drv_data; +const struct dw_mci_drv_data *drv_data;const struct of_device_id *match; match =of_match_node (dw_mci_exynos_match, pdev->dev.of_node);
drivers/mmc/host/dw_mmc-pltfm.c +1 -1
@@ -24,7 +24,7 @@#include "dw_mmc.h" int dw_mci_pltfm_register (struct platform_device *pdev, -struct dw_mci_drv_data *drv_data) +const struct dw_mci_drv_data *drv_data) {struct dw_mci *host;struct resource *regs;
drivers/mmc/host/dw_mmc-pltfm.h +1 -1
@@ -13,7 +13,7 @@#define _DW_MMC_PLTFM_H_extern int dw_mci_pltfm_register (struct platform_device *pdev, -struct dw_mci_drv_data *drv_data); +const struct dw_mci_drv_data *drv_data); extern int __devexit dw_mci_pltfm_remove(struct platform_device *pdev);extern const struct dev_pm_ops dw_mci_pltfm_pmops;
drivers/mmc/host/dw_mmc.c +1 -1
@@ -434,7 +434,7 @@ static int dw_mci_idmac_init(struct dw_mci *host)return 0 ; } -static struct dw_mci_dma_ops dw_mci_idmac_ops = { +static const struct dw_mci_dma_ops dw_mci_idmac_ops = { .init = dw_mci_idmac_init, .start = dw_mci_idmac_start_dma, .stop = dw_mci_idmac_stop_dma,
include/linux/mmc/dw_mmc.h +2 -2
@@ -137,7 +137,7 @@ struct dw_mci {dma_addr_t sg_dma;void *sg_cpu; -struct dw_mci_dma_ops *dma_ops; +const struct dw_mci_dma_ops *dma_ops;#ifdef CONFIG_MMC_DW_IDMAC unsigned int ring_size;#else
@@ -162,7 +162,7 @@ struct dw_mci {u16 data_offset;struct device *dev;struct dw_mci_board *pdata; -struct dw_mci_drv_data *drv_data; +const struct dw_mci_drv_data *drv_data;void *priv;struct clk *biu_clk;struct clk *ciu_clk;
Signature · 1 line
1.7.10
Re: [PATCH 6/8] mmc: dw_mmc: constify dw_mci_idmac_ops in exynos back-end
Hi Arnd,
Quoted 6 lines · Arnd Bergmann
The
of_device_idmatch data is now marked as const and must not be modified. This changes thedw_mmcto mark all pointers passing thedw_mci_drv_dataordw_mci_dma_opsstructures as const, and also marks the static definitions as const.
Quoted 7 lines
drivers/mmc/host/dw_mmc-exynos.c: In function 'dw_mci_exynos_probe':drivers/mmc/host/dw_mmc-exynos.c:234:11: warning: assignment discards 'const' qualifier from pointer target type [enabled by default]Signed-off-by Arnd Bergmann <[email protected]>Cc Thomas Abraham <[email protected]>Cc Will Newton <[email protected]>Cc Chris Ball <[email protected]>
Thanks, pushed to mmc-next for 3.7.
- Chris.
Signature · 2 lines
Chris Ball <[email protected]> <http://printf.net/> One Laptop Per Child
PATCH 7/8 ata: highbank: mark ahci_highbank_probe as __devinit
In reply to Arnd BergmannThe ahci_highbank_probe function is incorrectly marked as __init, which means it can get discarded at boot time, which might be a problem if for some reason the device only becomes operational after loading another module.
Using __devinit instead avoids seeing this warning for every build:
WARNING: vmlinux.o(.data+0xf7b0): Section mismatch in reference from the variable ahci_highbank_driver to the function .init.text:ahci_highbank_probe() The variable ahci_highbank_driver references
the function __init ahci_highbank_probe()
If the reference is valid then annotate the
variable with __init* or __refdata (see linux/init.h) or name the variable:*_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console
--- drivers/ata/sata_highbank.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/ata/sata_highbank.c +1 -1
@@ -260,7 +260,7 @@ static const struct of_device_id ahci_of_match[] = { };MODULE_DEVICE_TABLE (of, ahci_of_match); -static int __init ahci_highbank_probe (struct platform_device *pdev) +static int __devinit ahci_highbank_probe (struct platform_device *pdev) {struct device *dev = &pdev->dev;struct ahci_host_priv *hpriv;
Signature · 1 line
1.7.10
Jeff Garzik
AppliedRe: [PATCH 7/8] ata: highbank: mark ahci_highbank_probe as __devinit
Quoted 15 lines · Arnd Bergmann
The
ahci_highbank_probefunction is incorrectly marked as__init, which means it can get discarded at boot time, which might be a problem if for some reason the device only becomes operational after loading another module.Using
__devinitinstead avoids seeing this warning for every build:WARNING:
vmlinux.o(.data+0xf7b0): Section mismatch in reference from the variableahci_highbank_driverto the function .init.text:ahci_highbank_probe() The variableahci_highbank_driverreferences
the function__initahci_highbank_probe()
If the reference is valid then annotate the
variable with __init* or__refdata(seelinux/init.h) or name the variable:*_template,*_timer,*_sht,*_ops,*_probe,*_probe_one,*_console
Quoted 7 lines
Signed-off-by Arnd Bergmann <[email protected]>Cc Mark Langsdorf <[email protected]>Cc Rob Herring <[email protected]>Cc Jeff Garzik <[email protected]>--- drivers/ata/sata_highbank.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
applied
Re: [PATCH 7/8] ata: highbank: mark ahci_highbank_probe as __devinit
Hi Jeff,
Quoted 28 lines · Jeff Garzik
Quoted 18 lines · Arnd Bergmann
The
ahci_highbank_probefunction is incorrectly marked as__init, which means it can get discarded at boot time, which might be a problem if for some reason the device only becomes operational after loading another module.Using
__devinitinstead avoids seeing this warning for every build:WARNING:
vmlinux.o(.data+0xf7b0): Section mismatch in reference from the variableahci_highbank_driverto the function .init.text:ahci_highbank_probe()
The variableahci_highbank_driverreferences
the function__initahci_highbank_probe()
If the reference is valid then annotate the
variable with __init* or__refdata(seelinux/init.h) or name the variable:*_template,*_timer,*_sht,*_ops,*_probe,*_probe_one,*_consoleQuoted 7 lines
Signed-off-by Arnd Bergmann <[email protected]>Cc Mark Langsdorf <[email protected]>Cc Rob Herring <[email protected]>Cc Jeff Garzik <[email protected]>--- drivers/ata/sata_highbank.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 1 line
applied
I have also sent the same fix:
https://patchwork.kernel.org/patch/1562141/
PATCH 8/8 drm/exynos: don't include plat/gpio-cfg.h
In reply to Arnd BergmannPatch 9eb3e9e6f3 "drm/exynos: add support for ARCH_MULTIPLATFORM" allowed building the exynos hdmi driver on non-samsung platforms, which unfortunately broke compilation in combination with 22c4f42897 "drm: exynos: hdmi: add support for exynos5 hdmi", which added an inclusion of the samsung-specific plat/gpio-cfg.h header file.
Fortunately, that header file is not required any more here, so we can simply revert the inclusion in order to build the ARM allyesconfig again without getting this error:
drivers/gpu/drm/exynos/exynos_hdmi.c:37:27: fatal error: plat/gpio-cfg.h: No such file or directory
--- drivers/gpu/drm/exynos/exynos_hdmi.c | 1 - 1 file changed, 1 deletion(-)
drivers/gpu/drm/exynos/exynos_hdmi.c +0 -1
@@ -34,7 +34,6 @@#include <linux/regulator/consumer.h> #include <linux/io.h> #include <linux/of_gpio.h> -#include <plat/gpio-cfg.h> #include <drm/exynos_drm.h>
Signature · 1 line
1.7.10