Skip to contentSkip to conversation

soundwire: intel: Make sdw_intel_init static

PATCH Applied YueHaibing 4 participants 4 messages Apr 10, 2020 – Apr 23, 2020 SoundWire

lore
Share & tools
lore

YueHaibing

author
#0 lore raw

PATCH 1/1 soundwire: intel: Make sdw_intel_init static

Fix sparse warning:

drivers/soundwire/intel_init.c:193:6: warning:
symbol 'sdw_intel_init' was not declared. Should it be static?

---
 drivers/soundwire/intel_init.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/soundwire/intel_init.c +2 -1
index 4b769409f6f8..ad7053463889 100644
@@ -190,7 +190,8 @@ static acpi_status sdw_intel_acpi_cb(acpi_handle handle, u32 level,
  * This scans the namespace and creates SoundWire link controller devices
  * based on the info queried.
  */
-void *sdw_intel_init(acpi_handle *parent_handle, struct sdw_intel_res *res)
+static void *sdw_intel_init(acpi_handle *parent_handle,
+			    struct sdw_intel_res *res)
 {
 	acpi_status status;
 
Signature · 1 line
2.17.1
#1 lore raw
Quoted 16 lines · YueHaibing

Fix sparse warning:

drivers/soundwire/intel_init.c:193:6: warning:
symbol 'sdw_intel_init' was not declared. Should it be static?

---
  drivers/soundwire/intel_init.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
drivers/soundwire/intel_init.c +0 -0
index 4b769409f6f8..ad7053463889 100644

drivers/soundwire/intel_init.c static acpi_status sdw_intel_acpi_cb(acpi_handle handle, u32 level, · line 194

Quoted 6 lines
drivers/soundwire/intel_init.c +2 -1
@@ -190,7 +190,8 @@ static acpi_status sdw_intel_acpi_cb(acpi_handle handle, u32 level,
   * This scans the namespace and creates SoundWire link controller devices
   * based on the info queried.
   */
-void *sdw_intel_init(acpi_handle *parent_handle, struct sdw_intel_res *res)
+static void *sdw_intel_init(acpi_handle *parent_handle,
+			    struct sdw_intel_res *res)

This declaration has been this way since 2017, there are no users and it will be removed with the Intel patchsets, so fixing this warning doesn't really add much value. No sustained objection though.

Quoted 4 lines
drivers/soundwire/intel_init.c +0 -0
  {
  	acpi_status status;
 
maintainer Applied
#2 lore raw
In reply to YueHaibing
Quoted 4 lines · YueHaibing

Fix sparse warning:

drivers/soundwire/intel_init.c:193:6: warning:
symbol 'sdw_intel_init' was not declared. Should it be static?

Applied, thanks

Signature · 1 line
~Vinod
#3 lore raw
Quoted 10 lines · Vinod Koul
Quoted 4 lines · YueHaibing

Fix sparse warning:

drivers/soundwire/intel_init.c:193:6: warning:
symbol 'sdw_intel_init' was not declared. Should it be static?

Applied, thanks

Signature · 1 line
~Vinod

Why was this applied? It replaces one warning with another (that is actually visible during a normal kernel build):

$ make -j$(nproc) -s allyesconfig drivers/soundwire/intel_init.o
drivers/soundwire/intel_init.c:193:14: warning: ‘sdw_intel_init’ defined
but not used [-Wunused-function]
 static void *sdw_intel_init(acpi_handle *parent_handle,
               ^~~~~~~~~~~~~~

Cheers,
Nathan