From: Tejun Heo <tj@kernel.org>
To: Jeff Garzik <jgarzik@redhat.com>
Cc: Fang Wenqi <anton.fang@gmail.com>,
linux-ide@vger.kernel.org, Alan Cox <alan@lxorguk.ukuu.org.uk>,
antonf@turbolinux.com.cn
Subject: Re: [PATCH] drivers/ata/libata-eh.c: fix unused variable warning
Date: Fri, 23 Apr 2010 09:01:04 +0200 [thread overview]
Message-ID: <4BD145B0.8080102@kernel.org> (raw)
In-Reply-To: <20100423064332.GA22988@shell.devel.redhat.com>
Hello, Jeff.
On 04/23/2010 08:43 AM, Jeff Garzik wrote:
> On Fri, Apr 23, 2010 at 08:30:28AM +0200, Tejun Heo wrote:
>> On 04/22/2010 03:23 AM, Fang Wenqi wrote:
>>> Sorry that the title should be:
>>> "fix uninitialized variable warning"
>>>
>>> not
>>> "fix unused variable warning"
>>>
>>> Need I re-send the patch mail ?
>>
>> Yes, please do so. gcc 4.4.1 generates a spurious warning on it too.
>>
>> Acked-by: Tejun Heo <tj@kernel.org>
>
> It's not a spurious warning. The code failed to fully initialize all
> fields of the ata_taskfile structure, prior to copying the ata_taskfile
> structure into qc->result_tf.
Hmmmm.... right, I've always thought it was gcc not noticing the
structure is being initialized in ata_eh_read_log_10h() but it
actually is noticing much more, so something like the following is
more appropriate?
Subject: libata: fully initialize @tf in ata_eh_read_log_10h()
ata_eh_read_log_10h() filled @tf only partially. It didn't cause any
correctness issues but triggered spruious uninitialized variable
warning. Do ata_tf_init() before filling in @tf.
Signed-off-by: Tejun Heo <tj@kernel.org>
---
drivers/ata/libata-eh.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
index 9f6cfac..fa7e902 100644
--- a/drivers/ata/libata-eh.c
+++ b/drivers/ata/libata-eh.c
@@ -1434,6 +1434,7 @@ static int ata_eh_read_log_10h(struct ata_device *dev,
*tag = buf[0] & 0x1f;
+ ata_tf_init(dev, tf);
tf->command = buf[2];
tf->feature = buf[3];
tf->lbal = buf[4];
next prev parent reply other threads:[~2010-04-23 7:01 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-21 14:07 [PATCH] drivers/ata/libata-eh.c: fix unused variable warning Fang Wenqi
2010-04-21 14:24 ` Alan Cox
2010-04-21 14:57 ` Fang Wenqi
2010-04-22 1:23 ` Fang Wenqi
2010-04-23 6:30 ` Tejun Heo
2010-04-23 6:43 ` Jeff Garzik
2010-04-23 7:01 ` Tejun Heo [this message]
2010-04-23 13:52 ` Jeff Garzik
2010-04-23 14:02 ` Tejun Heo
2010-04-23 14:07 ` Sergei Shtylyov
2010-04-23 14:18 ` Jeff Garzik
2010-04-23 6:48 ` Fang Wenqi
2010-04-23 1:54 ` Jeff Garzik
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=4BD145B0.8080102@kernel.org \
--to=tj@kernel.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=anton.fang@gmail.com \
--cc=antonf@turbolinux.com.cn \
--cc=jgarzik@redhat.com \
--cc=linux-ide@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