Skip to contentSkip to conversation

target/i386: Correct extra enter and spaces in comment

PATCH In review Tao Xu 3 participants 4 messages Sep 19, 2019 – Sep 20, 2019

lore
Share & tools
lore

Tao Xu

author
#0 lore raw

PATCH 1/1 target/i386: Correct extra enter and spaces in comment

There is an extra line in comment of CPUID_8000_0008_EBX_WBNOINVD, remove the extra enter and spaces.

---
 target/i386/cpu.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
target/i386/cpu.h +1 -2
index 5f6e3a029a..71b6193390 100644
@@ -695,8 +695,7 @@ typedef uint32_t FeatureWordArray[FEATURE_WORDS];
 
 #define CPUID_7_1_EAX_AVX512_BF16 (1U << 5) /* AVX512 BFloat16 Instruction */
 
-#define CPUID_8000_0008_EBX_WBNOINVD  (1U << 9)  /* Write back and
-                                                                             do not invalidate cache */
+#define CPUID_8000_0008_EBX_WBNOINVD (1U << 9) /* Write back and do not invalidate cache */
 #define CPUID_8000_0008_EBX_IBPB    (1U << 12) /* Indirect Branch Prediction Barrier */
 
 #define CPUID_XSAVE_XSAVEOPT   (1U << 0)
Signature · 1 line
2.20.1
#1 lore raw

Hi Tao,

Quoted 13 lines · Tao Xu

There is an extra line in comment of CPUID_8000_0008_EBX_WBNOINVD, remove the extra enter and spaces.

---
 target/i386/cpu.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
target/i386/cpu.h +0 -0
index 5f6e3a029a..71b6193390 100644

target/i386/cpu.h typedef uint32_t FeatureWordArray[FEATURE_WORDS]; · line 698

Quoted 6 lines
target/i386/cpu.h +1 -2
@@ -695,8 +695,7 @@ typedef uint32_t FeatureWordArray[FEATURE_WORDS];
 
 #define CPUID_7_1_EAX_AVX512_BF16 (1U << 5) /* AVX512 BFloat16 Instruction */
 
-#define CPUID_8000_0008_EBX_WBNOINVD  (1U << 9)  /* Write back and
-                                                                             do not invalidate cache */
+#define CPUID_8000_0008_EBX_WBNOINVD (1U << 9) /* Write back and do not invalidate cache */

The QEMU CODING_STYLE [*] recommend a 80 chars per line limit:

Line width
==========

Lines should be 80 characters; try not to make them longer.

Sometimes it is hard to do, especially when dealing with QEMU subsystems that use long function or symbol names. Even in that case, do not make lines much longer than 80 characters.

Rationale:

* Some people like to tile their 24" screens with a 6x4 matrix of 80x24 xterms and use vi in all of them. The best way to punish them is to let them keep doing it.
* Code and especially patches is much more readable if limited to a sane line length. Eighty is traditional.
* The four-space indentation makes the most common excuse ("But look at all that white space on the left!") moot.
* It is the QEMU coding style.

[*]
https://git.qemu.org/?p=qemu.git;a=blob;f=CODING_STYLE.rst;h=427699e0e425431ea99d4046e40543bdcc22e9c5;hb=HEAD#l82

Can you repost using correct lenght comments?

Quoted 4 lines
target/i386/cpu.h +0 -0
 #define CPUID_8000_0008_EBX_IBPB    (1U << 12) /* Indirect Branch Prediction Barrier */
 
 #define CPUID_XSAVE_XSAVEOPT   (1U << 0)
author
#2 lore raw
Quoted 45 lines · Philippe Mathieu-Daudé

Hi Tao,

Quoted 13 lines · Tao Xu

There is an extra line in comment of CPUID_8000_0008_EBX_WBNOINVD, remove the extra enter and spaces.

---
  target/i386/cpu.h | 3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)
target/i386/cpu.h +0 -0
index 5f6e3a029a..71b6193390 100644

target/i386/cpu.h typedef uint32_t FeatureWordArray[FEATURE_WORDS]; · line 698

Quoted 6 lines
target/i386/cpu.h +1 -2
@@ -695,8 +695,7 @@ typedef uint32_t FeatureWordArray[FEATURE_WORDS];
 
  #define CPUID_7_1_EAX_AVX512_BF16 (1U << 5) /* AVX512 BFloat16 Instruction */
 
-#define CPUID_8000_0008_EBX_WBNOINVD  (1U << 9)  /* Write back and
-                                                                             do not invalidate cache */
+#define CPUID_8000_0008_EBX_WBNOINVD (1U << 9) /* Write back and do not invalidate cache */

The QEMU CODING_STYLE [*] recommend a 80 chars per line limit:

Line width
==========

Lines should be 80 characters; try not to make them longer.

Sometimes it is hard to do, especially when dealing with QEMU subsystems that use long function or symbol names. Even in that case, do not make lines much longer than 80 characters.

Rationale:

* Some people like to tile their 24" screens with a 6x4 matrix of 80x24 xterms and use vi in all of them. The best way to punish them is to let them keep doing it.
* Code and especially patches is much more readable if limited to a sane line length. Eighty is traditional.
* The four-space indentation makes the most common excuse ("But look at all that white space on the left!") moot.
* It is the QEMU coding style.

Quoted 4 lines

[*]
https://git.qemu.org/?p=qemu.git;a=blob;f=CODING_STYLE.rst;h=427699e0e425431ea99d4046e40543bdcc22e9c5;hb=HEAD#l82

Can you repost using correct lenght comments?

Yes, But it is hard to do and in this header file there are lots of lines over 80 chars even 90 chars. So how about I correct all the lines over 80 like this:

/* Write back and do not invalidate cache */
#define CPUID_8000_0008_EBX_WBNOINVD (1U << 9)
/* Indirect Branch Prediction Barrier */
#define CPUID_8000_0008_EBX_IBPB (1U << 12)

Quoted 5 lines
Quoted 5 lines
target/i386/cpu.h +0 -0
  #define CPUID_8000_0008_EBX_IBPB    (1U << 12) /* Indirect Branch Prediction Barrier */
 
  #define CPUID_XSAVE_XSAVEOPT   (1U << 0)
#3 lore raw
In reply to Tao Xu
Patchew URL: https://patchew.org/QEMU/[email protected]/

Patchew URL: https://patchew.org/QEMU/[email protected]/

Hi,

This series seems to have some coding style problems. See output below for more information:

Message-id: [email protected]
Subject: [Qemu-devel] [PATCH] target/i386: Correct extra enter and spaces in comment
Type: series

=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram
./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384 Switched to a new branch 'test'
3ff8f90 target/i386: Correct extra enter and spaces in comment

=== OUTPUT BEGIN ===
ERROR: line over 90 characters
#23: FILE: target/i386/cpu.h:698:
+#define CPUID_8000_0008_EBX_WBNOINVD (1U << 9) /* Write back and do not invalidate cache */

total: 1 errors, 0 warnings, 9 lines checked

Commit 3ff8f905c3b0 (target/i386: Correct extra enter and spaces in comment) has style problems, please review. If any of these errors are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
=== OUTPUT END ===

Test command exited with code: 1

The full log is available at
http://patchew.org/logs/[email protected]/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to [email protected]