All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] serial: 8250: Fix a compiler warning
@ 2014-11-12  9:49 Chunhe Lan
  2014-11-25 20:16 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 2+ messages in thread
From: Chunhe Lan @ 2014-11-12  9:49 UTC (permalink / raw)
  To: linux-serial; +Cc: Chunhe Lan, Greg Kroah-Hartman

Spotted by a compile warning:

drivers/tty/serial/8250/8250_core.c: In function
  'serial8250_shutdown':
drivers/tty/serial/8250/8250_core.c:1747:18: warning:
  'i' may be used uninitialized in this function [-Wuninitialized]
drivers/tty/serial/8250/8250_core.c:1725:19: note:
  'i' was declared here

Just because it annoys user.

Signed-off-by: Chunhe Lan <Chunhe.Lan@freescale.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/tty/serial/8250/8250_core.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/tty/serial/8250/8250_core.c b/drivers/tty/serial/8250/8250_core.c
index 312a83f..894a357 100644
--- a/drivers/tty/serial/8250/8250_core.c
+++ b/drivers/tty/serial/8250/8250_core.c
@@ -1722,7 +1722,7 @@ static int serial_link_irq_chain(struct uart_8250_port *up)
 
 static void serial_unlink_irq_chain(struct uart_8250_port *up)
 {
-	struct irq_info *i;
+	struct irq_info *i = NULL;
 	struct hlist_node *n;
 	struct hlist_head *h;
 
-- 
1.7.6.5


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

* Re: [PATCH] serial: 8250: Fix a compiler warning
  2014-11-12  9:49 [PATCH] serial: 8250: Fix a compiler warning Chunhe Lan
@ 2014-11-25 20:16 ` Greg Kroah-Hartman
  0 siblings, 0 replies; 2+ messages in thread
From: Greg Kroah-Hartman @ 2014-11-25 20:16 UTC (permalink / raw)
  To: Chunhe Lan; +Cc: linux-serial

On Wed, Nov 12, 2014 at 05:49:01PM +0800, Chunhe Lan wrote:
> Spotted by a compile warning:
> 
> drivers/tty/serial/8250/8250_core.c: In function
>   'serial8250_shutdown':
> drivers/tty/serial/8250/8250_core.c:1747:18: warning:
>   'i' may be used uninitialized in this function [-Wuninitialized]
> drivers/tty/serial/8250/8250_core.c:1725:19: note:
>   'i' was declared here
> 
> Just because it annoys user.
> 
> Signed-off-by: Chunhe Lan <Chunhe.Lan@freescale.com>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> ---
>  drivers/tty/serial/8250/8250_core.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/tty/serial/8250/8250_core.c b/drivers/tty/serial/8250/8250_core.c
> index 312a83f..894a357 100644
> --- a/drivers/tty/serial/8250/8250_core.c
> +++ b/drivers/tty/serial/8250/8250_core.c
> @@ -1722,7 +1722,7 @@ static int serial_link_irq_chain(struct uart_8250_port *up)
>  
>  static void serial_unlink_irq_chain(struct uart_8250_port *up)
>  {
> -	struct irq_info *i;
> +	struct irq_info *i = NULL;

Don't paper over gcc bugs by putting unneeded initializations in the
kernel.  Try upgraging your version of gcc, I don't see this using
4.9.2.

thanks,

greg k-h

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

end of thread, other threads:[~2014-11-25 20:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-12  9:49 [PATCH] serial: 8250: Fix a compiler warning Chunhe Lan
2014-11-25 20:16 ` Greg Kroah-Hartman

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.