2017-07-18 13:26:22

by Harvey Hunt

[permalink] [raw]
Subject: [PATCH 1/2] MIPS: ralink: Fix build error due to missing header

Previously, <linux/module.h> was included before ralink_regs.h in all
ralink files - leading to <linux/io.h> being implicitly included.

After commit 26dd3e4ff9ac ("MIPS: Audit and remove any unnecessary
uses of module.h") removed the inclusion of module.h from multiple
places, some ralink platforms failed to build with the following error:

In file included from arch/mips/ralink/mt7620.c:17:0:
./arch/mips/include/asm/mach-ralink/ralink_regs.h: In function ‘rt_sysc_w32’:
./arch/mips/include/asm/mach-ralink/ralink_regs.h:38:2: error: implicit declaration of function ‘__raw_writel’ [-Werror=implicit-function-declaration]
__raw_writel(val, rt_sysc_membase + reg);
^
./arch/mips/include/asm/mach-ralink/ralink_regs.h: In function ‘rt_sysc_r32’:
./arch/mips/include/asm/mach-ralink/ralink_regs.h:43:2: error: implicit declaration of function ‘__raw_readl’ [-Werror=implicit-function-declaration]
return __raw_readl(rt_sysc_membase + reg);

Fix this by including <linux/io.h>.

Signed-off-by: Harvey Hunt <[email protected]>
Fixes: 26dd3e4ff9ac ("MIPS: Audit and remove any unnecessary uses of module.h")
Cc: <[email protected]> #4.11+
Cc: John Crispin <[email protected]>
Cc: [email protected]
Cc: [email protected]
---
arch/mips/include/asm/mach-ralink/ralink_regs.h | 2 ++
1 file changed, 2 insertions(+)

diff --git a/arch/mips/include/asm/mach-ralink/ralink_regs.h b/arch/mips/include/asm/mach-ralink/ralink_regs.h
index 9df1a53..b4e7dfa 100644
--- a/arch/mips/include/asm/mach-ralink/ralink_regs.h
+++ b/arch/mips/include/asm/mach-ralink/ralink_regs.h
@@ -13,6 +13,8 @@
#ifndef _RALINK_REGS_H_
#define _RALINK_REGS_H_

+#include <linux/io.h>
+
enum ralink_soc_type {
RALINK_UNKNOWN = 0,
RT2880_SOC,
--
2.7.4


2017-07-18 13:26:34

by Harvey Hunt

[permalink] [raw]
Subject: [PATCH 2/2] MIPS: ralink: mt7620: Add missing header

Fix a build error caused by not including <linux/bug.h>.

The following compilation errors are caused by the missing header:

arch/mips/ralink/mt7620.c: In function ‘mt7620_get_cpu_pll_rate’:
arch/mips/ralink/mt7620.c:431:2: error: implicit declaration of function ‘WARN_ON’ [-Werror=implicit-function-declaration]
WARN_ON(div >= ARRAY_SIZE(mt7620_clk_divider));
^
arch/mips/ralink/mt7620.c: In function ‘mt7620_get_sys_rate’:
arch/mips/ralink/mt7620.c:500:2: error: implicit declaration of function ‘WARN’ [-Werror=implicit-function-declaration]
if (WARN(!div, "invalid divider for OCP ratio %u", ocp_ratio))
^
arch/mips/ralink/mt7620.c: In function ‘mt7620_dram_init’:
arch/mips/ralink/mt7620.c:619:3: error: implicit declaration of function ‘BUG’ [-Werror=implicit-function-declaration]
BUG();
^
cc1: some warnings being treated as errors
scripts/Makefile.build:302: recipe for target 'arch/mips/ralink/mt7620.o' failed

Signed-off-by: Harvey Hunt <[email protected]>
Cc: John Crispin <[email protected]>
Cc: [email protected]
Cc: [email protected]
---
arch/mips/ralink/mt7620.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/arch/mips/ralink/mt7620.c b/arch/mips/ralink/mt7620.c
index 094a0ee..9be8b08 100644
--- a/arch/mips/ralink/mt7620.c
+++ b/arch/mips/ralink/mt7620.c
@@ -12,6 +12,7 @@

#include <linux/kernel.h>
#include <linux/init.h>
+#include <linux/bug.h>

#include <asm/mipsregs.h>
#include <asm/mach-ralink/ralink_regs.h>
--
2.7.4

2017-07-18 22:01:32

by Ralf Baechle

[permalink] [raw]
Subject: Re: [PATCH 1/2] MIPS: ralink: Fix build error due to missing header

On Tue, Jul 18, 2017 at 02:25:45PM +0100, Harvey Hunt wrote:

> Previously, <linux/module.h> was included before ralink_regs.h in all
> ralink files - leading to <linux/io.h> being implicitly included.
>
> After commit 26dd3e4ff9ac ("MIPS: Audit and remove any unnecessary
> uses of module.h") removed the inclusion of module.h from multiple
> places, some ralink platforms failed to build with the following error:
>
> In file included from arch/mips/ralink/mt7620.c:17:0:
> ./arch/mips/include/asm/mach-ralink/ralink_regs.h: In function ‘rt_sysc_w32’:
> ./arch/mips/include/asm/mach-ralink/ralink_regs.h:38:2: error: implicit declaration of function ‘__raw_writel’ [-Werror=implicit-function-declaration]
> __raw_writel(val, rt_sysc_membase + reg);
> ^
> ./arch/mips/include/asm/mach-ralink/ralink_regs.h: In function ‘rt_sysc_r32’:
> ./arch/mips/include/asm/mach-ralink/ralink_regs.h:43:2: error: implicit declaration of function ‘__raw_readl’ [-Werror=implicit-function-declaration]
> return __raw_readl(rt_sysc_membase + reg);
>
> Fix this by including <linux/io.h>.

Looks sensible, applied. But I'm wondering why I don't see this in my
test builds.

Ralf

2017-07-18 22:05:17

by Ralf Baechle

[permalink] [raw]
Subject: Re: [PATCH 2/2] MIPS: ralink: mt7620: Add missing header

On Tue, Jul 18, 2017 at 02:25:46PM +0100, Harvey Hunt wrote:

> Fix a build error caused by not including <linux/bug.h>.
>
> The following compilation errors are caused by the missing header:
>
> arch/mips/ralink/mt7620.c: In function ‘mt7620_get_cpu_pll_rate’:
> arch/mips/ralink/mt7620.c:431:2: error: implicit declaration of function ‘WARN_ON’ [-Werror=implicit-function-declaration]
> WARN_ON(div >= ARRAY_SIZE(mt7620_clk_divider));
> ^
> arch/mips/ralink/mt7620.c: In function ‘mt7620_get_sys_rate’:
> arch/mips/ralink/mt7620.c:500:2: error: implicit declaration of function ‘WARN’ [-Werror=implicit-function-declaration]
> if (WARN(!div, "invalid divider for OCP ratio %u", ocp_ratio))
> ^
> arch/mips/ralink/mt7620.c: In function ‘mt7620_dram_init’:
> arch/mips/ralink/mt7620.c:619:3: error: implicit declaration of function ‘BUG’ [-Werror=implicit-function-declaration]
> BUG();
> ^
> cc1: some warnings being treated as errors
> scripts/Makefile.build:302: recipe for target 'arch/mips/ralink/mt7620.o' failed
>
> Signed-off-by: Harvey Hunt <[email protected]>
> Cc: John Crispin <[email protected]>
> Cc: [email protected]
> Cc: [email protected]

Same comment as for the previous patch - looks sensible, so applied. But
I'm wondering why I don't see this in test builds.

Ralf

2017-07-19 10:56:04

by Harvey Hunt

[permalink] [raw]
Subject: Re: [PATCH 1/2] MIPS: ralink: Fix build error due to missing header

Hi Ralf,

On 18/07/17 23:01, Ralf Baechle wrote:
> On Tue, Jul 18, 2017 at 02:25:45PM +0100, Harvey Hunt wrote:
>
>> Previously, <linux/module.h> was included before ralink_regs.h in all
>> ralink files - leading to <linux/io.h> being implicitly included.
>>
>> After commit 26dd3e4ff9ac ("MIPS: Audit and remove any unnecessary
>> uses of module.h") removed the inclusion of module.h from multiple
>> places, some ralink platforms failed to build with the following error:
>>
>> In file included from arch/mips/ralink/mt7620.c:17:0:
>> ./arch/mips/include/asm/mach-ralink/ralink_regs.h: In function ‘rt_sysc_w32’:
>> ./arch/mips/include/asm/mach-ralink/ralink_regs.h:38:2: error: implicit declaration of function ‘__raw_writel’ [-Werror=implicit-function-declaration]
>> __raw_writel(val, rt_sysc_membase + reg);
>> ^
>> ./arch/mips/include/asm/mach-ralink/ralink_regs.h: In function ‘rt_sysc_r32’:
>> ./arch/mips/include/asm/mach-ralink/ralink_regs.h:43:2: error: implicit declaration of function ‘__raw_readl’ [-Werror=implicit-function-declaration]
>> return __raw_readl(rt_sysc_membase + reg);
>>
>> Fix this by including <linux/io.h>.
>
> Looks sensible, applied. But I'm wondering why I don't see this in my
> test builds.

Thanks for merging them. There isn't currently a defconfig for this
platform, but I am working on adding one.

>
> Ralf
>

Thanks,

Harvey