Skip to contentSkip to conversation

perf: xgene: Include module.h

PATCH In review Stephen Boyd 3 participants 5 messages Jan 25, 2017 – Jan 26, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 perf: xgene: Include module.h

I ran into a build error when I disabled CONFIG_ACPI and tried to compile this driver:

drivers/perf/xgene_pmu.c:1242:1: warning: data definition has no type or storage class
MODULE_DEVICE_TABLE(of, xgene_pmu_of_match);
^
drivers/perf/xgene_pmu.c:1242:1: error: type defaults to 'int' in declaration of 'MODULE_DEVICE_TABLE' [-Werror=implicit-int]

Include module.h for the MODULE_DEVICE_TABLE macro that's implicitly included through ACPI.

---
 drivers/perf/xgene_pmu.c | 1 +
 1 file changed, 1 insertion(+)
drivers/perf/xgene_pmu.c +1 -0
index a8ac4bcef2c0..fb3281962a6d 100644
@@ -20,6 +20,7 @@
  */
 
 #include <linux/acpi.h>
+#include <linux/module.h>
 #include <linux/clk.h>
 #include <linux/cpumask.h>
 #include <linux/interrupt.h>
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
#1 lore raw

Hi Stephen,

Quoted 2 lines · Stephen Boyd

I ran into a build error when I disabled CONFIG_ACPI and tried to compile this driver:

I tried kernel 4.9 and couldn't reproduce the issue. What is the kernel version you are seeing the compilation issue?

Regards
Tai

Quoted 31 lines

drivers/perf/xgene_pmu.c:1242:1: warning: data definition has no type or storage class
MODULE_DEVICE_TABLE(of, xgene_pmu_of_match);
^
drivers/perf/xgene_pmu.c:1242:1: error: type defaults to 'int' in declaration of 'MODULE_DEVICE_TABLE' [-Werror=implicit-int]

Include module.h for the MODULE_DEVICE_TABLE macro that's implicitly included through ACPI.

---
 drivers/perf/xgene_pmu.c | 1 +
 1 file changed, 1 insertion(+)
drivers/perf/xgene_pmu.c +1 -1
index a8ac4bcef2c0..fb3281962a6d 100644
@@ -20,6 +20,7 @@
  */
 
 #include <linux/acpi.h>
+#include <linux/module.h>
 #include <linux/clk.h>
 #include <linux/cpumask.h>
 #include <linux/interrupt.h>
--

The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project

Signature · 1 line
Tai
#2 lore raw

My bad, I can reproduce the issue now.

Thanks
Tai

Quoted 48 lines · Tai Tri Nguyen

Hi Stephen,

Quoted 2 lines · Stephen Boyd

I ran into a build error when I disabled CONFIG_ACPI and tried to compile this driver:

I tried kernel 4.9 and couldn't reproduce the issue. What is the kernel version you are seeing the compilation issue?

Regards
Tai

Quoted 28 lines

drivers/perf/xgene_pmu.c:1242:1: warning: data definition has no type or storage class
MODULE_DEVICE_TABLE(of, xgene_pmu_of_match);
^
drivers/perf/xgene_pmu.c:1242:1: error: type defaults to 'int' in declaration of 'MODULE_DEVICE_TABLE' [-Werror=implicit-int]

Include module.h for the MODULE_DEVICE_TABLE macro that's implicitly included through ACPI.

---
 drivers/perf/xgene_pmu.c | 1 +
 1 file changed, 1 insertion(+)
drivers/perf/xgene_pmu.c +1 -1
index a8ac4bcef2c0..fb3281962a6d 100644
@@ -20,6 +20,7 @@
  */
 
 #include <linux/acpi.h>
+#include <linux/module.h>
 #include <linux/clk.h>
 #include <linux/cpumask.h>
 #include <linux/interrupt.h>
--
Quoted 3 lines

The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project

--
Tai

Signature · 1 line
Tai
Tested-by on v1 1/1
#3 lore raw
In reply to Stephen Boyd

Hi Stephen,

Quoted 22 lines · Stephen Boyd

I ran into a build error when I disabled CONFIG_ACPI and tried to compile this driver:

drivers/perf/xgene_pmu.c:1242:1: warning: data definition has no type or storage class
MODULE_DEVICE_TABLE(of, xgene_pmu_of_match);
^
drivers/perf/xgene_pmu.c:1242:1: error: type defaults to 'int' in declaration of 'MODULE_DEVICE_TABLE' [-Werror=implicit-int]

Include module.h for the MODULE_DEVICE_TABLE macro that's implicitly included through ACPI.

---
 drivers/perf/xgene_pmu.c | 1 +
 1 file changed, 1 insertion(+)
drivers/perf/xgene_pmu.c +0 -0
index a8ac4bcef2c0..fb3281962a6d 100644

drivers/perf/xgene_pmu.c line 23

Quoted 4 lines
drivers/perf/xgene_pmu.c +1 -0
@@ -20,6 +20,7 @@
  */
 
 #include <linux/acpi.h>
+#include <linux/module.h>

Please fix alphabetic order of the include file.

Quoted 7 lines
drivers/perf/xgene_pmu.c +0 -1
 #include <linux/clk.h>
 #include <linux/cpumask.h>
 #include <linux/interrupt.h>
--

The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project

Signature · 1 line
Tai
#4 lore raw
Quoted 25 lines · Tai Tri Nguyen
Quoted 24 lines · Stephen Boyd

I ran into a build error when I disabled CONFIG_ACPI and tried to compile this driver:

drivers/perf/xgene_pmu.c:1242:1: warning: data definition has no type or storage class
MODULE_DEVICE_TABLE(of, xgene_pmu_of_match);
^
drivers/perf/xgene_pmu.c:1242:1: error: type defaults to 'int' in declaration of 'MODULE_DEVICE_TABLE' [-Werror=implicit-int]

Include module.h for the MODULE_DEVICE_TABLE macro that's implicitly included through ACPI.

---
 drivers/perf/xgene_pmu.c | 1 +
 1 file changed, 1 insertion(+)
drivers/perf/xgene_pmu.c +0 -0
index a8ac4bcef2c0..fb3281962a6d 100644
@@ -20,6 +20,7 @@
  */
 
Quoted 6 lines

drivers/perf/xgene_pmu.c line 23

Quoted 2 lines
drivers/perf/xgene_pmu.c +1 -0
 #include <linux/acpi.h>
+#include <linux/module.h>

Please fix alphabetic order of the include file.

I've picked this up with the includes put in the correct order.

Thanks,

Will