[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAPcyv4hzQ1Zscy2qkxuc2AG8yEueT2mQhV1q8uCu0Gpjhekk8w@mail.gmail.com>
Date: Thu, 19 Oct 2017 17:09:18 -0700
From: Dan Williams <dan.j.williams@...el.com>
To: Ross Zwisler <ross.zwisler@...ux.intel.com>
Cc: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-nvdimm@...ts.01.org" <linux-nvdimm@...ts.01.org>
Subject: Re: [PATCH v2] dev/dax: fix uninitialized variable build warning
On Wed, Oct 18, 2017 at 11:21 AM, Ross Zwisler
<ross.zwisler@...ux.intel.com> wrote:
> Fix this build warning:
>
> warning: 'phys' may be used uninitialized in this function
> [-Wuninitialized]
>
> As reported here:
>
> https://lkml.org/lkml/2017/10/16/152
> http://kisskb.ellerman.id.au/kisskb/buildresult/13181373/log/
>
> Signed-off-by: Ross Zwisler <ross.zwisler@...ux.intel.com>
> ---
> drivers/dax/device.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/dax/device.c b/drivers/dax/device.c
> index e9f3b3e..6833ada 100644
> --- a/drivers/dax/device.c
> +++ b/drivers/dax/device.c
> @@ -222,7 +222,8 @@ __weak phys_addr_t dax_pgoff_to_phys(struct dev_dax *dev_dax, pgoff_t pgoff,
> unsigned long size)
> {
> struct resource *res;
> - phys_addr_t phys;
> + /* gcc-4.6.3-nolibc for i386 complains that this is uninitialized */
> + phys_addr_t uninitialized_var(phys);
Thanks Ross, applied.
Powered by blists - more mailing lists