2021-05-04 17:20:06

by Christophe JAILLET

[permalink] [raw]
Subject: [PATCH 2/3] PCI: tegra: Use 'seq_puts' instead of 'seq_printf'

As spotted by checkpatch, use 'seq_puts' instead of 'seq_printf' when
possible.
It is slightly more efficient.

Signed-off-by: Christophe JAILLET <[email protected]>
---
drivers/pci/controller/pci-tegra.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/pci/controller/pci-tegra.c b/drivers/pci/controller/pci-tegra.c
index 006bf0346dec..fe8e21ce3e3d 100644
--- a/drivers/pci/controller/pci-tegra.c
+++ b/drivers/pci/controller/pci-tegra.c
@@ -2550,7 +2550,7 @@ static void *tegra_pcie_ports_seq_start(struct seq_file *s, loff_t *pos)
if (list_empty(&pcie->ports))
return NULL;

- seq_printf(s, "Index Status\n");
+ seq_puts(s, "Index Status\n");

return seq_list_start(&pcie->ports, *pos);
}
@@ -2587,16 +2587,16 @@ static int tegra_pcie_ports_seq_show(struct seq_file *s, void *v)
seq_printf(s, "%2u ", port->index);

if (up)
- seq_printf(s, "up");
+ seq_puts(s, "up");

if (active) {
if (up)
- seq_printf(s, ", ");
+ seq_puts(s, ", ");

- seq_printf(s, "active");
+ seq_puts(s, "active");
}

- seq_printf(s, "\n");
+ seq_puts(s, "\n");
return 0;
}

--
2.30.2


2021-07-05 17:05:06

by Vidya Sagar

[permalink] [raw]
Subject: Re: [PATCH 2/3] PCI: tegra: Use 'seq_puts' instead of 'seq_printf'

Reviewed-by: Vidya Sagar <[email protected]>

On 5/4/2021 10:47 PM, Christophe JAILLET wrote:
> As spotted by checkpatch, use 'seq_puts' instead of 'seq_printf' when
> possible.
> It is slightly more efficient.
>
> Signed-off-by: Christophe JAILLET <[email protected]>
> ---
> drivers/pci/controller/pci-tegra.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/pci/controller/pci-tegra.c b/drivers/pci/controller/pci-tegra.c
> index 006bf0346dec..fe8e21ce3e3d 100644
> --- a/drivers/pci/controller/pci-tegra.c
> +++ b/drivers/pci/controller/pci-tegra.c
> @@ -2550,7 +2550,7 @@ static void *tegra_pcie_ports_seq_start(struct seq_file *s, loff_t *pos)
> if (list_empty(&pcie->ports))
> return NULL;
>
> - seq_printf(s, "Index Status\n");
> + seq_puts(s, "Index Status\n");
>
> return seq_list_start(&pcie->ports, *pos);
> }
> @@ -2587,16 +2587,16 @@ static int tegra_pcie_ports_seq_show(struct seq_file *s, void *v)
> seq_printf(s, "%2u ", port->index);
>
> if (up)
> - seq_printf(s, "up");
> + seq_puts(s, "up");
>
> if (active) {
> if (up)
> - seq_printf(s, ", ");
> + seq_puts(s, ", ");
>
> - seq_printf(s, "active");
> + seq_puts(s, "active");
> }
>
> - seq_printf(s, "\n");
> + seq_puts(s, "\n");
> return 0;
> }
>
>