Skip to contentSkip to conversation

memstick r592: make memstick_debug_get_tpc_name() static

PATCH In review Arnd Bergmann 2 participants 2 messages May 16, 2023 – May 24, 2023

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 memstick r592: make memstick_debug_get_tpc_name() static

From: Arnd Bergmann <[email protected]>

There are no other files referencing this function, apparently it was left global to avoid an 'unused function' warning when the only caller is left out. With a 'W=1' build, it causes a 'missing prototype' warning though:

drivers/memstick/host/r592.c:47:13: error: no previous prototype for 'memstick_debug_get_tpc_name' [-Werror=missing-prototypes]

Annotate the function as 'static __maybe_unused' to avoid both problems.

Fixes 926341250102 ("memstick: add driver for Ricoh R5C592 card reader")
---
 drivers/memstick/host/r592.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/memstick/host/r592.c +1 -3
index 42bfc46842b8..461f5ffd02bc 100644
@@ -44,12 +44,10 @@ static const char *tpc_names[] = {
  * memstick_debug_get_tpc_name - debug helper that returns string for
  * a TPC number
  */
-const char *memstick_debug_get_tpc_name(int tpc)
+static __maybe_unused const char *memstick_debug_get_tpc_name(int tpc)
 {
 	return tpc_names[tpc-1];
 }
-EXPORT_SYMBOL(memstick_debug_get_tpc_name);
-
 
 /* Read a register*/
 static inline u32 r592_read_reg(struct r592_device *dev, int address)
Signature · 1 line
2.39.2
#1 lore raw
Quoted 8 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

There are no other files referencing this function, apparently it was left global to avoid an 'unused function' warning when the only caller is left out. With a 'W=1' build, it causes a 'missing prototype' warning though:

Quoted 7 lines

drivers/memstick/host/r592.c:47:13: error: no previous prototype for 'memstick_debug_get_tpc_name' [-Werror=missing-prototypes]

Annotate the function as 'static __maybe_unused' to avoid both problems.

Fixes 926341250102 ("memstick: add driver for Ricoh R5C592 card reader")

Applied for next, thanks!

Kind regards
Uffe

Quoted 25 lines
---
 drivers/memstick/host/r592.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/memstick/host/r592.c +1 -4
index 42bfc46842b8..461f5ffd02bc 100644
@@ -44,12 +44,10 @@ static const char *tpc_names[] = {
  * memstick_debug_get_tpc_name - debug helper that returns string for
  * a TPC number
  */
-const char *memstick_debug_get_tpc_name(int tpc)
+static __maybe_unused const char *memstick_debug_get_tpc_name(int tpc)
 {
        return tpc_names[tpc-1];
 }
-EXPORT_SYMBOL(memstick_debug_get_tpc_name);
-
 
 /* Read a register*/
 static inline u32 r592_read_reg(struct r592_device *dev, int address)
--

2.39.2