linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] NVMe: fix uninitialized iod compiler warning
@ 2012-07-25 22:04 Keith Busch
  2012-07-26 14:50 ` Matthew Wilcox
  0 siblings, 1 reply; 4+ messages in thread
From: Keith Busch @ 2012-07-25 22:04 UTC (permalink / raw)


Signed-off-by: Keith Busch <keith.busch at intel.com>
---
 drivers/block/nvme.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/block/nvme.c b/drivers/block/nvme.c
index 38b9c73..4692c8e 100644
--- a/drivers/block/nvme.c
+++ b/drivers/block/nvme.c
@@ -1158,7 +1158,7 @@ static int nvme_user_admin_cmd(struct nvme_ns *ns,
 	struct nvme_admin_cmd cmd;
 	struct nvme_command c;
 	int status, length;
-	struct nvme_iod *iod;
+	struct nvme_iod *iod = NULL;
 
 	if (!capable(CAP_SYS_ADMIN))
 		return -EACCES;
-- 
1.7.0.4

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

* [PATCH] NVMe: fix uninitialized iod compiler warning
  2012-07-25 22:04 [PATCH] NVMe: fix uninitialized iod compiler warning Keith Busch
@ 2012-07-26 14:50 ` Matthew Wilcox
  0 siblings, 0 replies; 4+ messages in thread
From: Matthew Wilcox @ 2012-07-26 14:50 UTC (permalink / raw)


On Wed, Jul 25, 2012@04:04:29PM -0600, Keith Busch wrote:
>  	int status, length;
> -	struct nvme_iod *iod;
> +	struct nvme_iod *iod = NULL;
>  

So this is a compiler bug.  And it's not present in every compiler
version; it didn't occur on my machine until I upgraded gcc recently.
There's no way that iod can be used uninitialised.  The correct way to
indicate this is:

+	struct nvme_iod *uninitialized_var(iod);

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

* [PATCH] NVMe: Fix uninitialized iod compiler warning
@ 2012-07-27 17:53 Keith Busch
  2012-07-27 18:26 ` Matthew Wilcox
  0 siblings, 1 reply; 4+ messages in thread
From: Keith Busch @ 2012-07-27 17:53 UTC (permalink / raw)


Signed-off-by: Keith Busch <keith.busch at intel.com>
---
 drivers/block/nvme.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/block/nvme.c b/drivers/block/nvme.c
index 7bcd882..47578ba 100644
--- a/drivers/block/nvme.c
+++ b/drivers/block/nvme.c
@@ -1157,7 +1157,7 @@ static int nvme_user_admin_cmd(struct nvme_dev *dev,
 	struct nvme_admin_cmd cmd;
 	struct nvme_command c;
 	int status, length;
-	struct nvme_iod *iod;
+	struct nvme_iod *uninitialized_var(iod);
 
 	if (!capable(CAP_SYS_ADMIN))
 		return -EACCES;
-- 
1.7.0.4

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

* [PATCH] NVMe: Fix uninitialized iod compiler warning
  2012-07-27 17:53 [PATCH] NVMe: Fix " Keith Busch
@ 2012-07-27 18:26 ` Matthew Wilcox
  0 siblings, 0 replies; 4+ messages in thread
From: Matthew Wilcox @ 2012-07-27 18:26 UTC (permalink / raw)


On Fri, Jul 27, 2012@11:53:28AM -0600, Keith Busch wrote:
> -	struct nvme_iod *iod;
> +	struct nvme_iod *uninitialized_var(iod);

Thanks, applied.

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

end of thread, other threads:[~2012-07-27 18:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-25 22:04 [PATCH] NVMe: fix uninitialized iod compiler warning Keith Busch
2012-07-26 14:50 ` Matthew Wilcox
  -- strict thread matches above, loose matches on Subject: below --
2012-07-27 17:53 [PATCH] NVMe: Fix " Keith Busch
2012-07-27 18:26 ` Matthew Wilcox

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