Re: [PATCH] staging: lustre: lustre: osc: fix Prefer seq_puts to seq_printf

From: Joe Perches
Date: Wed Jan 28 2015 - 20:56:33 EST


On Wed, 2015-01-28 at 16:05 +0200, Heba Aamer wrote:
> This patch fixes the following checkpatch.pl warning:
> Prefer seq_puts to seq_printf

checkpatch is pretty stupid.
Please don't just do what it says.

Look further and see what else can be improved.

> diff --git a/drivers/staging/lustre/lustre/osc/lproc_osc.c b/drivers/staging/lustre/lustre/osc/lproc_osc.c
[]
> @@ -364,7 +364,7 @@ static int osc_checksum_type_seq_show(struct seq_file *m, void *v)
> else
> seq_printf(m, "%s ", cksum_name[i]);
> }
> - seq_printf(m, "\n");
> + seq_puts(m, "\n");

This could be seq_putc

> @@ -601,7 +601,7 @@ static int osc_rpc_stats_seq_show(struct seq_file *seq, void *v)
> seq_printf(seq, "pending read pages: %d\n",
> atomic_read(&cli->cl_pending_r_pages));
>
> - seq_printf(seq, "\n\t\t\tread\t\t\twrite\n");
> + seq_puts(seq, "\n\t\t\tread\t\t\twrite\n");
> seq_printf(seq, "pages per rpc rpcs %% cum %% |");
> seq_printf(seq, " rpcs %% cum %%\n");

The seq_printf uses with %% could also be seq_puts

> @@ -624,7 +624,7 @@ static int osc_rpc_stats_seq_show(struct seq_file *seq, void *v)
> break;
> }
>
> - seq_printf(seq, "\n\t\t\tread\t\t\twrite\n");
> + seq_puts(seq, "\n\t\t\tread\t\t\twrite\n");
> seq_printf(seq, "rpcs in flight rpcs %% cum %% |");
> seq_printf(seq, " rpcs %% cum %%\n");

seq_puts here too

> @@ -647,7 +647,7 @@ static int osc_rpc_stats_seq_show(struct seq_file *seq, void *v)
> break;
> }
>
> - seq_printf(seq, "\n\t\t\tread\t\t\twrite\n");
> + seq_puts(seq, "\n\t\t\tread\t\t\twrite\n");
> seq_printf(seq, "offset rpcs %% cum %% |");
> seq_printf(seq, " rpcs %% cum %%\n");
>

and here


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/