Re: [PATCH] checkpatch: Check for .byte-spelled insn opcodes documentation on x86
From: Joe Perches
Date: Sat Oct 10 2020 - 19:12:12 EST
On Sat, 2020-10-10 at 12:54 +0200, Borislav Petkov wrote:
> > checkpatch uses only a single line output only before $herecurr
> > Output line length doesn't matter.
[]
> WARNING: Please document which binutils version supports these .byte-spelled
> insn opcodes by adding "binutils version <num>" in a comment above them.
> #90: FILE: arch/x86/include/asm/special_insns.h:254:
> + asm volatile(".byte 0x66, 0x0f, 0x38, 0xf8, 0x02"
>
>
> is easier readable than this:
>
> WARNING: Please document which binutils version supports these .byte-spelledinsn opcodes by adding "binutils version <num>" in a comment above them.
> #90: FILE: arch/x86/include/asm/special_insns.h:254:
> + asm volatile(".byte 0x66, 0x0f, 0x38, 0xf8, 0x02"
Readability is a consideration but it still must be a single line.
using --terse requires single line error output
Perhaps:
if ($comment !~ /\bbinutils version [0-9.]+/ms) {
WARN("MISSING_BINUTILS_VERSION",
"Please add a comment for .byte-spelled insn opcodes with \"binutils version <minimum_required_version>\"\n" . $herecurr);