public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drivers: iommu: fix clang -wformat warning
@ 2022-07-21 21:03 Justin Stitt
  2022-07-21 21:05 ` Nathan Chancellor
  2022-07-22 14:39 ` Joerg Roedel
  0 siblings, 2 replies; 3+ messages in thread
From: Justin Stitt @ 2022-07-21 21:03 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Joerg Roedel, Will Deacon
  Cc: Konrad Dybcio, Robin Murphy, Nathan Chancellor, Nick Desaulniers,
	Tom Rix, linux-arm-msm, iommu, linux-kernel, llvm, Justin Stitt

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


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

* Re: [PATCH] drivers: iommu: fix clang -wformat warning
  2022-07-21 21:03 [PATCH] drivers: iommu: fix clang -wformat warning Justin Stitt
@ 2022-07-21 21:05 ` Nathan Chancellor
  2022-07-22 14:39 ` Joerg Roedel
  1 sibling, 0 replies; 3+ messages in thread
From: Nathan Chancellor @ 2022-07-21 21:05 UTC (permalink / raw)
  To: Justin Stitt
  Cc: Andy Gross, Bjorn Andersson, Joerg Roedel, Will Deacon,
	Konrad Dybcio, Robin Murphy, Nick Desaulniers, Tom Rix,
	linux-arm-msm, iommu, linux-kernel, llvm

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

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

* Re: [PATCH] drivers: iommu: fix clang -wformat warning
  2022-07-21 21:03 [PATCH] drivers: iommu: fix clang -wformat warning Justin Stitt
  2022-07-21 21:05 ` Nathan Chancellor
@ 2022-07-22 14:39 ` Joerg Roedel
  1 sibling, 0 replies; 3+ messages in thread
From: Joerg Roedel @ 2022-07-22 14:39 UTC (permalink / raw)
  To: Justin Stitt
  Cc: Andy Gross, Bjorn Andersson, Will Deacon, Konrad Dybcio,
	Robin Murphy, Nathan Chancellor, Nick Desaulniers, Tom Rix,
	linux-arm-msm, iommu, linux-kernel, llvm

On Thu, Jul 21, 2022 at 02:03:31PM -0700, Justin Stitt wrote:
>  drivers/iommu/msm_iommu.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied, thanks.


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

end of thread, other threads:[~2022-07-22 14:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-21 21:03 [PATCH] drivers: iommu: fix clang -wformat warning Justin Stitt
2022-07-21 21:05 ` Nathan Chancellor
2022-07-22 14:39 ` Joerg Roedel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox