All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Chunhe Lan <Chunhe.Lan@freescale.com>
Cc: linux-serial@vger.kernel.org
Subject: Re: [PATCH] serial: 8250: Fix a compiler warning
Date: Tue, 25 Nov 2014 12:16:07 -0800	[thread overview]
Message-ID: <20141125201607.GA30950@kroah.com> (raw)
In-Reply-To: <1415785741-13009-1-git-send-email-Chunhe.Lan@freescale.com>

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

      reply	other threads:[~2014-11-25 20:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-12  9:49 [PATCH] serial: 8250: Fix a compiler warning Chunhe Lan
2014-11-25 20:16 ` Greg Kroah-Hartman [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20141125201607.GA30950@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=Chunhe.Lan@freescale.com \
    --cc=linux-serial@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.