From: Greg KH <greg@kroah.com>
To: Jiri Slaby <jslaby@novell.com>
Cc: akpm@linux-foundation.org, linux-kernel@vger.kernel.org,
Alan Cox <alan@linux.intel.com>,
Greg Kroah-Hartman <gregkh@suse.de>
Subject: Re: [PATCH 1/1] Char: cyclades, fix compiler warning
Date: Fri, 20 Nov 2009 09:43:28 -0800 [thread overview]
Message-ID: <20091120174328.GB14888@kroah.com> (raw)
In-Reply-To: <1258546702-29591-1-git-send-email-jslaby@novell.com>
On Wed, Nov 18, 2009 at 01:18:22PM +0100, Jiri Slaby wrote:
> With gcc 4.0.2:
> drivers/char/cyclades.c: In function 'cyy_interrupt':
> drivers/char/cyclades.c:581: warning: 'info' may be used uninitialized in this function
>
> introduced by
>
> : commit 3aeea5b92210083c7cffd4f08a0bb141d3f2d574
> : Author: Jiri Slaby <jirislaby@gmail.com>
> : AuthorDate: Sat Sep 19 13:13:16 2009 -0700
> : Commit: Live-CD User <linux@linux.site>
> : CommitDate: Sat Sep 19 13:13:16 2009 -0700
> :
> : cyclades: introduce cyy_readb/writeb
>
> In fact the true branch which uses uninitialized 'info' can never
> happen because chip is always less than ->nchips and channel is
> always less than 4 which we alloc.
>
> So behave similar to rx handling and remove the test completely.
>
> I wonder why gcc 4.4.1 doesn't spit a word.
>
> Reported-by: Andrew Morton <akpm@linux-foundation.org>
> Cc: Alan Cox <alan@linux.intel.com>
> Cc: Greg Kroah-Hartman <gregkh@suse.de>
> Signed-off-by: Jiri Slaby <jslaby@novell.com>
> ---
> drivers/char/cyclades.c | 8 +-------
> 1 files changed, 1 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/char/cyclades.c b/drivers/char/cyclades.c
> index a188c05..e026f24 100644
> --- a/drivers/char/cyclades.c
> +++ b/drivers/char/cyclades.c
> @@ -595,14 +595,8 @@ static void cyy_chip_tx(struct cyclades_card *cinfo, unsigned int chip,
> channel = save_xir & CyIRChannel;
> save_car = readb(base_addr + (CyCAR << index));
> cy_writeb(base_addr + (CyCAR << index), save_xir);
> - info = &cinfo->ports[channel + chip * 4];
>
> - /* validate the port# (as configured and open) */
> - if (channel + chip * 4 >= cinfo->nports) {
> - cy_writeb(base_addr + (CySRER << index),
> - readb(base_addr + (CySRER << index)) & ~CyTxRdy);
> - goto end;
> - }
> + info = &cinfo->ports[channel + chip * 4];
Wierd, but this doesn't apply at all to my or Linus's tree. Are there
some other cyclades patch floating around out there that is needed here
before this one?
thanks,
greg k-h
next prev parent reply other threads:[~2009-11-20 17:43 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20091114080505.7715b022.akpm@linux-foundation.org>
2009-11-18 12:18 ` [PATCH 1/1] Char: cyclades, fix compiler warning Jiri Slaby
2009-11-20 17:43 ` Greg KH [this message]
2009-11-20 23:51 ` Andrew Morton
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=20091120174328.GB14888@kroah.com \
--to=greg@kroah.com \
--cc=akpm@linux-foundation.org \
--cc=alan@linux.intel.com \
--cc=gregkh@suse.de \
--cc=jslaby@novell.com \
--cc=linux-kernel@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