Skip to contentSkip to conversation

KVM: x86:Fix warnings in debugfs.c

PATCH In review [email protected] 2 participants 2 messages Jul 12, 2023 – Jul 18, 2023 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 1/1 KVM: x86:Fix warnings in debugfs.c

The following checkpatch warning is removed:
WARNING: Prefer seq_puts to seq_printf

---
 arch/x86/kvm/debugfs.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
arch/x86/kvm/debugfs.c +3 -3
index ee8c4c3496ed..a3e118397aa3 100644
@@ -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");
 
     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");
     }
 
     ret = 0;
#2 lore raw

Hi,

Quoted 16 lines · On 12/7/23 05:08, [email protected] wrote:

The following checkpatch warning is removed:
WARNING: Prefer seq_puts to seq_printf

---
  arch/x86/kvm/debugfs.c | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)
arch/x86/kvm/debugfs.c +0 -0
index ee8c4c3496ed..a3e118397aa3 100644
@@ -133,20 +133,20 @@ static int kvm_mmu_rmaps_stat_show(struct seq_file 
 *m, void *v)
      mutex_unlock(&kvm->slots_lock);
 

arch/x86/kvm/debugfs.c static int kvm_mmu_rmaps_stat_show(struct seq_file · line 143

Quoted 10 lines
arch/x86/kvm/debugfs.c +2 -2
      /* 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.

arch/x86/kvm/debugfs.c static int kvm_mmu_rmaps_stat_show(struct seq_file *m, void *v) · line 149

Quoted 8 lines
arch/x86/kvm/debugfs.c +1 -1
      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.

Quoted 3 lines
arch/x86/kvm/debugfs.c +0 -0
      }
 
      ret = 0;