iommu.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
* [patch] iommu/amd: remove an unneeded condition
@ 2016-01-07  9:36 Dan Carpenter
  2016-01-07 12:08 ` Joerg Roedel
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2016-01-07  9:36 UTC (permalink / raw)
  To: Joerg Roedel, Jiang Liu; +Cc: iommu, kernel-janitors

get_device_id() returns an unsigned short device id.  It never fails and
it never returns a negative so we can remove this condition.

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

diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
index 6f6502d..539b0de 100644
--- a/drivers/iommu/amd_iommu.c
+++ b/drivers/iommu/amd_iommu.c
@@ -3857,11 +3857,9 @@ static struct irq_domain *get_irq_domain(struct irq_alloc_info *info)
 	case X86_IRQ_ALLOC_TYPE_MSI:
 	case X86_IRQ_ALLOC_TYPE_MSIX:
 		devid = get_device_id(&info->msi_dev->dev);
-		if (devid >= 0) {
-			iommu = amd_iommu_rlookup_table[devid];
-			if (iommu)
-				return iommu->msi_domain;
-		}
+		iommu = amd_iommu_rlookup_table[devid];
+		if (iommu)
+			return iommu->msi_domain;
 		break;
 	default:
 		break;

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

* Re: [patch] iommu/amd: remove an unneeded condition
  2016-01-07  9:36 [patch] iommu/amd: remove an unneeded condition Dan Carpenter
@ 2016-01-07 12:08 ` Joerg Roedel
  0 siblings, 0 replies; 2+ messages in thread
From: Joerg Roedel @ 2016-01-07 12:08 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	kernel-janitors-u79uwXL29TY76Z2rM5mHXA, Jiang Liu

On Thu, Jan 07, 2016 at 12:36:06PM +0300, Dan Carpenter wrote:
> get_device_id() returns an unsigned short device id.  It never fails and
> it never returns a negative so we can remove this condition.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>

Applied, thanks.

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

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

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-07  9:36 [patch] iommu/amd: remove an unneeded condition Dan Carpenter
2016-01-07 12:08 ` Joerg Roedel

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