linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] dev/dax: fix uninitialized variable build warning
@ 2017-10-18 15:40 Ross Zwisler
  2017-10-18 15:40 ` [PATCH 2/2] MAINTAINERS: Add entry for device DAX Ross Zwisler
  2017-10-18 15:56 ` [PATCH 1/2] dev/dax: fix uninitialized variable build warning Dan Williams
  0 siblings, 2 replies; 6+ messages in thread
From: Ross Zwisler @ 2017-10-18 15:40 UTC (permalink / raw)
  To: linux-kernel; +Cc: Ross Zwisler, Dan Williams, linux-nvdimm

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

This should have no functional change because you can only get into the if
statement in dax_pgoff_to_phys() that is complaining about 'phys' being
uninitialized if you broke out early in the above loop, in which case
'phys' will be set.

Signed-off-by: Ross Zwisler <ross.zwisler@linux.intel.com>
---
 drivers/dax/device.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/dax/device.c b/drivers/dax/device.c
index e9f3b3e..4aca0a2 100644
--- a/drivers/dax/device.c
+++ b/drivers/dax/device.c
@@ -222,7 +222,7 @@ __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;
+	phys_addr_t phys = 0;
 	int i;
 
 	for (i = 0; i < dev_dax->num_resources; i++) {
-- 
2.9.5

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/2] MAINTAINERS: Add entry for device DAX
  2017-10-18 15:40 [PATCH 1/2] dev/dax: fix uninitialized variable build warning Ross Zwisler
@ 2017-10-18 15:40 ` Ross Zwisler
  2017-10-18 16:12   ` Dan Williams
  2017-10-18 15:56 ` [PATCH 1/2] dev/dax: fix uninitialized variable build warning Dan Williams
  1 sibling, 1 reply; 6+ messages in thread
From: Ross Zwisler @ 2017-10-18 15:40 UTC (permalink / raw)
  To: linux-kernel; +Cc: Ross Zwisler, Dan Williams, linux-nvdimm

And update the entry for filesystem DAX to differentiate them.

Signed-off-by: Ross Zwisler <ross.zwisler@linux.intel.com>
---
 MAINTAINERS | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index a74227a..b2b2e75 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -4162,7 +4162,7 @@ L:	linux-i2c@vger.kernel.org
 S:	Maintained
 F:	drivers/i2c/busses/i2c-diolan-u2c.c
 
-DIRECT ACCESS (DAX)
+FILESYSTEM DIRECT ACCESS (DAX)
 M:	Matthew Wilcox <mawilcox@microsoft.com>
 M:	Ross Zwisler <ross.zwisler@linux.intel.com>
 L:	linux-fsdevel@vger.kernel.org
@@ -4171,6 +4171,12 @@ F:	fs/dax.c
 F:	include/linux/dax.h
 F:	include/trace/events/fs_dax.h
 
+DEVICE DIRECT ACCESS (DAX)
+M:	Dan Williams <dan.j.williams@intel.com>
+L:	linux-nvdimm@lists.01.org
+S:	Supported
+F:	drivers/dax/
+
 DIRECTORY NOTIFICATION (DNOTIFY)
 M:	Jan Kara <jack@suse.cz>
 R:	Amir Goldstein <amir73il@gmail.com>
-- 
2.9.5

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] dev/dax: fix uninitialized variable build warning
  2017-10-18 15:40 [PATCH 1/2] dev/dax: fix uninitialized variable build warning Ross Zwisler
  2017-10-18 15:40 ` [PATCH 2/2] MAINTAINERS: Add entry for device DAX Ross Zwisler
@ 2017-10-18 15:56 ` Dan Williams
  2017-10-18 18:21   ` [PATCH v2] " Ross Zwisler
  1 sibling, 1 reply; 6+ messages in thread
From: Dan Williams @ 2017-10-18 15:56 UTC (permalink / raw)
  To: Ross Zwisler; +Cc: linux-kernel, linux-nvdimm

On Wed, Oct 18, 2017 at 8:40 AM, Ross Zwisler
<ross.zwisler@linux.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
>
> This should have no functional change because you can only get into the if
> statement in dax_pgoff_to_phys() that is complaining about 'phys' being
> uninitialized if you broke out early in the above loop, in which case
> 'phys' will be set.

Then the compiler is wrong.

>
> Signed-off-by: Ross Zwisler <ross.zwisler@linux.intel.com>
> ---
>  drivers/dax/device.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/dax/device.c b/drivers/dax/device.c
> index e9f3b3e..4aca0a2 100644
> --- a/drivers/dax/device.c
> +++ b/drivers/dax/device.c
> @@ -222,7 +222,7 @@ __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;
> +       phys_addr_t phys = 0;

We have uninitialized_var() for silencing the compiler, and since the
report is bogus we might note with a comment which gcc had a problem
with this routine.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] MAINTAINERS: Add entry for device DAX
  2017-10-18 15:40 ` [PATCH 2/2] MAINTAINERS: Add entry for device DAX Ross Zwisler
@ 2017-10-18 16:12   ` Dan Williams
  0 siblings, 0 replies; 6+ messages in thread
From: Dan Williams @ 2017-10-18 16:12 UTC (permalink / raw)
  To: Ross Zwisler; +Cc: linux-kernel, linux-nvdimm

On Wed, Oct 18, 2017 at 8:40 AM, Ross Zwisler
<ross.zwisler@linux.intel.com> wrote:
> And update the entry for filesystem DAX to differentiate them.
>
> Signed-off-by: Ross Zwisler <ross.zwisler@linux.intel.com>
> ---
>  MAINTAINERS | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/MAINTAINERS b/MAINTAINERS
> index a74227a..b2b2e75 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -4162,7 +4162,7 @@ L:        linux-i2c@vger.kernel.org
>  S:     Maintained
>  F:     drivers/i2c/busses/i2c-diolan-u2c.c
>
> -DIRECT ACCESS (DAX)
> +FILESYSTEM DIRECT ACCESS (DAX)
>  M:     Matthew Wilcox <mawilcox@microsoft.com>
>  M:     Ross Zwisler <ross.zwisler@linux.intel.com>
>  L:     linux-fsdevel@vger.kernel.org
> @@ -4171,6 +4171,12 @@ F:       fs/dax.c
>  F:     include/linux/dax.h
>  F:     include/trace/events/fs_dax.h
>
> +DEVICE DIRECT ACCESS (DAX)
> +M:     Dan Williams <dan.j.williams@intel.com>
> +L:     linux-nvdimm@lists.01.org
> +S:     Supported
> +F:     drivers/dax/
> +

I guess I had a good run hiding from get_maintainers.pl...

Applied for 4.15.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v2] dev/dax: fix uninitialized variable build warning
  2017-10-18 15:56 ` [PATCH 1/2] dev/dax: fix uninitialized variable build warning Dan Williams
@ 2017-10-18 18:21   ` Ross Zwisler
  2017-10-20  0:09     ` Dan Williams
  0 siblings, 1 reply; 6+ messages in thread
From: Ross Zwisler @ 2017-10-18 18:21 UTC (permalink / raw)
  To: linux-kernel; +Cc: Ross Zwisler, Dan Williams, linux-nvdimm

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@linux.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);
 	int i;
 
 	for (i = 0; i < dev_dax->num_resources; i++) {
-- 
2.9.5

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] dev/dax: fix uninitialized variable build warning
  2017-10-18 18:21   ` [PATCH v2] " Ross Zwisler
@ 2017-10-20  0:09     ` Dan Williams
  0 siblings, 0 replies; 6+ messages in thread
From: Dan Williams @ 2017-10-20  0:09 UTC (permalink / raw)
  To: Ross Zwisler; +Cc: linux-kernel, linux-nvdimm

On Wed, Oct 18, 2017 at 11:21 AM, Ross Zwisler
<ross.zwisler@linux.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@linux.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.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-10-20  0:09 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-18 15:40 [PATCH 1/2] dev/dax: fix uninitialized variable build warning Ross Zwisler
2017-10-18 15:40 ` [PATCH 2/2] MAINTAINERS: Add entry for device DAX Ross Zwisler
2017-10-18 16:12   ` Dan Williams
2017-10-18 15:56 ` [PATCH 1/2] dev/dax: fix uninitialized variable build warning Dan Williams
2017-10-18 18:21   ` [PATCH v2] " Ross Zwisler
2017-10-20  0:09     ` Dan Williams

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).