All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch] iommu/vt-d: silence an uninitialized variable warning
@ 2016-04-06 18:38 ` Dan Carpenter
  0 siblings, 0 replies; 5+ messages in thread
From: Dan Carpenter @ 2016-04-06 18:38 UTC (permalink / raw)
  To: David Woodhouse; +Cc: Joerg Roedel, iommu, linux-kernel, kernel-janitors

My static checker complains that "dma_alias" is uninitialized unless we
are dealing with a pci device.  This is true but harmless.  Anyway, we
can flip the condition around to silence the warning.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c
index a2e1b7f..e1852e8 100644
--- a/drivers/iommu/intel-iommu.c
+++ b/drivers/iommu/intel-iommu.c
@@ -2458,7 +2458,7 @@ static struct dmar_domain *get_domain_for_dev(struct device *dev, int gaw)
 	}
 
 	/* register PCI DMA alias device */
-	if (req_id != dma_alias && dev_is_pci(dev)) {
+	if (dev_is_pci(dev) && req_id != dma_alias) {
 		tmp = dmar_insert_one_dev_info(iommu, PCI_BUS_NUM(dma_alias),
 					       dma_alias & 0xff, NULL, domain);
 

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

* [patch] iommu/vt-d: silence an uninitialized variable warning
@ 2016-04-06 18:38 ` Dan Carpenter
  0 siblings, 0 replies; 5+ messages in thread
From: Dan Carpenter @ 2016-04-06 18:38 UTC (permalink / raw)
  To: David Woodhouse
  Cc: kernel-janitors-u79uwXL29TY76Z2rM5mHXA,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

My static checker complains that "dma_alias" is uninitialized unless we
are dealing with a pci device.  This is true but harmless.  Anyway, we
can flip the condition around to silence the warning.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c
index a2e1b7f..e1852e8 100644
--- a/drivers/iommu/intel-iommu.c
+++ b/drivers/iommu/intel-iommu.c
@@ -2458,7 +2458,7 @@ static struct dmar_domain *get_domain_for_dev(struct device *dev, int gaw)
 	}
 
 	/* register PCI DMA alias device */
-	if (req_id != dma_alias && dev_is_pci(dev)) {
+	if (dev_is_pci(dev) && req_id != dma_alias) {
 		tmp = dmar_insert_one_dev_info(iommu, PCI_BUS_NUM(dma_alias),
 					       dma_alias & 0xff, NULL, domain);
 

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

* [patch] iommu/vt-d: silence an uninitialized variable warning
@ 2016-04-06 18:38 ` Dan Carpenter
  0 siblings, 0 replies; 5+ messages in thread
From: Dan Carpenter @ 2016-04-06 18:38 UTC (permalink / raw)
  To: David Woodhouse
  Cc: kernel-janitors-u79uwXL29TY76Z2rM5mHXA,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

My static checker complains that "dma_alias" is uninitialized unless we
are dealing with a pci device.  This is true but harmless.  Anyway, we
can flip the condition around to silence the warning.

Signed-off-by: Dan Carpenter <dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>

diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c
index a2e1b7f..e1852e8 100644
--- a/drivers/iommu/intel-iommu.c
+++ b/drivers/iommu/intel-iommu.c
@@ -2458,7 +2458,7 @@ static struct dmar_domain *get_domain_for_dev(struct device *dev, int gaw)
 	}
 
 	/* register PCI DMA alias device */
-	if (req_id != dma_alias && dev_is_pci(dev)) {
+	if (dev_is_pci(dev) && req_id != dma_alias) {
 		tmp = dmar_insert_one_dev_info(iommu, PCI_BUS_NUM(dma_alias),
 					       dma_alias & 0xff, NULL, domain);
 

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

* Re: [patch] iommu/vt-d: silence an uninitialized variable warning
  2016-04-06 18:38 ` Dan Carpenter
@ 2016-04-07 12:52   ` Joerg Roedel
  -1 siblings, 0 replies; 5+ messages in thread
From: Joerg Roedel @ 2016-04-07 12:52 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: David Woodhouse, iommu, linux-kernel, kernel-janitors

On Wed, Apr 06, 2016 at 09:38:56PM +0300, Dan Carpenter wrote:
> My static checker complains that "dma_alias" is uninitialized unless we
> are dealing with a pci device.  This is true but harmless.  Anyway, we
> can flip the condition around to silence the warning.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Applied, thanks.

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

* Re: [patch] iommu/vt-d: silence an uninitialized variable warning
@ 2016-04-07 12:52   ` Joerg Roedel
  0 siblings, 0 replies; 5+ messages in thread
From: Joerg Roedel @ 2016-04-07 12:52 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: David Woodhouse, iommu, linux-kernel, kernel-janitors

On Wed, Apr 06, 2016 at 09:38:56PM +0300, Dan Carpenter wrote:
> My static checker complains that "dma_alias" is uninitialized unless we
> are dealing with a pci device.  This is true but harmless.  Anyway, we
> can flip the condition around to silence the warning.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Applied, thanks.


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

end of thread, other threads:[~2016-04-07 12:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-06 18:38 [patch] iommu/vt-d: silence an uninitialized variable warning Dan Carpenter
2016-04-06 18:38 ` Dan Carpenter
2016-04-06 18:38 ` Dan Carpenter
2016-04-07 12:52 ` Joerg Roedel
2016-04-07 12:52   ` Joerg Roedel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.