Linux ATA/IDE development
 help / color / mirror / Atom feed
From: Jeff Garzik <jeff@garzik.org>
To: Tejun Heo <tj@kernel.org>
Cc: Jeff Garzik <jgarzik@redhat.com>,
	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:52:46 -0400	[thread overview]
Message-ID: <4BD1A62E.5070602@garzik.org> (raw)
In-Reply-To: <4BD145B0.8080102@kernel.org>

On 04/23/2010 03:01 AM, Tejun Heo wrote:
> 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>

Sorry, I should have also pointed out that a fix went upstream to Linus 
in the last batch of fixes...

	Jeff





  reply	other threads:[~2010-04-23 13:52 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
2010-04-23 13:52             ` Jeff Garzik [this message]
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=4BD1A62E.5070602@garzik.org \
    --to=jeff@garzik.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 \
    --cc=tj@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