mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: shijie001@208suo.com, tglx@linutronix.de, mingo@redhat.com,
	bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org
Cc: hpa@zytor.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] KVM: x86:Fix warnings in debugfs.c
Date: Tue, 18 Jul 2023 08:43:29 +0200	[thread overview]
Message-ID: <aa9cdc3a-dc01-f480-cc75-7ddf0a5092d1@linaro.org> (raw)
In-Reply-To: <d02e47813a9b22b2c625caf8ac5ae0fb@208suo.com>

Hi,

On 12/7/23 05:08, shijie001@208suo.com wrote:
> The following checkpatch warning is removed:
> WARNING: Prefer seq_puts to seq_printf
> 
> Signed-off-by: Jie Shi <shijie001@208suo.com>
> ---
>   arch/x86/kvm/debugfs.c | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/x86/kvm/debugfs.c b/arch/x86/kvm/debugfs.c
> index ee8c4c3496ed..a3e118397aa3 100644
> --- a/arch/x86/kvm/debugfs.c
> +++ b/arch/x86/kvm/debugfs.c
> @@ -133,20 +133,20 @@ static int kvm_mmu_rmaps_stat_show(struct seq_file 
> *m, void *v)
>       mutex_unlock(&kvm->slots_lock);
> 
>       /* index=0 counts no rmap; index=1 counts 1 rmap */
> -    seq_printf(m, "Rmap_Count:\t0\t1\t");
> +    seq_puts(m, "Rmap_Count:\t0\t1\t");
>       for (i = 2; i < RMAP_LOG_SIZE; i++) {
>           j = 1 << (i - 1);
>           k = (1 << i) - 1;
>           seq_printf(m, "%d-%d\t", j, k);
>       }
> -    seq_printf(m, "\n");
> +    seq_puts(m, "\n");

If you really want to clean this, then seq_putc() is more
appropriate.

> 
>       for (i = 0; i < KVM_NR_PAGE_SIZES; i++) {
>           seq_printf(m, "Level=%s:\t", kvm_lpage_str[i]);
>           cur = log[i];
>           for (j = 0; j < RMAP_LOG_SIZE; j++)
>               seq_printf(m, "%d\t", cur[j]);
> -        seq_printf(m, "\n");
> +        seq_puts(m, "\n");

Ditto.

>       }
> 
>       ret = 0;


      reply	other threads:[~2023-07-18  6:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <tencent_5FEF30EB273BF931FF82DB522CA8CB13A307@qq.com>
2023-07-12  3:08 ` shijie001
2023-07-18  6:43   ` Philippe Mathieu-Daudé [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aa9cdc3a-dc01-f480-cc75-7ddf0a5092d1@linaro.org \
    --to=philmd@linaro.org \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=shijie001@208suo.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®