Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1270617 > unrolled thread

[PATCH] scpi: hide get_scpi_ops in module from built-in code

Started byArnd Bergmann <arnd@arndb.de>
First post2015-11-16 22:40 +0100
Last post2015-11-19 16:30 +0100
Articles 3 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] scpi: hide get_scpi_ops in module from built-in code Arnd Bergmann <arnd@arndb.de> - 2015-11-16 22:40 +0100
    Re: [PATCH] scpi: hide get_scpi_ops in module from built-in code Punit Agrawal <punit.agrawal@arm.com> - 2015-11-17 18:40 +0100
      Re: [PATCH] scpi: hide get_scpi_ops in module from built-in code Arnd Bergmann <arnd@arndb.de> - 2015-11-19 16:30 +0100

#1270617 — [PATCH] scpi: hide get_scpi_ops in module from built-in code

FromArnd Bergmann <arnd@arndb.de>
Date2015-11-16 22:40 +0100
Subject[PATCH] scpi: hide get_scpi_ops in module from built-in code
Message-ID<qvzFf-4gl-19@gated-at.bofh.it>
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; }

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1271481

FromPunit Agrawal <punit.agrawal@arm.com>
Date2015-11-17 18:40 +0100
Message-ID<qvSoy-85I-21@gated-at.bofh.it>
In reply to#1270617
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@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1273216

FromArnd Bergmann <arnd@arndb.de>
Date2015-11-19 16:30 +0100
Message-ID<qwzjQ-2Fh-27@gated-at.bofh.it>
In reply to#1271481
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web