linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Randy Dunlap <randy.dunlap@oracle.com>
To: dave@gnu.org
Cc: Greg Kroah-Hartman <gregkh@suse.de>,
	LKML <linux-kernel@vger.kernel.org>,
	linux-kbuild <linux-kbuild@vger.kernel.org>,
	linux-serial@vger.kernel.org
Subject: Re: [PATCH] serial: 8250: fix uninitialized compiler warning
Date: Tue, 9 Nov 2010 09:01:23 -0800	[thread overview]
Message-ID: <20101109090123.6a12f3f2.randy.dunlap@oracle.com> (raw)
In-Reply-To: <1289321723.2260.14.camel@cowboy>

On Tue, 09 Nov 2010 13:55:23 -0300 Davidlohr Bueso wrote:

> From: Davidlohr Bueso <dave@gnu.org>
> 
> This addresses:
> 
>   CC [M]  drivers/serial/8250.o
> drivers/serial/8250.c: In function ‘serial8250_shutdown’:
> drivers/serial/8250.c:1696: warning: ‘i’ may be used uninitialized in this function
> drivers/serial/8250.c:1696: note: ‘i’ was declared here

so in your analysis of this compiler warning, was the warning correct & justified,
or was it false?  I.e., is the init to NULL needed?

If it was false, could we just quieten the warning by using:

	struct irq_info *unitialized_var(i);

plus #include <linux/compiler.h> ?


> Signed-off-by: Davidlohr Bueso <dave@gnu.org>
> ---
>  drivers/serial/8250.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c
> index 4d8e14b..f734eee 100644
> --- a/drivers/serial/8250.c
> +++ b/drivers/serial/8250.c
> @@ -1693,7 +1693,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;
>  
> -- 


---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***
--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2010-11-09 17:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-09 16:55 [PATCH] serial: 8250: fix uninitialized compiler warning Davidlohr Bueso
2010-11-09 17:01 ` Randy Dunlap [this message]
2010-11-09 18:33 ` Alan Cox
2010-11-09 18:54   ` Davidlohr Bueso

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=20101109090123.6a12f3f2.randy.dunlap@oracle.com \
    --to=randy.dunlap@oracle.com \
    --cc=dave@gnu.org \
    --cc=gregkh@suse.de \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).