From patchwork Thu Dec 20 12:25:55 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Borislav Petkov X-Patchwork-Id: 207654 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id A8FAC2C00A6 for ; Thu, 20 Dec 2012 23:26:07 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752110Ab2LTM0F (ORCPT ); Thu, 20 Dec 2012 07:26:05 -0500 Received: from mail.skyhub.de ([78.46.96.112]:57186 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751602Ab2LTM0D (ORCPT ); Thu, 20 Dec 2012 07:26:03 -0500 X-Virus-Scanned: Nedap ESD1 at mail.skyhub.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alien8.de; s=alien8; t=1356006361; bh=DUxCMlZrVJMfKdgz3t8s9EzPubxH8nIB11Rmc7zvfvU=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version:Content-Type: Content-Transfer-Encoding; b=edtJFdjdOrmZgMZv2xdz+6YvPD4FSRCzFWJT/ +v/elkhcZOuTlmKunou7l1Szyw0ij9FzQrEOcuJkoFf4yjAPbN9VEjmQ9QCzL4fEEHn Com+UA34nMoieKO9lO+tZM9UKhQhiI982dpzkEXhxiQ0JlcF29XfKlmHlxix2BZelKo = Received: from mail.skyhub.de ([127.0.0.1]) by localhost (door.skyhub.de [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 0W7ontTvf-8z; Thu, 20 Dec 2012 13:26:01 +0100 (CET) Received: from liondog.tnic (p54B7FDE8.dip.t-dialin.net [84.183.253.232]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 2AF881D9CD1; Thu, 20 Dec 2012 13:26:01 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alien8.de; s=alien8; t=1356006361; bh=DUxCMlZrVJMfKdgz3t8s9EzPubxH8nIB11Rmc7zvfvU=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version:Content-Type: Content-Transfer-Encoding; b=edtJFdjdOrmZgMZv2xdz+6YvPD4FSRCzFWJT/ +v/elkhcZOuTlmKunou7l1Szyw0ij9FzQrEOcuJkoFf4yjAPbN9VEjmQ9QCzL4fEEHn Com+UA34nMoieKO9lO+tZM9UKhQhiI982dpzkEXhxiQ0JlcF29XfKlmHlxix2BZelKo = Received: by liondog.tnic (Postfix, from userid 1000) id 4B2F34B8DD7; Thu, 20 Dec 2012 13:26:00 +0100 (CET) From: Borislav Petkov To: LKML Cc: Borislav Petkov , Jeff Garzik , linux-ide@vger.kernel.org Subject: [PATCH] libata: Shut up annoying native_sectors warning Date: Thu, 20 Dec 2012 13:25:55 +0100 Message-Id: <1356006355-6819-1-git-send-email-bp@alien8.de> X-Mailer: git-send-email 1.8.1.rc2 MIME-Version: 1.0 Sender: linux-ide-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ide@vger.kernel.org I'm getting this drivers/ata/libata-core.c: In function ‘ata_hpa_resize’: drivers/ata/libata-core.c:1397:3: warning: ‘native_sectors’ may be used uninitialized in this function [-Wmaybe-uninitialized] for a couple of kernel releases now with gcc (Debian 4.7.2-4) 4.7.2. And the warning is bogus because ata_read_native_max_address either returns a sensible max_sectors aka native_sectors through its second arg pointer or an error value which is properly handled in its caller ata_hpa_resize(). So shut up gcc already. Cc: Jeff Garzik Cc: linux-ide@vger.kernel.org Signed-off-by: Borislav Petkov --- 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 9e8b99af400d..3860f6be8c19 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; int rc; /* do we need to do it? */