Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mailbox: imx: Modify the incorrect format specifier
@ 2024-11-14  5:59 zhangjiao2
  2024-11-14 16:42 ` Frank Li
  0 siblings, 1 reply; 3+ messages in thread
From: zhangjiao2 @ 2024-11-14  5:59 UTC (permalink / raw)
  To: jassisinghbrar
  Cc: shawnguo, s.hauer, linux-kernel, imx, linux-arm-kernel,
	zhang jiao

From: zhang jiao <zhangjiao2@cmss.chinamobile.com>

The format specifier of "unsigned int" in snprintf()
should be "%u", not "%i".

Signed-off-by: zhang jiao <zhangjiao2@cmss.chinamobile.com>
---
 drivers/mailbox/imx-mailbox.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mailbox/imx-mailbox.c b/drivers/mailbox/imx-mailbox.c
index f815dab3be50..3fe51b2de89e 100644
--- a/drivers/mailbox/imx-mailbox.c
+++ b/drivers/mailbox/imx-mailbox.c
@@ -782,7 +782,7 @@ static int imx_mu_init_generic(struct imx_mu_priv *priv)
 		cp->chan = &priv->mbox_chans[i];
 		priv->mbox_chans[i].con_priv = cp;
 		snprintf(cp->irq_desc, sizeof(cp->irq_desc),
-			 "%s[%i-%i]", dev_name(priv->dev), cp->type, cp->idx);
+			 "%s[%i-%u]", dev_name(priv->dev), cp->type, cp->idx);
 	}
 
 	priv->mbox.num_chans = IMX_MU_CHANS;
@@ -819,7 +819,7 @@ static int imx_mu_init_specific(struct imx_mu_priv *priv)
 		cp->chan = &priv->mbox_chans[i];
 		priv->mbox_chans[i].con_priv = cp;
 		snprintf(cp->irq_desc, sizeof(cp->irq_desc),
-			 "%s[%i-%i]", dev_name(priv->dev), cp->type, cp->idx);
+			 "%s[%i-%u]", dev_name(priv->dev), cp->type, cp->idx);
 	}
 
 	priv->mbox.num_chans = num_chans;
-- 
2.33.0





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

* Re: [PATCH] mailbox: imx: Modify the incorrect format specifier
  2024-11-14  5:59 [PATCH] mailbox: imx: Modify the incorrect format specifier zhangjiao2
@ 2024-11-14 16:42 ` Frank Li
  2024-11-15  1:18   ` [PATCH v2] " zhangjiao2
  0 siblings, 1 reply; 3+ messages in thread
From: Frank Li @ 2024-11-14 16:42 UTC (permalink / raw)
  To: zhangjiao2
  Cc: jassisinghbrar, shawnguo, s.hauer, linux-kernel, imx,
	linux-arm-kernel

On Thu, Nov 14, 2024 at 01:59:26PM +0800, zhangjiao2 wrote:
> From: zhang jiao <zhangjiao2@cmss.chinamobile.com>
>
> The format specifier of "unsigned int" in snprintf()
> should be "%u", not "%i".

Replace %i with %u in snprintf() because it is "unsigned int".

Reviewed-by: Frank Li <Frank.Li@nxp.com>

>
> Signed-off-by: zhang jiao <zhangjiao2@cmss.chinamobile.com>
> ---
>  drivers/mailbox/imx-mailbox.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mailbox/imx-mailbox.c b/drivers/mailbox/imx-mailbox.c
> index f815dab3be50..3fe51b2de89e 100644
> --- a/drivers/mailbox/imx-mailbox.c
> +++ b/drivers/mailbox/imx-mailbox.c
> @@ -782,7 +782,7 @@ static int imx_mu_init_generic(struct imx_mu_priv *priv)
>  		cp->chan = &priv->mbox_chans[i];
>  		priv->mbox_chans[i].con_priv = cp;
>  		snprintf(cp->irq_desc, sizeof(cp->irq_desc),
> -			 "%s[%i-%i]", dev_name(priv->dev), cp->type, cp->idx);
> +			 "%s[%i-%u]", dev_name(priv->dev), cp->type, cp->idx);
>  	}
>
>  	priv->mbox.num_chans = IMX_MU_CHANS;
> @@ -819,7 +819,7 @@ static int imx_mu_init_specific(struct imx_mu_priv *priv)
>  		cp->chan = &priv->mbox_chans[i];
>  		priv->mbox_chans[i].con_priv = cp;
>  		snprintf(cp->irq_desc, sizeof(cp->irq_desc),
> -			 "%s[%i-%i]", dev_name(priv->dev), cp->type, cp->idx);
> +			 "%s[%i-%u]", dev_name(priv->dev), cp->type, cp->idx);
>  	}
>
>  	priv->mbox.num_chans = num_chans;
> --
> 2.33.0
>
>
>


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

* [PATCH v2] mailbox: imx: Modify the incorrect format specifier
  2024-11-14 16:42 ` Frank Li
@ 2024-11-15  1:18   ` zhangjiao2
  0 siblings, 0 replies; 3+ messages in thread
From: zhangjiao2 @ 2024-11-15  1:18 UTC (permalink / raw)
  To: frank.li
  Cc: imx, jassisinghbrar, linux-arm-kernel, linux-kernel, s.hauer,
	shawnguo, zhang jiao, Frank Li

From: zhang jiao <zhangjiao2@cmss.chinamobile.com>

Replace %i with %u in snprintf() because it is "unsigned int".

Signed-off-by: zhang jiao <zhangjiao2@cmss.chinamobile.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
---
v1->v2:
	Modify commit info and add review tag.

 drivers/mailbox/imx-mailbox.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mailbox/imx-mailbox.c b/drivers/mailbox/imx-mailbox.c
index f815dab3be50..3fe51b2de89e 100644
--- a/drivers/mailbox/imx-mailbox.c
+++ b/drivers/mailbox/imx-mailbox.c
@@ -782,7 +782,7 @@ static int imx_mu_init_generic(struct imx_mu_priv *priv)
 		cp->chan = &priv->mbox_chans[i];
 		priv->mbox_chans[i].con_priv = cp;
 		snprintf(cp->irq_desc, sizeof(cp->irq_desc),
-			 "%s[%i-%i]", dev_name(priv->dev), cp->type, cp->idx);
+			 "%s[%i-%u]", dev_name(priv->dev), cp->type, cp->idx);
 	}
 
 	priv->mbox.num_chans = IMX_MU_CHANS;
@@ -819,7 +819,7 @@ static int imx_mu_init_specific(struct imx_mu_priv *priv)
 		cp->chan = &priv->mbox_chans[i];
 		priv->mbox_chans[i].con_priv = cp;
 		snprintf(cp->irq_desc, sizeof(cp->irq_desc),
-			 "%s[%i-%i]", dev_name(priv->dev), cp->type, cp->idx);
+			 "%s[%i-%u]", dev_name(priv->dev), cp->type, cp->idx);
 	}
 
 	priv->mbox.num_chans = num_chans;
-- 
2.33.0





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

end of thread, other threads:[~2024-11-15  1:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-14  5:59 [PATCH] mailbox: imx: Modify the incorrect format specifier zhangjiao2
2024-11-14 16:42 ` Frank Li
2024-11-15  1:18   ` [PATCH v2] " zhangjiao2

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