* [PATCH] scpi: hide get_scpi_ops in module from built-in code
@ 2015-11-16 21:34 Arnd Bergmann
2015-11-17 17:30 ` Punit Agrawal
0 siblings, 1 reply; 3+ messages in thread
From: Arnd Bergmann @ 2015-11-16 21:34 UTC (permalink / raw)
To: linux-arm-kernel
The scpi_clock driver can be built-in when CONFIG_COMPILE_TEST
is set even when ARM_SCPI_PROTOCOL is a loadable module, and
that results in a link error:
drivers/built-in.o: In function `scpi_clocks_probe':
(.text+0x14453c): undefined reference to `get_scpi_ops'
Using #if IS_REACHABLE() around the get_scpi_ops() declaration
makes it build successfully in this case for compile-testing,
but the effect is the same as when ARM_SCPI_PROTOCOL is
disabled, as the code will not be used.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
diff --git a/include/linux/scpi_protocol.h b/include/linux/scpi_protocol.h
index 80af3cd35ae4..72ce932c69b2 100644
--- a/include/linux/scpi_protocol.h
+++ b/include/linux/scpi_protocol.h
@@ -71,7 +71,7 @@ struct scpi_ops {
int (*sensor_get_value)(u16, u32 *);
};
-#if IS_ENABLED(CONFIG_ARM_SCPI_PROTOCOL)
+#if IS_REACHABLE(CONFIG_ARM_SCPI_PROTOCOL)
struct scpi_ops *get_scpi_ops(void);
#else
static inline struct scpi_ops *get_scpi_ops(void) { return NULL; }
^ permalink raw reply related [flat|nested] 3+ messages in thread* [PATCH] scpi: hide get_scpi_ops in module from built-in code
2015-11-16 21:34 [PATCH] scpi: hide get_scpi_ops in module from built-in code Arnd Bergmann
@ 2015-11-17 17:30 ` Punit Agrawal
2015-11-19 15:23 ` Arnd Bergmann
0 siblings, 1 reply; 3+ messages in thread
From: Punit Agrawal @ 2015-11-17 17:30 UTC (permalink / raw)
To: linux-arm-kernel
Arnd Bergmann <arnd@arndb.de> writes:
> The scpi_clock driver can be built-in when CONFIG_COMPILE_TEST
> is set even when ARM_SCPI_PROTOCOL is a loadable module, and
> that results in a link error:
>
> drivers/built-in.o: In function `scpi_clocks_probe':
> (.text+0x14453c): undefined reference to `get_scpi_ops'
>
> Using #if IS_REACHABLE() around the get_scpi_ops() declaration
> makes it build successfully in this case for compile-testing,
> but the effect is the same as when ARM_SCPI_PROTOCOL is
> disabled, as the code will not be used.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Makes sense. Thanks, Arnd!
Acked-by: Punit Agrawal <punit.agrawal@arm.com>
>
> diff --git a/include/linux/scpi_protocol.h b/include/linux/scpi_protocol.h
> index 80af3cd35ae4..72ce932c69b2 100644
> --- a/include/linux/scpi_protocol.h
> +++ b/include/linux/scpi_protocol.h
> @@ -71,7 +71,7 @@ struct scpi_ops {
> int (*sensor_get_value)(u16, u32 *);
> };
>
> -#if IS_ENABLED(CONFIG_ARM_SCPI_PROTOCOL)
> +#if IS_REACHABLE(CONFIG_ARM_SCPI_PROTOCOL)
> struct scpi_ops *get_scpi_ops(void);
> #else
> static inline struct scpi_ops *get_scpi_ops(void) { return NULL; }
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply [flat|nested] 3+ messages in thread* [PATCH] scpi: hide get_scpi_ops in module from built-in code
2015-11-17 17:30 ` Punit Agrawal
@ 2015-11-19 15:23 ` Arnd Bergmann
0 siblings, 0 replies; 3+ messages in thread
From: Arnd Bergmann @ 2015-11-19 15:23 UTC (permalink / raw)
To: linux-arm-kernel
On Tuesday 17 November 2015 17:30:14 Punit Agrawal wrote:
> Arnd Bergmann <arnd@arndb.de> writes:
>
> > The scpi_clock driver can be built-in when CONFIG_COMPILE_TEST
> > is set even when ARM_SCPI_PROTOCOL is a loadable module, and
> > that results in a link error:
> >
> > drivers/built-in.o: In function `scpi_clocks_probe':
> > (.text+0x14453c): undefined reference to `get_scpi_ops'
> >
> > Using #if IS_REACHABLE() around the get_scpi_ops() declaration
> > makes it build successfully in this case for compile-testing,
> > but the effect is the same as when ARM_SCPI_PROTOCOL is
> > disabled, as the code will not be used.
> >
> > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>
> Makes sense. Thanks, Arnd!
>
> Acked-by: Punit Agrawal <punit.agrawal@arm.com>
>
I've added it to arm-soc fixes now.
Arnd
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-11-19 15:23 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-16 21:34 [PATCH] scpi: hide get_scpi_ops in module from built-in code Arnd Bergmann
2015-11-17 17:30 ` Punit Agrawal
2015-11-19 15:23 ` Arnd Bergmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox