Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1222537

RE: [PATCH] ahci: qoriq: fixed using uninitialized variable warnings

From Yuantian Tang <Yuantian.Tang@freescale.com>
Newsgroups linux.kernel
Subject RE: [PATCH] ahci: qoriq: fixed using uninitialized variable warnings
Date 2015-09-11 07:30 +0200
Message-ID <q7p4l-vH-1@gated-at.bofh.it> (permalink)
References <q6LgC-PN-7@gated-at.bofh.it> <q6Oeu-5iY-21@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hi Tejun,

Could you please take the version 1 patch?
The version 2 patch can't address these warnings, and the version 1 can definitely remove them.
In this case, that would cause any hidden bugs, so no worries.

Regards,
Yuantian

> -----Original Message-----
> From: Tejun Heo [mailto:htejun@gmail.com] On Behalf Of Tejun Heo
> Sent: Wednesday, September 09, 2015 10:02 PM
> To: Tang Yuantian-B29983 <Yuantian.Tang@freescale.com>
> Cc: hdegoede@redhat.com; linux-ide@vger.kernel.org; linux-
> kernel@vger.kernel.org; devicetree@vger.kernel.org
> Subject: Re: [PATCH] ahci: qoriq: fixed using uninitialized variable warnings
> 
> On Wed, Sep 09, 2015 at 05:16:22PM +0800, Yuantian.Tang@freescale.com
> wrote:
> > From: Tang Yuantian <Yuantian.Tang@freescale.com>
> >
> > kbuild test robot reports the warnings:
> > drivers/ata/ahci_qoriq.c: In function 'ahci_qoriq_hardreset':
> > >> include/asm-generic/io.h:163:2: warning: 'px_is' may be used
> > >> uninitialized in this function [-Wuninitialized]
> > drivers/ata/ahci_qoriq.c:70:14: note: 'px_is' was declared here
> > >> include/asm-generic/io.h:163:2: warning: 'px_cmd' may be used
> > >> uninitialized in this function [-Wuninitialized]
> > drivers/ata/ahci_qoriq.c:70:6: note: 'px_cmd' was declared here
> >
> > This patch fixed it by assigning 0 to px_is and px_cmd variables.
> > This patch also remove line 'struct ccsr_ahci *reg_base' which is not
> > referred by any other codes and thus a dead one.
> 
> Hmm... I think the problem here is that the complier can't know whether
> qoriq_priv->type would change across intervening function calls.  Maybe a
> better solution is caching the type in a local variable so that the compiler can
> tell that those two tests will always move together?  It generally isn't a good
> idea to clear variables unnecessarily as that can hide actual bugs that compiler
> can detect.
> 
> Thanks.
> 
> --
> tejun
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH] ahci: qoriq: fixed using uninitialized variable warnings Tejun Heo <tj@kernel.org> - 2015-09-09 16:10 +0200
  RE: [PATCH] ahci: qoriq: fixed using uninitialized variable warnings Yuantian Tang <Yuantian.Tang@freescale.com> - 2015-09-10 08:20 +0200
  RE: [PATCH] ahci: qoriq: fixed using uninitialized variable warnings Yuantian Tang <Yuantian.Tang@freescale.com> - 2015-09-11 07:30 +0200
    Re: [PATCH] ahci: qoriq: fixed using uninitialized variable warnings Tejun Heo <tj@kernel.org> - 2015-09-11 16:00 +0200
      RE: [PATCH] ahci: qoriq: fixed using uninitialized variable warnings Yuantian Tang <Yuantian.Tang@freescale.com> - 2015-09-14 05:20 +0200
        Re: [PATCH] ahci: qoriq: fixed using uninitialized variable warnings Fengguang Wu <fengguang.wu@intel.com> - 2015-09-14 08:10 +0200
          RE: [PATCH] ahci: qoriq: fixed using uninitialized variable warnings Yuantian Tang <Yuantian.Tang@freescale.com> - 2015-09-14 09:00 +0200
            Re: [PATCH] ahci: qoriq: fixed using uninitialized variable warnings Fengguang Wu <fengguang.wu@intel.com> - 2015-09-14 09:00 +0200
              Re: [PATCH] ahci: qoriq: fixed using uninitialized variable warnings Arnd Bergmann <arnd@arndb.de> - 2015-09-14 09:50 +0200
                Re: [PATCH] ahci: qoriq: fixed using uninitialized variable warnings Tejun Heo <tj@kernel.org> - 2015-09-14 18:10 +0200

csiph-web