diff mbox series

[3/3] tty: hvc_xen: hide xen_console_remove when unused

Message ID 1453758918-3577213-3-git-send-email-arnd@arndb.de
State Accepted
Commit e36ae3439936e13c33f5841c7c2c1a9875acbb6d
Headers show
Series [1/3] tty: nozomi: avoid a harmless gcc warning | expand

Commit Message

Arnd Bergmann Jan. 25, 2016, 9:54 p.m. UTC
xencons_disconnect_backend() is only called from xen_console_remove(),
which is conditionally compiled, so we get a harmless warning when
CONFIG_HVC_XEN_FRONTEND is unset:

hvc/hvc_xen.c:350:12: error: 'xen_console_remove' defined but not used [-Werror=unused-function]

This moves the function down into the same #ifdef section to silence
the warning.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>

---
 drivers/tty/hvc/hvc_xen.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.7.0

Comments

Boris Ostrovsky Jan. 25, 2016, 11:05 p.m. UTC | #1
On 01/25/2016 04:54 PM, Arnd Bergmann wrote:
> xencons_disconnect_backend() is only called from xen_console_remove(),


and also from xencons_probe()/xencons_resume(). But those two are also 
under the
same ifdef.

-boris

> which is conditionally compiled, so we get a harmless warning when

> CONFIG_HVC_XEN_FRONTEND is unset:

>

> hvc/hvc_xen.c:350:12: error: 'xen_console_remove' defined but not used [-Werror=unused-function]

>

> This moves the function down into the same #ifdef section to silence

> the warning.

>

> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

> ---

>   drivers/tty/hvc/hvc_xen.c | 2 +-

>   1 file changed, 1 insertion(+), 1 deletion(-)

>

> diff --git a/drivers/tty/hvc/hvc_xen.c b/drivers/tty/hvc/hvc_xen.c

> index fa816b7193b6..11725422dacb 100644

> --- a/drivers/tty/hvc/hvc_xen.c

> +++ b/drivers/tty/hvc/hvc_xen.c

> @@ -323,6 +323,7 @@ void xen_console_resume(void)

>   	}

>   }

>   

> +#ifdef CONFIG_HVC_XEN_FRONTEND

>   static void xencons_disconnect_backend(struct xencons_info *info)

>   {

>   	if (info->irq > 0)

> @@ -363,7 +364,6 @@ static int xen_console_remove(struct xencons_info *info)

>   	return 0;

>   }

>   

> -#ifdef CONFIG_HVC_XEN_FRONTEND

>   static int xencons_remove(struct xenbus_device *dev)

>   {

>   	return xen_console_remove(dev_get_drvdata(&dev->dev));
Stefano Stabellini Jan. 26, 2016, 12:25 p.m. UTC | #2
On Mon, 25 Jan 2016, Boris Ostrovsky wrote:
> On 01/25/2016 04:54 PM, Arnd Bergmann wrote:

> > xencons_disconnect_backend() is only called from xen_console_remove(),

> 

> and also from xencons_probe()/xencons_resume(). But those two are also under

> the

> same ifdef.


Good point. Aside from this the patch is good.

 
> > which is conditionally compiled, so we get a harmless warning when

> > CONFIG_HVC_XEN_FRONTEND is unset:

> > 

> > hvc/hvc_xen.c:350:12: error: 'xen_console_remove' defined but not used

> > [-Werror=unused-function]

> > 

> > This moves the function down into the same #ifdef section to silence

> > the warning.

> > 

> > Signed-off-by: Arnd Bergmann <arnd@arndb.de>

> > ---

> >   drivers/tty/hvc/hvc_xen.c | 2 +-

> >   1 file changed, 1 insertion(+), 1 deletion(-)

> > 

> > diff --git a/drivers/tty/hvc/hvc_xen.c b/drivers/tty/hvc/hvc_xen.c

> > index fa816b7193b6..11725422dacb 100644

> > --- a/drivers/tty/hvc/hvc_xen.c

> > +++ b/drivers/tty/hvc/hvc_xen.c

> > @@ -323,6 +323,7 @@ void xen_console_resume(void)

> >   	}

> >   }

> >   +#ifdef CONFIG_HVC_XEN_FRONTEND

> >   static void xencons_disconnect_backend(struct xencons_info *info)

> >   {

> >   	if (info->irq > 0)

> > @@ -363,7 +364,6 @@ static int xen_console_remove(struct xencons_info *info)

> >   	return 0;

> >   }

> >   -#ifdef CONFIG_HVC_XEN_FRONTEND

> >   static int xencons_remove(struct xenbus_device *dev)

> >   {

> >   	return xen_console_remove(dev_get_drvdata(&dev->dev));

>
diff mbox series

Patch

diff --git a/drivers/tty/hvc/hvc_xen.c b/drivers/tty/hvc/hvc_xen.c
index fa816b7193b6..11725422dacb 100644
--- a/drivers/tty/hvc/hvc_xen.c
+++ b/drivers/tty/hvc/hvc_xen.c
@@ -323,6 +323,7 @@  void xen_console_resume(void)
 	}
 }
 
+#ifdef CONFIG_HVC_XEN_FRONTEND
 static void xencons_disconnect_backend(struct xencons_info *info)
 {
 	if (info->irq > 0)
@@ -363,7 +364,6 @@  static int xen_console_remove(struct xencons_info *info)
 	return 0;
 }
 
-#ifdef CONFIG_HVC_XEN_FRONTEND
 static int xencons_remove(struct xenbus_device *dev)
 {
 	return xen_console_remove(dev_get_drvdata(&dev->dev));