All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] HSI: omap_ssi_core: move function declaration to header file
@ 2016-09-24  5:11 Baoyou Xie
  2016-09-24  8:58 ` Arnd Bergmann
  0 siblings, 1 reply; 3+ messages in thread
From: Baoyou Xie @ 2016-09-24  5:11 UTC (permalink / raw)
  To: sre; +Cc: linux-kernel, arnd, baoyou.xie, xie.baoyou

We get 1 warning when building kernel with W=1:
drivers/hsi/controllers/omap_ssi_core.c:181:6: warning: no previous prototype for 'ssi_waketest' [-Wmissing-prototypes]

In fact, this function is declared in
drivers/hsi/clients/ssi_protocol.c, but should be declared
in a header file. So this patch moves the function declaration
to include/linux/hsi/hsi.h.

Signed-off-by: Baoyou Xie <baoyou.xie@linaro.org>
---
 drivers/hsi/clients/ssi_protocol.c | 2 --
 include/linux/hsi/hsi.h            | 1 +
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/hsi/clients/ssi_protocol.c b/drivers/hsi/clients/ssi_protocol.c
index 6031cd1..fe86444 100644
--- a/drivers/hsi/clients/ssi_protocol.c
+++ b/drivers/hsi/clients/ssi_protocol.c
@@ -45,8 +45,6 @@
 #include <linux/hsi/hsi.h>
 #include <linux/hsi/ssi_protocol.h>
 
-void ssi_waketest(struct hsi_client *cl, unsigned int enable);
-
 #define SSIP_TXQUEUE_LEN	100
 #define SSIP_MAX_MTU		65535
 #define SSIP_DEFAULT_MTU	4000
diff --git a/include/linux/hsi/hsi.h b/include/linux/hsi/hsi.h
index 5740254..676a656 100644
--- a/include/linux/hsi/hsi.h
+++ b/include/linux/hsi/hsi.h
@@ -161,6 +161,7 @@ static inline void *hsi_client_drvdata(struct hsi_client *cl)
 int hsi_register_port_event(struct hsi_client *cl,
 			void (*handler)(struct hsi_client *, unsigned long));
 int hsi_unregister_port_event(struct hsi_client *cl);
+void ssi_waketest(struct hsi_client *cl, unsigned int enable);
 
 /**
  * struct hsi_client_driver - Driver associated to an HSI client
-- 
2.7.4

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

* Re: [PATCH] HSI: omap_ssi_core: move function declaration to header file
  2016-09-24  5:11 [PATCH] HSI: omap_ssi_core: move function declaration to header file Baoyou Xie
@ 2016-09-24  8:58 ` Arnd Bergmann
  2016-09-24 19:36   ` Sebastian Reichel
  0 siblings, 1 reply; 3+ messages in thread
From: Arnd Bergmann @ 2016-09-24  8:58 UTC (permalink / raw)
  To: Baoyou Xie; +Cc: sre, linux-kernel, xie.baoyou

On Saturday, September 24, 2016 1:11:56 PM CEST Baoyou Xie wrote:
> ---
>  drivers/hsi/clients/ssi_protocol.c | 2 --
>  include/linux/hsi/hsi.h            | 1 +
>  2 files changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/hsi/clients/ssi_protocol.c b/drivers/hsi/clients/ssi_protocol.c
> index 6031cd1..fe86444 100644
> --- a/drivers/hsi/clients/ssi_protocol.c
> +++ b/drivers/hsi/clients/ssi_protocol.c
> @@ -45,8 +45,6 @@
>  #include <linux/hsi/hsi.h>
>  #include <linux/hsi/ssi_protocol.h>
>  
> -void ssi_waketest(struct hsi_client *cl, unsigned int enable);
> -
>  #define SSIP_TXQUEUE_LEN       100
>  #define SSIP_MAX_MTU           65535
>  #define SSIP_DEFAULT_MTU       4000
> 

Maybe the declaration should be moved to include/linux/hsi/ssi_protocol.h
instead of include/linux/hsi/hsi.h? It's not completely clear as the
exported function is a bit of a layering violation.

	Arnd

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

* Re: [PATCH] HSI: omap_ssi_core: move function declaration to header file
  2016-09-24  8:58 ` Arnd Bergmann
@ 2016-09-24 19:36   ` Sebastian Reichel
  0 siblings, 0 replies; 3+ messages in thread
From: Sebastian Reichel @ 2016-09-24 19:36 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: Baoyou Xie, linux-kernel, xie.baoyou

[-- Attachment #1: Type: text/plain, Size: 1550 bytes --]

Hi,

On Sat, Sep 24, 2016 at 10:58:15AM +0200, Arnd Bergmann wrote:
> On Saturday, September 24, 2016 1:11:56 PM CEST Baoyou Xie wrote:
> > ---
> >  drivers/hsi/clients/ssi_protocol.c | 2 --
> >  include/linux/hsi/hsi.h            | 1 +
> >  2 files changed, 1 insertion(+), 2 deletions(-)
> > 
> > diff --git a/drivers/hsi/clients/ssi_protocol.c b/drivers/hsi/clients/ssi_protocol.c
> > index 6031cd1..fe86444 100644
> > --- a/drivers/hsi/clients/ssi_protocol.c
> > +++ b/drivers/hsi/clients/ssi_protocol.c
> > @@ -45,8 +45,6 @@
> >  #include <linux/hsi/hsi.h>
> >  #include <linux/hsi/ssi_protocol.h>
> >  
> > -void ssi_waketest(struct hsi_client *cl, unsigned int enable);
> > -
> >  #define SSIP_TXQUEUE_LEN       100
> >  #define SSIP_MAX_MTU           65535
> >  #define SSIP_DEFAULT_MTU       4000
> > 
> 
> Maybe the declaration should be moved to include/linux/hsi/ssi_protocol.h
> instead of include/linux/hsi/hsi.h?

ssi_protocol.h is not included by the ssi (controller) driver, so
that will not fix the warning.

> It's not completely clear as the exported function is a bit of a
> layering violation.

Yes it is and the code contains a^W lots of FIXME about this. I have
not yet tried to remove it as suggested in the FIXME (which predates
my maintenance, but it's probably not possible without modifying the
modem FW).

I'm fine with adding it the function prototype to hsi.h to fix the
warning, but please add a comment, that it's a layering violation
and should not be used.

-- Sebastian

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

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

end of thread, other threads:[~2016-09-24 19:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-24  5:11 [PATCH] HSI: omap_ssi_core: move function declaration to header file Baoyou Xie
2016-09-24  8:58 ` Arnd Bergmann
2016-09-24 19:36   ` Sebastian Reichel

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.