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


Groups > linux.kernel > #1490561 > unrolled thread

[PATCH] memstick: r592: add function declaration

Started byBaoyou Xie <baoyou.xie@linaro.org>
First post2016-09-24 07:40 +0200
Last post2016-09-24 10:50 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] memstick: r592: add function declaration Baoyou Xie <baoyou.xie@linaro.org> - 2016-09-24 07:40 +0200
    Re: [PATCH] memstick: r592: add function declaration Arnd Bergmann <arnd@arndb.de> - 2016-09-24 10:50 +0200

#1490561 — [PATCH] memstick: r592: add function declaration

FromBaoyou Xie <baoyou.xie@linaro.org>
Date2016-09-24 07:40 +0200
Subject[PATCH] memstick: r592: add function declaration
Message-ID<skNQR-5pm-1@gated-at.bofh.it>
We get 1 warning when building kernel with W=1:
drivers/memstick/host/r592.c:50:13: warning: no previous prototype for 'memstick_debug_get_tpc_name' [-Wmissing-prototypes]

In fact, this function need be declared in a header files.

So this patch adds function declaration in
drivers/memstick/host/r592.h.

Signed-off-by: Baoyou Xie <baoyou.xie@linaro.org>
---
 drivers/memstick/host/r592.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/memstick/host/r592.h b/drivers/memstick/host/r592.h
index c5726c1..c5d91cd 100644
--- a/drivers/memstick/host/r592.h
+++ b/drivers/memstick/host/r592.h
@@ -172,4 +172,6 @@ struct r592_device {
 #define dbg_verbose(format, ...)	__dbg(2, format, ## __VA_ARGS__)
 #define dbg_reg(format, ...)		__dbg(3, format, ## __VA_ARGS__)
 
+const char *memstick_debug_get_tpc_name(int tpc);
+
 #endif
-- 
2.7.4

[toc] | [next] | [standalone]


#1490592

FromArnd Bergmann <arnd@arndb.de>
Date2016-09-24 10:50 +0200
Message-ID<skQOJ-7dQ-9@gated-at.bofh.it>
In reply to#1490561
On Saturday, September 24, 2016 1:32:26 PM CEST Baoyou Xie wrote:
> We get 1 warning when building kernel with W=1:
> drivers/memstick/host/r592.c:50:13: warning: no previous prototype for 'memstick_debug_get_tpc_name' [-Wmissing-prototypes]
> 
> In fact, this function need be declared in a header files.
> 
> So this patch adds function declaration in
> drivers/memstick/host/r592.h.
> 
> Signed-off-by: Baoyou Xie <baoyou.xie@linaro.org>
> ---
>  drivers/memstick/host/r592.h | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/memstick/host/r592.h b/drivers/memstick/host/r592.h
> index c5726c1..c5d91cd 100644
> --- a/drivers/memstick/host/r592.h
> +++ b/drivers/memstick/host/r592.h
> @@ -172,4 +172,6 @@ struct r592_device {
>  #define dbg_verbose(format, ...)       __dbg(2, format, ## __VA_ARGS__)
>  #define dbg_reg(format, ...)           __dbg(3, format, ## __VA_ARGS__)
>  
> +const char *memstick_debug_get_tpc_name(int tpc);
> +
>  #endif
> 

This looks wrong too. I don't see this function serving any purpose,
despite being exported.

It may be intended to be used by kernel debuggers, but those should
just look up the symbolic value of the enum memstick_tpc
definition instead.

Better just remove the function and the array above it.

	Arnd

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web