mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH staging] drivers/hwtracing: fix coresight-etm4x implicit <module.h> usage
@ 2015-06-04  0:03 Paul Gortmaker
  2015-06-04 15:47 ` Mathieu Poirier
  0 siblings, 1 reply; 2+ messages in thread
From: Paul Gortmaker @ 2015-06-04  0:03 UTC (permalink / raw)
  To: linux-kernel
  Cc: Paul Gortmaker, Pratik Patel, Kaixu Xia, Mathieu Poirier,
	Greg Kroah-Hartman

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/1433276168-21550-1-git-send-email-paul.gortmaker@windriver.com
[2] https://lkml.kernel.org/r/1431287385-1526-1-git-send-email-paul.gortmaker@windriver.com

Cc: Pratik Patel <pratikp@codeaurora.org>
Cc: Kaixu Xia <xiakaixu@huawei.com>
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---

[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(+)

diff --git a/drivers/hwtracing/coresight/coresight-etm4x.c b/drivers/hwtracing/coresight/coresight-etm4x.c
index f0b50af4fc30..1312e993c501 100644
--- a/drivers/hwtracing/coresight/coresight-etm4x.c
+++ b/drivers/hwtracing/coresight/coresight-etm4x.c
@@ -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>
-- 
2.2.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH staging] drivers/hwtracing: fix coresight-etm4x implicit <module.h> usage
  2015-06-04  0:03 [PATCH staging] drivers/hwtracing: fix coresight-etm4x implicit <module.h> usage Paul Gortmaker
@ 2015-06-04 15:47 ` Mathieu Poirier
  0 siblings, 0 replies; 2+ messages in thread
From: Mathieu Poirier @ 2015-06-04 15:47 UTC (permalink / raw)
  To: Paul Gortmaker; +Cc: linux-kernel, Pratik Patel, Kaixu Xia, Greg Kroah-Hartman

On 3 June 2015 at 18:03, Paul Gortmaker <paul.gortmaker@windriver.com> wrote:
> 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/1433276168-21550-1-git-send-email-paul.gortmaker@windriver.com
> [2] https://lkml.kernel.org/r/1431287385-1526-1-git-send-email-paul.gortmaker@windriver.com
>
> Cc: Pratik Patel <pratikp@codeaurora.org>
> Cc: Kaixu Xia <xiakaixu@huawei.com>
> Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
> ---
>
> [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(+)
>
> diff --git a/drivers/hwtracing/coresight/coresight-etm4x.c b/drivers/hwtracing/coresight/coresight-etm4x.c
> index f0b50af4fc30..1312e993c501 100644
> --- a/drivers/hwtracing/coresight/coresight-etm4x.c
> +++ b/drivers/hwtracing/coresight/coresight-etm4x.c
> @@ -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>
> --
> 2.2.1
>

Acked-by: Mathieu Poirier <mathieu.poirier@linaro.org>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-06-04 15:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-04  0:03 [PATCH staging] drivers/hwtracing: fix coresight-etm4x implicit <module.h> usage Paul Gortmaker
2015-06-04 15:47 ` Mathieu Poirier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome