diff mbox series

sh: pci: Fix the wrong format specifier

Message ID 20241204110706.6776-1-liujing@cmss.chinamobile.com (mailing list archive)
State New
Headers show
Series sh: pci: Fix the wrong format specifier | expand

Commit Message

Liu Jing Dec. 4, 2024, 11:07 a.m. UTC
Make a minor change to eliminate a static checker warning. The type
of port->index is unsigned int, so the correct format specifier should be
%u instead of %d.

Signed-off-by: liujing <liujing@cmss.chinamobile.com>

Comments

Geert Uytterhoeven Dec. 4, 2024, 12:35 p.m. UTC | #1
Hi Liujing,

On Wed, Dec 4, 2024 at 12:10 PM liujing <liujing@cmss.chinamobile.com> wrote:
> Make a minor change to eliminate a static checker warning. The type
> of port->index is unsigned int, so the correct format specifier should be
> %u instead of %d.
>
> Signed-off-by: liujing <liujing@cmss.chinamobile.com>

Thanks for your patch!

> --- a/arch/sh/drivers/pci/pcie-sh7786.c
> +++ b/arch/sh/drivers/pci/pcie-sh7786.c
> @@ -219,7 +219,7 @@ static int __init pcie_clk_init(struct sh7786_pcie_port *port)
>          * on. clock lookups don't help us much at this point, since no
>          * dev_id is available this early. Lame.
>          */
> -       snprintf(fclk_name, sizeof(fclk_name), "pcie%d_fck", port->index);
> +       snprintf(fclk_name, sizeof(fclk_name), "pcie%u_fck", port->index);
>
>         port->fclk = clk_get(NULL, fclk_name);
>         if (IS_ERR(port->fclk)) {

LGTM, but there are several more cases to fix in this file.
Please fix all of them in a single patch.

Gr{oetje,eeting}s,

                        Geert
diff mbox series

Patch

diff --git a/arch/sh/drivers/pci/pcie-sh7786.c b/arch/sh/drivers/pci/pcie-sh7786.c
index a78b9a935585..9ccc602d7f86 100644
--- a/arch/sh/drivers/pci/pcie-sh7786.c
+++ b/arch/sh/drivers/pci/pcie-sh7786.c
@@ -219,7 +219,7 @@  static int __init pcie_clk_init(struct sh7786_pcie_port *port)
 	 * on. clock lookups don't help us much at this point, since no
 	 * dev_id is available this early. Lame.
 	 */
-	snprintf(fclk_name, sizeof(fclk_name), "pcie%d_fck", port->index);
+	snprintf(fclk_name, sizeof(fclk_name), "pcie%u_fck", port->index);
 
 	port->fclk = clk_get(NULL, fclk_name);
 	if (IS_ERR(port->fclk)) {