iommu.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] remove duplicate checking code
@ 2014-05-16  7:39 Vaughan Cao
       [not found] ` <1400225980-12797-1-git-send-email-vaughan.cao-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Vaughan Cao @ 2014-05-16  7:39 UTC (permalink / raw)
  To: joro; +Cc: iommu, linux-kernel, vaughan.cao

amd_iommu_rlookup_table[devid] != NULL is already guaranteed by check_device
called before, it's fine to attach device at this point.

Signed-off-by: Vaughan Cao <vaughan.cao@oracle.com>
---
 drivers/iommu/amd_iommu.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
index c949520..252851a 100644
--- a/drivers/iommu/amd_iommu.c
+++ b/drivers/iommu/amd_iommu.c
@@ -3514,12 +3514,6 @@ int __init amd_iommu_init_passthrough(void)
 		dev_data = get_dev_data(&dev->dev);
 		dev_data->passthrough = true;
 
-		devid = get_device_id(&dev->dev);
-
-		iommu = amd_iommu_rlookup_table[devid];
-		if (!iommu)
-			continue;
-
 		attach_device(&dev->dev, pt_domain);
 	}
 
-- 
1.9.0

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

* Re: [PATCH] remove duplicate checking code
       [not found] ` <1400225980-12797-1-git-send-email-vaughan.cao-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
@ 2014-05-26  9:39   ` Joerg Roedel
       [not found]     ` <20140526093959.GH17056-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Joerg Roedel @ 2014-05-26  9:39 UTC (permalink / raw)
  To: Vaughan Cao
  Cc: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

On Fri, May 16, 2014 at 03:39:40PM +0800, Vaughan Cao wrote:
> amd_iommu_rlookup_table[devid] != NULL is already guaranteed by check_device
> called before, it's fine to attach device at this point.
> 
> Signed-off-by: Vaughan Cao <vaughan.cao-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
> ---
>  drivers/iommu/amd_iommu.c | 6 ------
>  1 file changed, 6 deletions(-)

Applied, thanks.

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

* Re: [PATCH] remove duplicate checking code
       [not found]     ` <20140526093959.GH17056-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
@ 2014-05-29 13:45       ` Paul Bolle
  2014-05-30 18:21         ` Joerg Roedel
  0 siblings, 1 reply; 4+ messages in thread
From: Paul Bolle @ 2014-05-29 13:45 UTC (permalink / raw)
  To: Joerg Roedel
  Cc: Vaughan Cao, iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

On Mon, 2014-05-26 at 11:39 +0200, Joerg Roedel wrote:
> On Fri, May 16, 2014 at 03:39:40PM +0800, Vaughan Cao wrote:
> > amd_iommu_rlookup_table[devid] != NULL is already guaranteed by check_device
> > called before, it's fine to attach device at this point.
> > 
> > Signed-off-by: Vaughan Cao <vaughan.cao@oracle.com>
> > ---
> >  drivers/iommu/amd_iommu.c | 6 ------
> >  1 file changed, 6 deletions(-)
> 
> Applied, thanks.

This one entered linux-next, as of next-20142527, in commit ecef115d4540
("iommu/amd: Remove duplicate checking code"). It triggers an obviously
correct warning:
    drivers/iommu/amd_iommu.c: In function ‘amd_iommu_init_passthrough’:
    drivers/iommu/amd_iommu.c:3503:6: warning: unused variable ‘devid’ [-Wunused-variable]
      u16 devid;
          ^
    drivers/iommu/amd_iommu.c:3502:20: warning: unused variable ‘iommu’ [-Wunused-variable]
      struct amd_iommu *iommu;
                        ^

Is the trivial fix for this queued somewhere?


Paul Bolle

_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

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

* Re: [PATCH] remove duplicate checking code
  2014-05-29 13:45       ` Paul Bolle
@ 2014-05-30 18:21         ` Joerg Roedel
  0 siblings, 0 replies; 4+ messages in thread
From: Joerg Roedel @ 2014-05-30 18:21 UTC (permalink / raw)
  To: Paul Bolle
  Cc: Vaughan Cao, iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

On Thu, May 29, 2014 at 03:45:47PM +0200, Paul Bolle wrote:
> On Mon, 2014-05-26 at 11:39 +0200, Joerg Roedel wrote:
> > On Fri, May 16, 2014 at 03:39:40PM +0800, Vaughan Cao wrote:
> > > amd_iommu_rlookup_table[devid] != NULL is already guaranteed by check_device
> > > called before, it's fine to attach device at this point.
> > > 
> > > Signed-off-by: Vaughan Cao <vaughan.cao@oracle.com>
> > > ---
> > >  drivers/iommu/amd_iommu.c | 6 ------
> > >  1 file changed, 6 deletions(-)
> > 
> > Applied, thanks.
> 
> This one entered linux-next, as of next-20142527, in commit ecef115d4540
> ("iommu/amd: Remove duplicate checking code"). It triggers an obviously
> correct warning:
>     drivers/iommu/amd_iommu.c: In function ‘amd_iommu_init_passthrough’:
>     drivers/iommu/amd_iommu.c:3503:6: warning: unused variable ‘devid’ [-Wunused-variable]
>       u16 devid;
>           ^
>     drivers/iommu/amd_iommu.c:3502:20: warning: unused variable ‘iommu’ [-Wunused-variable]
>       struct amd_iommu *iommu;
>                         ^
> 
> Is the trivial fix for this queued somewhere?

Just queued one to my x86/amd branch. Thanks for the report.


	Joerg


_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

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

end of thread, other threads:[~2014-05-30 18:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-16  7:39 [PATCH] remove duplicate checking code Vaughan Cao
     [not found] ` <1400225980-12797-1-git-send-email-vaughan.cao-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
2014-05-26  9:39   ` Joerg Roedel
     [not found]     ` <20140526093959.GH17056-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
2014-05-29 13:45       ` Paul Bolle
2014-05-30 18:21         ` 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).