Skip to contentSkip to conversation

x86/cpu/amd: Remove unnecessary parentheses

PATCH New Nathan Chancellor 2 participants 2 messages Oct 2, 2018 – Oct 3, 2018 x86

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/cpu/amd: Remove unnecessary parentheses

Clang warns when multiple pairs of parentheses are used for a single conditional statement.

arch/x86/kernel/cpu/amd.c:925:14: warning: equality comparison with extraneous parentheses [-Wparentheses-equality]

        if ((c->x86 == 6)) {
             ~~~~~~~^~~~

arch/x86/kernel/cpu/amd.c:925:14: note: remove extraneous parentheses around the comparison to silence this warning
if ((c->x86 == 6)) {
~ ^ ~
arch/x86/kernel/cpu/amd.c:925:14: note: use '=' to turn this equality comparison into an assignment

        if ((c->x86 == 6)) {
                    ^~
                    =

1 warning generated.

---
 arch/x86/kernel/cpu/amd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kernel/cpu/amd.c +1 -1
index 22ab408177b2..eeea634bee0a 100644
@@ -922,7 +922,7 @@ static void init_amd(struct cpuinfo_x86 *c)
 static unsigned int amd_size_cache(struct cpuinfo_x86 *c, unsigned int size)
 {
 	/* AMD errata T13 (order #21922) */
-	if ((c->x86 == 6)) {
+	if (c->x86 == 6) {
 		/* Duron Rev A0 */
 		if (c->x86_model == 3 && c->x86_stepping == 0)
 			size = 64;
Signature · 1 line
2.19.0
#1 lore raw
x86/cpu/amd: Remove unnecessary parentheses
Commit-ID:  88296bd42b4e9d24e138a68b337c235b5cac89a7
Gitweb:     https://git.kernel.org/tip/88296bd42b4e9d24e138a68b337c235b5cac89a7
Author:     Nathan Chancellor <[email protected]>
AuthorDate: Tue, 2 Oct 2018 15:45:11 -0700
Committer:  Ingo Molnar <[email protected]>
CommitDate: Wed, 3 Oct 2018 08:27:47 +0200

x86/cpu/amd: Remove unnecessary parentheses

Clang warns when multiple pairs of parentheses are used for a single conditional statement.

arch/x86/kernel/cpu/amd.c:925:14: warning: equality comparison with extraneous parentheses [-Wparentheses-equality]

        if ((c->x86 == 6)) {
             ~~~~~~~^~~~

arch/x86/kernel/cpu/amd.c:925:14: note: remove extraneous parentheses around the comparison to silence this warning
if ((c->x86 == 6)) {
~ ^ ~
arch/x86/kernel/cpu/amd.c:925:14: note: use '=' to turn this equality comparison into an assignment

        if ((c->x86 == 6)) {
                    ^~
                    =

1 warning generated.

---
 arch/x86/kernel/cpu/amd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kernel/cpu/amd.c +1 -1
index 22ab408177b2..eeea634bee0a 100644
@@ -922,7 +922,7 @@ static void init_amd(struct cpuinfo_x86 *c)
 static unsigned int amd_size_cache(struct cpuinfo_x86 *c, unsigned int size)
 {
 	/* AMD errata T13 (order #21922) */
-	if ((c->x86 == 6)) {
+	if (c->x86 == 6) {
 		/* Duron Rev A0 */
 		if (c->x86_model == 3 && c->x86_stepping == 0)
 			size = 64;