Skip to contentSkip to conversation

Drivers: ide: Remove typedef atiixp_ide_timing

PATCH Applied Himangi Saraogi 2 participants 2 messages Aug 14, 2014 – Oct 15, 2014 libata

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Drivers: ide: Remove typedef atiixp_ide_timing

The Linux kernel coding style guidelines suggest not using typedefs for structure types. This patch gets rid of the typedef for atiixp_ide_timing.

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

---
 drivers/ide/atiixp.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/ide/atiixp.c +4 -4
index dbd0f24..76650e9 100644
@@ -19,12 +19,12 @@
 #define ATIIXP_IDE_UDMA_CONTROL		0x54
 #define ATIIXP_IDE_UDMA_MODE		0x56
 
-typedef struct {
+struct atiixp_ide_timing {
 	u8 command_width;
 	u8 recover_width;
-} atiixp_ide_timing;
+};
 
-static atiixp_ide_timing pio_timing[] = {
+static struct atiixp_ide_timing pio_timing[] = {
 	{ 0x05, 0x0d },
 	{ 0x04, 0x07 },
 	{ 0x03, 0x04 },
@@ -32,7 +32,7 @@ static atiixp_ide_timing pio_timing[] = {
 	{ 0x02, 0x00 },
 };
 
-static atiixp_ide_timing mdma_timing[] = {
+static struct atiixp_ide_timing mdma_timing[] = {
 	{ 0x07, 0x07 },
 	{ 0x02, 0x01 },
 	{ 0x02, 0x00 },
Signature · 1 line
1.9.1