linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dirk Behme <dirk.behme@gmail.com>
To: linux-ide@vger.kernel.org
Cc: Jeff Garzik <jgarzik@pobox.com>
Subject: Re: [PATCH] libata-core: disable uninitialized var warning
Date: Thu, 20 Dec 2012 15:14:44 +0100	[thread overview]
Message-ID: <50D31D54.2040907@gmail.com> (raw)
In-Reply-To: <1356012638-4942-1-git-send-email-dirk.behme@gmail.com>

Am 20.12.2012 15:10, schrieb Dirk Behme:
> Make GCC happy by disabling the warning
>
> drivers/ata/libata-core.c: In function 'ata_hpa_resize':
> drivers/ata/libata-core.c:1394:3: warning: 'native_sectors' may be used uninitialized in this function [-Wmaybe-uninitialized]
>
> Looking on the code, 'native_sectors' is always initialized by calling
> ata_read_native_max_address(dev, &native_sectors).
>
> Signed-off-by: Dirk Behme <dirk.behme@gmail.com>
> CC: Jeff Garzik <jgarzik@pobox.com>

Ah, sorry, just saw that there is already a similar discussion from 
today. Seems this didn't make it to Google, yet ;)

Dirk

> ---
>   drivers/ata/libata-core.c |    2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
> index 9e8b99a..21623cf 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 /* GCC */;
>   	int rc;
>
>   	/* do we need to do it? */
>


  reply	other threads:[~2012-12-20 14:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-20 14:10 [PATCH] libata-core: disable uninitialized var warning Dirk Behme
2012-12-20 14:14 ` Dirk Behme [this message]
2012-12-20 14:42   ` Dirk Behme

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=50D31D54.2040907@gmail.com \
    --to=dirk.behme@gmail.com \
    --cc=jgarzik@pobox.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;
as well as URLs for NNTP newsgroup(s).