All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] platform/x86: ideapad-laptop/thinkpad_acpi: mark conflicting symbols static
@ 2021-02-04 15:38 Arnd Bergmann
  2021-02-04 16:19 ` Hans de Goede
  0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2021-02-04 15:38 UTC (permalink / raw)
  To: Ike Panhc, Hans de Goede, Mark Gross,
	Henrique de Moraes Holschuh, Jiaxun Yang, Mark Pearson
  Cc: Arnd Bergmann, Andy Shevchenko, Nitin Joshi, Tom Rix, Aaron Ma,
	platform-driver-x86, linux-kernel, ibm-acpi-devel

From: Arnd Bergmann <arnd@arndb.de>

Three of the newly added functions are accidently not marked 'static' which
causes a warning when building with W=1

drivers/platform/x86/thinkpad_acpi.c:10081:5: warning: no previous prototype for function 'dytc_profile_get' [-Wmissing-prototypes]
drivers/platform/x86/thinkpad_acpi.c:10095:5: warning: no previous prototype for function 'dytc_cql_command' [-Wmissing-prototypes]
drivers/platform/x86/thinkpad_acpi.c:10133:5: warning: no previous prototype for function 'dytc_profile_set' [-Wmissing-prototypes]

The functions are also present in two files, causing a link error when
both are built into the kernel:

ld.lld: error: duplicate symbol: dytc_cql_command
>>> defined at ideapad-laptop.c
>>>            platform/x86/ideapad-laptop.o:(dytc_cql_command) in archive drivers/built-in.a
>>> defined at thinkpad_acpi.c
>>>            platform/x86/thinkpad_acpi.o:(.text+0x20) in archive drivers/built-in.a

ld.lld: error: duplicate symbol: dytc_profile_get
>>> defined at ideapad-laptop.c
>>>            platform/x86/ideapad-laptop.o:(dytc_profile_get) in archive drivers/built-in.a
>>> defined at thinkpad_acpi.c
>>>            platform/x86/thinkpad_acpi.o:(.text+0x0) in archive drivers/built-in.a

ld.lld: error: duplicate symbol: dytc_profile_set
>>> defined at ideapad-laptop.c
>>>            platform/x86/ideapad-laptop.o:(dytc_profile_set) in archive drivers/built-in.a
>>> defined at thinkpad_acpi.c
>>>            platform/x86/thinkpad_acpi.o:(.text+0x220) in archive drivers/built-in.a

Mark these all as static to avoid both problems.

Fixes: eabe533904cb ("platform/x86: ideapad-laptop: DYTC Platform profile support")
Fixes: c3bfcd4c6762 ("platform/x86: thinkpad_acpi: Add platform profile support")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/platform/x86/ideapad-laptop.c | 11 ++++++-----
 drivers/platform/x86/thinkpad_acpi.c  | 10 +++++-----
 2 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/drivers/platform/x86/ideapad-laptop.c b/drivers/platform/x86/ideapad-laptop.c
index cc42af2a0a98..6095a4d54881 100644
--- a/drivers/platform/x86/ideapad-laptop.c
+++ b/drivers/platform/x86/ideapad-laptop.c
@@ -656,8 +656,8 @@ static int convert_profile_to_dytc(enum platform_profile_option profile, int *pe
  * dytc_profile_get: Function to register with platform_profile
  * handler. Returns current platform profile.
  */
-int dytc_profile_get(struct platform_profile_handler *pprof,
-			enum platform_profile_option *profile)
+static int dytc_profile_get(struct platform_profile_handler *pprof,
+			    enum platform_profile_option *profile)
 {
 	struct ideapad_dytc_priv *dytc;
 
@@ -673,7 +673,8 @@ int dytc_profile_get(struct platform_profile_handler *pprof,
  *  - enable CQL
  *  If not in CQL mode, just run the command
  */
-int dytc_cql_command(struct ideapad_private *priv, int command, int *output)
+static int dytc_cql_command(struct ideapad_private *priv, int command,
+			    int *output)
 {
 	int err, cmd_err, dummy;
 	int cur_funcmode;
@@ -710,8 +711,8 @@ int dytc_cql_command(struct ideapad_private *priv, int command, int *output)
  * dytc_profile_set: Function to register with platform_profile
  * handler. Sets current platform profile.
  */
-int dytc_profile_set(struct platform_profile_handler *pprof,
-			enum platform_profile_option profile)
+static int dytc_profile_set(struct platform_profile_handler *pprof,
+			    enum platform_profile_option profile)
 {
 	struct ideapad_dytc_priv *dytc;
 	struct ideapad_private *priv;
diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
index 18b390153e7f..42e0a497d69e 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -10078,8 +10078,8 @@ static int convert_profile_to_dytc(enum platform_profile_option profile, int *pe
  * dytc_profile_get: Function to register with platform_profile
  * handler. Returns current platform profile.
  */
-int dytc_profile_get(struct platform_profile_handler *pprof,
-			enum platform_profile_option *profile)
+static int dytc_profile_get(struct platform_profile_handler *pprof,
+			    enum platform_profile_option *profile)
 {
 	*profile = dytc_current_profile;
 	return 0;
@@ -10092,7 +10092,7 @@ int dytc_profile_get(struct platform_profile_handler *pprof,
  *  - enable CQL
  *  If not in CQL mode, just run the command
  */
-int dytc_cql_command(int command, int *output)
+static int dytc_cql_command(int command, int *output)
 {
 	int err, cmd_err, dummy;
 	int cur_funcmode;
@@ -10130,8 +10130,8 @@ int dytc_cql_command(int command, int *output)
  * dytc_profile_set: Function to register with platform_profile
  * handler. Sets current platform profile.
  */
-int dytc_profile_set(struct platform_profile_handler *pprof,
-			enum platform_profile_option profile)
+static int dytc_profile_set(struct platform_profile_handler *pprof,
+			    enum platform_profile_option profile)
 {
 	int output;
 	int err;
-- 
2.29.2


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

* Re: [PATCH] platform/x86: ideapad-laptop/thinkpad_acpi: mark conflicting symbols static
  2021-02-04 15:38 [PATCH] platform/x86: ideapad-laptop/thinkpad_acpi: mark conflicting symbols static Arnd Bergmann
@ 2021-02-04 16:19 ` Hans de Goede
  0 siblings, 0 replies; 2+ messages in thread
From: Hans de Goede @ 2021-02-04 16:19 UTC (permalink / raw)
  To: Arnd Bergmann, Ike Panhc, Mark Gross,
	Henrique de Moraes Holschuh, Jiaxun Yang, Mark Pearson
  Cc: Arnd Bergmann, Andy Shevchenko, Nitin Joshi, Tom Rix, Aaron Ma,
	platform-driver-x86, linux-kernel, ibm-acpi-devel

Hi Arnd,

On 2/4/21 4:38 PM, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> Three of the newly added functions are accidently not marked 'static' which
> causes a warning when building with W=1
> 
> drivers/platform/x86/thinkpad_acpi.c:10081:5: warning: no previous prototype for function 'dytc_profile_get' [-Wmissing-prototypes]
> drivers/platform/x86/thinkpad_acpi.c:10095:5: warning: no previous prototype for function 'dytc_cql_command' [-Wmissing-prototypes]
> drivers/platform/x86/thinkpad_acpi.c:10133:5: warning: no previous prototype for function 'dytc_profile_set' [-Wmissing-prototypes]
> 
> The functions are also present in two files, causing a link error when
> both are built into the kernel:

Thank you for your patch, but the issue has already been fixed in both drivers
in my review-hans branch (which will become for-next soon):

https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/log/?h=review-hans

(note the ideapad fix is part of the big set of ideapad cleanups)

Regards,

Hans




> 
> ld.lld: error: duplicate symbol: dytc_cql_command
>>>> defined at ideapad-laptop.c
>>>>            platform/x86/ideapad-laptop.o:(dytc_cql_command) in archive drivers/built-in.a
>>>> defined at thinkpad_acpi.c
>>>>            platform/x86/thinkpad_acpi.o:(.text+0x20) in archive drivers/built-in.a
> 
> ld.lld: error: duplicate symbol: dytc_profile_get
>>>> defined at ideapad-laptop.c
>>>>            platform/x86/ideapad-laptop.o:(dytc_profile_get) in archive drivers/built-in.a
>>>> defined at thinkpad_acpi.c
>>>>            platform/x86/thinkpad_acpi.o:(.text+0x0) in archive drivers/built-in.a
> 
> ld.lld: error: duplicate symbol: dytc_profile_set
>>>> defined at ideapad-laptop.c
>>>>            platform/x86/ideapad-laptop.o:(dytc_profile_set) in archive drivers/built-in.a
>>>> defined at thinkpad_acpi.c
>>>>            platform/x86/thinkpad_acpi.o:(.text+0x220) in archive drivers/built-in.a
> 
> Mark these all as static to avoid both problems.
> 
> Fixes: eabe533904cb ("platform/x86: ideapad-laptop: DYTC Platform profile support")
> Fixes: c3bfcd4c6762 ("platform/x86: thinkpad_acpi: Add platform profile support")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  drivers/platform/x86/ideapad-laptop.c | 11 ++++++-----
>  drivers/platform/x86/thinkpad_acpi.c  | 10 +++++-----
>  2 files changed, 11 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/platform/x86/ideapad-laptop.c b/drivers/platform/x86/ideapad-laptop.c
> index cc42af2a0a98..6095a4d54881 100644
> --- a/drivers/platform/x86/ideapad-laptop.c
> +++ b/drivers/platform/x86/ideapad-laptop.c
> @@ -656,8 +656,8 @@ static int convert_profile_to_dytc(enum platform_profile_option profile, int *pe
>   * dytc_profile_get: Function to register with platform_profile
>   * handler. Returns current platform profile.
>   */
> -int dytc_profile_get(struct platform_profile_handler *pprof,
> -			enum platform_profile_option *profile)
> +static int dytc_profile_get(struct platform_profile_handler *pprof,
> +			    enum platform_profile_option *profile)
>  {
>  	struct ideapad_dytc_priv *dytc;
>  
> @@ -673,7 +673,8 @@ int dytc_profile_get(struct platform_profile_handler *pprof,
>   *  - enable CQL
>   *  If not in CQL mode, just run the command
>   */
> -int dytc_cql_command(struct ideapad_private *priv, int command, int *output)
> +static int dytc_cql_command(struct ideapad_private *priv, int command,
> +			    int *output)
>  {
>  	int err, cmd_err, dummy;
>  	int cur_funcmode;
> @@ -710,8 +711,8 @@ int dytc_cql_command(struct ideapad_private *priv, int command, int *output)
>   * dytc_profile_set: Function to register with platform_profile
>   * handler. Sets current platform profile.
>   */
> -int dytc_profile_set(struct platform_profile_handler *pprof,
> -			enum platform_profile_option profile)
> +static int dytc_profile_set(struct platform_profile_handler *pprof,
> +			    enum platform_profile_option profile)
>  {
>  	struct ideapad_dytc_priv *dytc;
>  	struct ideapad_private *priv;
> diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
> index 18b390153e7f..42e0a497d69e 100644
> --- a/drivers/platform/x86/thinkpad_acpi.c
> +++ b/drivers/platform/x86/thinkpad_acpi.c
> @@ -10078,8 +10078,8 @@ static int convert_profile_to_dytc(enum platform_profile_option profile, int *pe
>   * dytc_profile_get: Function to register with platform_profile
>   * handler. Returns current platform profile.
>   */
> -int dytc_profile_get(struct platform_profile_handler *pprof,
> -			enum platform_profile_option *profile)
> +static int dytc_profile_get(struct platform_profile_handler *pprof,
> +			    enum platform_profile_option *profile)
>  {
>  	*profile = dytc_current_profile;
>  	return 0;
> @@ -10092,7 +10092,7 @@ int dytc_profile_get(struct platform_profile_handler *pprof,
>   *  - enable CQL
>   *  If not in CQL mode, just run the command
>   */
> -int dytc_cql_command(int command, int *output)
> +static int dytc_cql_command(int command, int *output)
>  {
>  	int err, cmd_err, dummy;
>  	int cur_funcmode;
> @@ -10130,8 +10130,8 @@ int dytc_cql_command(int command, int *output)
>   * dytc_profile_set: Function to register with platform_profile
>   * handler. Sets current platform profile.
>   */
> -int dytc_profile_set(struct platform_profile_handler *pprof,
> -			enum platform_profile_option profile)
> +static int dytc_profile_set(struct platform_profile_handler *pprof,
> +			    enum platform_profile_option profile)
>  {
>  	int output;
>  	int err;
> 


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

end of thread, other threads:[~2021-02-04 16:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-04 15:38 [PATCH] platform/x86: ideapad-laptop/thinkpad_acpi: mark conflicting symbols static Arnd Bergmann
2021-02-04 16:19 ` Hans de Goede

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.