drivers/hwtracing: fix coresight-etm4x implicit <module.h> usage
PATCH 1/1 drivers/hwtracing: fix coresight-etm4x implicit <module.h> usage
In commit 2e1cdfe184b5202d51e0611d7a051e2bea303946 ("coresight-etm4x:
Adding CoreSight ETM4x driver") this driver was added.
It uses module_amba_driver() to register itself with the system, which is just an alias for module_driver. This currently works by relying on getting that via init.h but we are planning to move that code[1] to module.h -- at which time this will fail to compile since it does not include module.h currently, resulting in:
drivers/hwtracing/coresight/coresight-etm4x.c:2701:1: note: in expansion of macro ‘module_amba_driver’
module_amba_driver(etm4x_driver);
^include/linux/device.h:1296:1: error: type defaults to ‘int’ in declaration of ‘module_init’ [-Werror=implicit-int]
module_init(__driver##_init); \
^
In the future, the amba support may want to create another alias that uses builtin_driver[2] for cases like this which are using bool Kconfig triggers, but for now we just fix the implicit include.
[1] https://lkml.kernel.org/r/[email protected]
[2] https://lkml.kernel.org/r/[email protected]
---
[Note: Commit 2e1cdfe184b520 is only in linux-next trees via staging-next;
this fixes a next build fail when staging-next is merged with [1] above.]
drivers/hwtracing/coresight/coresight-etm4x.c | 1 + 1 file changed, 1 insertion(+)
drivers/hwtracing/coresight/coresight-etm4x.c +1 -0
@@ -15,6 +15,7 @@#include <linux/init.h> #include <linux/types.h> #include <linux/device.h> +#include <linux/module.h> #include <linux/io.h> #include <linux/err.h> #include <linux/fs.h>
Signature · 1 line
2.2.1
Quoted 49 lines · Paul Gortmaker
In commit
2e1cdfe184b5202d51e0611d7a051e2bea303946("coresight-etm4x:
Adding CoreSight ETM4x driver") this driver was added.It uses
module_amba_driver()to register itself with the system, which is just an alias formodule_driver. This currently works by relying on getting that viainit.hbut we are planning to move that code[1] tomodule.h-- at which time this will fail to compile since it does not includemodule.hcurrently, resulting in:
drivers/hwtracing/coresight/coresight-etm4x.c:2701:1: note: in expansion of macro ‘module_amba_driver’
module_amba_driver(etm4x_driver);
^include/linux/device.h:1296:1: error: type defaults to ‘int’ in declaration of ‘module_init’ [-Werror=implicit-int]
module_init(__driver##_init); \
^In the future, the amba support may want to create another alias that uses builtin_driver[2] for cases like this which are using bool
Kconfigtriggers, but for now we just fix the implicit include.[1] https://lkml.kernel.org/r/[email protected]
[2] https://lkml.kernel.org/r/[email protected]Cc Pratik Patel <[email protected]>Cc Kaixu Xia <[email protected]>Cc Mathieu Poirier <[email protected]>Cc Greg Kroah-Hartman <[email protected]>Signed-off-by Paul Gortmaker <[email protected]>---
[Note: Commit
2e1cdfe184b520is only in linux-next trees via staging-next;
this fixes a next build fail when staging-next is merged with [1] above.]drivers/hwtracing/coresight/coresight-etm4x.c | 1 + 1 file changed, 1 insertion(+)drivers/hwtracing/coresight/coresight-etm4x.c +1
-1@@ -15,6 +15,7 @@#include <linux/init.h> #include <linux/types.h> #include <linux/device.h> +#include <linux/module.h> #include <linux/io.h> #include <linux/err.h> #include <linux/fs.h> --
Quoted 2 lines
2.2.1