public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Thierry Reding <treding@nvidia.com>
To: Randy Dunlap <rdunlap@infradead.org>
Cc: linux-kernel@vger.kernel.org, Joerg Roedel <jroedel@suse.de>,
	Will Deacon <will@kernel.org>,
	iommu@lists.linux.dev
Subject: Re: [PATCH] iommu/of: mark an unused function as __maybe_unused
Date: Thu, 9 Feb 2023 11:45:39 +0100	[thread overview]
Message-ID: <Y+TO0yEdUNzWUUrA@orome> (raw)
In-Reply-To: <20230209010359.23831-1-rdunlap@infradead.org>

[-- Attachment #1: Type: text/plain, Size: 1635 bytes --]

On Wed, Feb 08, 2023 at 05:03:59PM -0800, Randy Dunlap wrote:
> When CONFIG_OF_ADDRESS is not set, there is a build warning/error
> about an unused function.
> Annotate the function to quieten the warning/error.
> 
> ../drivers/iommu/of_iommu.c:176:29: warning: 'iommu_resv_region_get_type' defined but not used [-Wunused-function]
>   176 | static enum iommu_resv_type iommu_resv_region_get_type(struct device *dev, struct resource *phys,
>       |                             ^~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> Fixes: a5bf3cfce8cb ("iommu: Implement of_iommu_get_resv_regions()")
> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
> Cc: Thierry Reding <treding@nvidia.com>
> Cc: Joerg Roedel <jroedel@suse.de>
> Cc: Will Deacon <will@kernel.org>
> Cc: iommu@lists.linux.dev
> ---
>  drivers/iommu/of_iommu.c |    5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff -- a/drivers/iommu/of_iommu.c b/drivers/iommu/of_iommu.c
> --- a/drivers/iommu/of_iommu.c
> +++ b/drivers/iommu/of_iommu.c
> @@ -173,8 +173,9 @@ const struct iommu_ops *of_iommu_configu
>  	return ops;
>  }
>  
> -static enum iommu_resv_type iommu_resv_region_get_type(struct device *dev, struct resource *phys,
> -						       phys_addr_t start, size_t length)
> +static enum iommu_resv_type __maybe_unused iommu_resv_region_get_type(struct device *dev,
> +						struct resource *phys,
> +						phys_addr_t start, size_t length)

Maybe this is one of those cases where we should wrap after the return
type/attributes to keep this somewhat readable?

Either way:

Reviewed-by: Thierry Reding <treding@nvidia.com>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2023-02-09 10:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-09  1:03 [PATCH] iommu/of: mark an unused function as __maybe_unused Randy Dunlap
2023-02-09 10:45 ` Thierry Reding [this message]
2023-02-16  9:19   ` Joerg Roedel

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=Y+TO0yEdUNzWUUrA@orome \
    --to=treding@nvidia.com \
    --cc=iommu@lists.linux.dev \
    --cc=jroedel@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rdunlap@infradead.org \
    --cc=will@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