[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20140806130025.GA8156@himangi-Dell>
Date: Wed, 6 Aug 2014 18:30:25 +0530
From: Himangi Saraogi <himangi774@...il.com>
To: Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>,
"H. Peter Anvin" <hpa@...or.com>, x86@...nel.org,
linux-kernel@...r.kernel.org
Cc: Julia Lawall <julia.lawall@...6.fr>
Subject: [PATCH] x86: mtrr/cyrix.c : Remove typedef arr_state_t
The Linux kernel coding style guidelines suggest not using typedefs
for structure types. This patch gets rid of the typedef for arr_state_t.
Also the name of the struct is changed to drop the _t, to make the
name look less typedef-like.
The following Coccinelle semantic patch detects the case.
@tn1@
type td;
@@
typedef struct { ... } td;
@script:python tf@
td << tn1.td;
tdres;
@@
coccinelle.tdres = td;
@@
type tn1.td;
identifier tf.tdres;
@@
-typedef
struct
+ tdres
{ ... }
-td
;
@@
type tn1.td;
identifier tf.tdres;
@@
(
-td
+ struct tdres
|
const
- td
+ struct tdres
)
Signed-off-by: Himangi Saraogi <himangi774@...il.com>
Acked-by: Julia Lawall <julia.lawall@...6.fr>
---
arch/x86/kernel/cpu/mtrr/cyrix.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/x86/kernel/cpu/mtrr/cyrix.c b/arch/x86/kernel/cpu/mtrr/cyrix.c
index 9e451b0..5e8d57d 100644
--- a/arch/x86/kernel/cpu/mtrr/cyrix.c
+++ b/arch/x86/kernel/cpu/mtrr/cyrix.c
@@ -232,13 +232,13 @@ static void cyrix_set_arr(unsigned int reg, unsigned long base,
post_set();
}
-typedef struct {
+struct arr_state {
unsigned long base;
unsigned long size;
mtrr_type type;
-} arr_state_t;
+};
-static arr_state_t arr_state[8] = {
+static struct arr_state arr_state[8] = {
{0UL, 0UL, 0UL}, {0UL, 0UL, 0UL}, {0UL, 0UL, 0UL}, {0UL, 0UL, 0UL},
{0UL, 0UL, 0UL}, {0UL, 0UL, 0UL}, {0UL, 0UL, 0UL}, {0UL, 0UL, 0UL}
};
--
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists