Linux IOMMU Development
 help / color / mirror / Atom feed
From: Nathan Chancellor <nathan@kernel.org>
To: Justin Stitt <justinstitt@google.com>
Cc: Andy Gross <agross@kernel.org>,
	Bjorn Andersson <bjorn.andersson@linaro.org>,
	Joerg Roedel <joro@8bytes.org>, Will Deacon <will@kernel.org>,
	Konrad Dybcio <konrad.dybcio@somainline.org>,
	Robin Murphy <robin.murphy@arm.com>,
	Nick Desaulniers <ndesaulniers@google.com>,
	Tom Rix <trix@redhat.com>,
	linux-arm-msm@vger.kernel.org, iommu@lists.linux.dev,
	linux-kernel@vger.kernel.org, llvm@lists.linux.dev
Subject: Re: [PATCH] drivers: iommu: fix clang -wformat warning
Date: Thu, 21 Jul 2022 14:05:46 -0700	[thread overview]
Message-ID: <Ytm/qj2ozeSY0a3Y@dev-arch.thelio-3990X> (raw)
In-Reply-To: <20220721210331.4012015-1-justinstitt@google.com>

On Thu, Jul 21, 2022 at 02:03:31PM -0700, Justin Stitt wrote:
> When building with Clang we encounter the following warning:
> | drivers/iommu/msm_iommu.c:603:6: error: format specifies type 'unsigned
> | short' but the argument has type 'int' [-Werror,-Wformat] sid);
> 
> `sid` is an int, use the proper format specifier `%x`.
> 
> Link: https://github.com/ClangBuiltLinux/linux/issues/378
> Reported-by: Nathan Chancellor <nathan@kernel.org>
> Suggested-by: Nathan Chancellor <nathan@kernel.org>
> Signed-off-by: Justin Stitt <justinstitt@google.com>

Thanks for the patch!

Reviewed-by: Nathan Chancellor <nathan@kernel.org>

> ---
> Reported by Nathan here:
> https://lore.kernel.org/all/YtmrCJjQrSbv8Aj1@dev-arch.thelio-3990X/
> 
>  drivers/iommu/msm_iommu.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iommu/msm_iommu.c b/drivers/iommu/msm_iommu.c
> index 428919a474c1..6a24aa804ea3 100644
> --- a/drivers/iommu/msm_iommu.c
> +++ b/drivers/iommu/msm_iommu.c
> @@ -599,7 +599,7 @@ static int insert_iommu_master(struct device *dev,
>  
>  	for (sid = 0; sid < master->num_mids; sid++)
>  		if (master->mids[sid] == spec->args[0]) {
> -			dev_warn(dev, "Stream ID 0x%hx repeated; ignoring\n",
> +			dev_warn(dev, "Stream ID 0x%x repeated; ignoring\n",
>  				 sid);
>  			return 0;
>  		}
> -- 
> 2.37.1.359.gd136c6c3e2-goog
> 
> 

  reply	other threads:[~2022-07-21 21:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-21 21:03 [PATCH] drivers: iommu: fix clang -wformat warning Justin Stitt
2022-07-21 21:05 ` Nathan Chancellor [this message]
2022-07-22 14:39 ` 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=Ytm/qj2ozeSY0a3Y@dev-arch.thelio-3990X \
    --to=nathan@kernel.org \
    --cc=agross@kernel.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=iommu@lists.linux.dev \
    --cc=joro@8bytes.org \
    --cc=justinstitt@google.com \
    --cc=konrad.dybcio@somainline.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=ndesaulniers@google.com \
    --cc=robin.murphy@arm.com \
    --cc=trix@redhat.com \
    --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