Linux IOMMU Development
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Qian Cai <cai@lca.pw>
Cc: iommu@lists.linux-foundation.org, jroedel@suse.de,
	dwmw2@infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [RESEND PATCH] iommu/intel: fix variable 'iommu' set but not used
Date: Wed, 22 May 2019 14:14:52 -0700	[thread overview]
Message-ID: <20190522141452.9105fbd041ed24eedde950b9@linux-foundation.org> (raw)
In-Reply-To: <1558557386-17160-1-git-send-email-cai@lca.pw>

On Wed, 22 May 2019 16:36:26 -0400 Qian Cai <cai@lca.pw> wrote:

> The commit cf04eee8bf0e ("iommu/vt-d: Include ACPI devices in iommu=pt")
> added for_each_active_iommu() in iommu_prepare_static_identity_mapping()
> but never used the each element, i.e, "drhd->iommu".
> 
> drivers/iommu/intel-iommu.c: In function
> 'iommu_prepare_static_identity_mapping':
> drivers/iommu/intel-iommu.c:3037:22: warning: variable 'iommu' set but
> not used [-Wunused-but-set-variable]
>   struct intel_iommu *iommu;
> 
> Fixed the warning by passing "drhd->iommu" directly to
> for_each_active_iommu() which all subsequent self-assignments should be
> ignored by a compiler anyway.
> 

Yes, assigning drhd->iommu to itself seems a bit nasty.  Maybe this is
a case for __mabe_unused (with a comment explaining why), if that fixes
the warning.  Dunno.

btw, for_each_active_dev_scope() and for_each_dev_scope() should be
dragged out and shot.  Or at least, should have those single-char
identifiers changed into something meaningful so poor sods like me have
a hope of understanding the code :(

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

      reply	other threads:[~2019-05-22 21:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-22 20:36 [RESEND PATCH] iommu/intel: fix variable 'iommu' set but not used Qian Cai
2019-05-22 21:14 ` Andrew Morton [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190522141452.9105fbd041ed24eedde950b9@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=cai@lca.pw \
    --cc=dwmw2@infradead.org \
    --cc=iommu@lists.linux-foundation.org \
    --cc=jroedel@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox