Linux ATA/IDE development
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sshtylyov@mvista.com>
To: Simon Que <sque@chromium.org>
Cc: linux-ide@vger.kernel.org, msb@chromium.org
Subject: Re: [PATCH v3] ata: libata-core: initialize native_sectors in ata_hpa_resize()
Date: Fri, 25 Jan 2013 15:21:53 +0400	[thread overview]
Message-ID: <51026AD1.7070202@mvista.com> (raw)
In-Reply-To: <1359057478-3920-1-git-send-email-sque@chromium.org>

Hello.

On 24-01-2013 23:57, Simon Que wrote:

> Eliminates a compiler warning about uninitialized variable.
> "warning: 'native_sectors' may be used uninitialized in this function"

> Signed-off-by: Simon Que <sque@chromium.org>
> ---
>   drivers/ata/libata-core.c |    2 +-
>   1 files changed, 1 insertions(+), 1 deletions(-)

> diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
> index d2b18ea..b185db1 100644
> --- a/drivers/ata/libata-core.c
> +++ b/drivers/ata/libata-core.c
> @@ -1324,7 +1324,7 @@ static int ata_hpa_resize(struct ata_device *dev)
>   	int print_info = ehc->i.flags & ATA_EHI_PRINTINFO;
>   	bool unlock_hpa = ata_ignore_hpa || dev->flags & ATA_DFLAG_UNLOCK_HPA;
>   	u64 sectors = ata_id_n_sectors(dev->id);
> -	u64 native_sectors;
> +	u64 native_sectors = 0;

    Isn't it wiser to set it to 'sectors'? And frankly speaking I don't see 
how this variable may indeed be used unitialized. What version of gcc are you 
using?

MBR, Sergei


  reply	other threads:[~2013-01-25 11:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-24 19:57 [PATCH v3] ata: libata-core: initialize native_sectors in ata_hpa_resize() Simon Que
2013-01-25 11:21 ` Sergei Shtylyov [this message]
2013-01-25 23:31   ` Simon Que
2013-01-28 20:39     ` Simon Que

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=51026AD1.7070202@mvista.com \
    --to=sshtylyov@mvista.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=msb@chromium.org \
    --cc=sque@chromium.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