Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

LoongArch: Replace seq_printf() with seq_puts() for simple strings

Fix warnings like: "Prefer seq_puts to seq_printf" by checkpatch.pl.

Replace seq_printf() calls with seq_puts() in show_cpuinfo() when
outputting simple constant strings without format specifiers.

This improves performance slightly as seq_puts() avoids parsing the
format string.

Signed-off-by: George Guo <guodongtai@kylinos.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>

authored by

George Guo and committed by
Huacai Chen
52c1dbf4 f0e4b1b6

+40 -24
+40 -24
arch/loongarch/kernel/proc.c
··· 50 50 seq_printf(m, "Address Sizes\t\t: %d bits physical, %d bits virtual\n", 51 51 cpu_pabits + 1, cpu_vabits + 1); 52 52 53 - seq_printf(m, "ISA\t\t\t:"); 53 + seq_puts(m, "ISA\t\t\t:"); 54 54 if (isa & LOONGARCH_CPU_ISA_LA32R) 55 - seq_printf(m, " loongarch32r"); 55 + seq_puts(m, " loongarch32r"); 56 56 if (isa & LOONGARCH_CPU_ISA_LA32S) 57 - seq_printf(m, " loongarch32s"); 57 + seq_puts(m, " loongarch32s"); 58 58 if (isa & LOONGARCH_CPU_ISA_LA64) 59 - seq_printf(m, " loongarch64"); 60 - seq_printf(m, "\n"); 59 + seq_puts(m, " loongarch64"); 60 + seq_puts(m, "\n"); 61 61 62 - seq_printf(m, "Features\t\t:"); 63 - if (cpu_has_cpucfg) seq_printf(m, " cpucfg"); 64 - if (cpu_has_lam) seq_printf(m, " lam"); 65 - if (cpu_has_scq) seq_printf(m, " scq"); 66 - if (cpu_has_ual) seq_printf(m, " ual"); 67 - if (cpu_has_fpu) seq_printf(m, " fpu"); 68 - if (cpu_has_lsx) seq_printf(m, " lsx"); 69 - if (cpu_has_lasx) seq_printf(m, " lasx"); 70 - if (cpu_has_crc32) seq_printf(m, " crc32"); 71 - if (cpu_has_complex) seq_printf(m, " complex"); 72 - if (cpu_has_crypto) seq_printf(m, " crypto"); 73 - if (cpu_has_ptw) seq_printf(m, " ptw"); 74 - if (cpu_has_lspw) seq_printf(m, " lspw"); 75 - if (cpu_has_lvz) seq_printf(m, " lvz"); 76 - if (cpu_has_lbt_x86) seq_printf(m, " lbt_x86"); 77 - if (cpu_has_lbt_arm) seq_printf(m, " lbt_arm"); 78 - if (cpu_has_lbt_mips) seq_printf(m, " lbt_mips"); 79 - seq_printf(m, "\n"); 62 + seq_puts(m, "Features\t\t:"); 63 + if (cpu_has_cpucfg) 64 + seq_puts(m, " cpucfg"); 65 + if (cpu_has_lam) 66 + seq_puts(m, " lam"); 67 + if (cpu_has_scq) 68 + seq_puts(m, " scq"); 69 + if (cpu_has_ual) 70 + seq_puts(m, " ual"); 71 + if (cpu_has_fpu) 72 + seq_puts(m, " fpu"); 73 + if (cpu_has_lsx) 74 + seq_puts(m, " lsx"); 75 + if (cpu_has_lasx) 76 + seq_puts(m, " lasx"); 77 + if (cpu_has_crc32) 78 + seq_puts(m, " crc32"); 79 + if (cpu_has_complex) 80 + seq_puts(m, " complex"); 81 + if (cpu_has_crypto) 82 + seq_puts(m, " crypto"); 83 + if (cpu_has_ptw) 84 + seq_puts(m, " ptw"); 85 + if (cpu_has_lspw) 86 + seq_puts(m, " lspw"); 87 + if (cpu_has_lvz) 88 + seq_puts(m, " lvz"); 89 + if (cpu_has_lbt_x86) 90 + seq_puts(m, " lbt_x86"); 91 + if (cpu_has_lbt_arm) 92 + seq_puts(m, " lbt_arm"); 93 + if (cpu_has_lbt_mips) 94 + seq_puts(m, " lbt_mips"); 95 + seq_puts(m, "\n"); 80 96 81 97 seq_printf(m, "Hardware Watchpoint\t: %s", str_yes_no(cpu_has_watch)); 82 98 if (cpu_has_watch) { ··· 100 84 cpu_data[n].watch_ireg_count, cpu_data[n].watch_dreg_count); 101 85 } 102 86 103 - seq_printf(m, "\n\n"); 87 + seq_puts(m, "\n\n"); 104 88 105 89 return 0; 106 90 }