Skip to content

Commit 8b0eb83

Browse files
himangi774Dominik Brodowski
authored andcommitted
pcmcia: Remove typedef in structs and emum
The Linux kernel coding style guidelines suggest not using typedefs for structure and enum types. This patch gets rid of the typedefs for cirrus_state_t, vg46x_state_t and pcic_id. Also, the names of the structs are changed to drop the _t, to make the name look less typedef-like. The following Coccinelle semantic patch detects the cases for struct type: @tn@ identifier i; type td; @@ -typedef struct i { ... } -td ; @@ type tn.td; identifier tn.i; @@ -td + struct i [[email protected]: fix patch to apply cleanly after e632cd9 was applied first] Signed-off-by: Himangi Saraogi <[email protected]> Acked-by: Julia Lawall <[email protected]> Signed-off-by: Dominik Brodowski <[email protected]>
1 parent 820dc84 commit 8b0eb83

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

drivers/pcmcia/i82365.c

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -132,14 +132,14 @@ module_param(recov_time, int, 0444);
132132

133133
/*====================================================================*/
134134

135-
typedef struct cirrus_state_t {
135+
struct cirrus_state {
136136
u_char misc1, misc2;
137137
u_char timer[6];
138-
} cirrus_state_t;
138+
};
139139

140-
typedef struct vg46x_state_t {
140+
struct vg46x_state {
141141
u_char ctl, ema;
142-
} vg46x_state_t;
142+
};
143143

144144
struct i82365_socket {
145145
u_short type, flags;
@@ -149,8 +149,8 @@ struct i82365_socket {
149149
u_short psock;
150150
u_char cs_irq, intr;
151151
union {
152-
cirrus_state_t cirrus;
153-
vg46x_state_t vg46x;
152+
struct cirrus_state cirrus;
153+
struct vg46x_state vg46x;
154154
} state;
155155
};
156156

@@ -173,11 +173,11 @@ static struct timer_list poll_timer;
173173
/*====================================================================*/
174174

175175
/* These definitions must match the pcic table! */
176-
typedef enum pcic_id {
176+
enum pcic_id {
177177
IS_I82365A, IS_I82365B, IS_I82365DF,
178178
IS_IBM, IS_RF5Cx96, IS_VLSI, IS_VG468, IS_VG469,
179179
IS_PD6710, IS_PD672X, IS_VT83C469,
180-
} pcic_id;
180+
};
181181

182182
/* Flags for classifying groups of controllers */
183183
#define IS_VADEM 0x0001
@@ -189,12 +189,12 @@ typedef enum pcic_id {
189189
#define IS_REGISTERED 0x2000
190190
#define IS_ALIVE 0x8000
191191

192-
typedef struct pcic_t {
192+
struct pcic {
193193
char *name;
194194
u_short flags;
195-
} pcic_t;
195+
};
196196

197-
static pcic_t pcic[] = {
197+
static struct pcic pcic[] = {
198198
{ "Intel i82365sl A step", 0 },
199199
{ "Intel i82365sl B step", 0 },
200200
{ "Intel i82365sl DF", IS_DF_PWR },
@@ -294,7 +294,7 @@ static void i365_set_pair(u_short sock, u_short reg, u_short data)
294294
static void cirrus_get_state(u_short s)
295295
{
296296
int i;
297-
cirrus_state_t *p = &socket[s].state.cirrus;
297+
struct cirrus_state *p = &socket[s].state.cirrus;
298298
p->misc1 = i365_get(s, PD67_MISC_CTL_1);
299299
p->misc1 &= (PD67_MC1_MEDIA_ENA | PD67_MC1_INPACK_ENA);
300300
p->misc2 = i365_get(s, PD67_MISC_CTL_2);
@@ -306,7 +306,7 @@ static void cirrus_set_state(u_short s)
306306
{
307307
int i;
308308
u_char misc;
309-
cirrus_state_t *p = &socket[s].state.cirrus;
309+
struct cirrus_state *p = &socket[s].state.cirrus;
310310

311311
misc = i365_get(s, PD67_MISC_CTL_2);
312312
i365_set(s, PD67_MISC_CTL_2, p->misc2);
@@ -321,7 +321,7 @@ static void cirrus_set_state(u_short s)
321321
static u_int __init cirrus_set_opts(u_short s, char *buf)
322322
{
323323
struct i82365_socket *t = &socket[s];
324-
cirrus_state_t *p = &socket[s].state.cirrus;
324+
struct cirrus_state *p = &socket[s].state.cirrus;
325325
u_int mask = 0xffff;
326326

327327
if (has_ring == -1) has_ring = 1;
@@ -377,23 +377,23 @@ static u_int __init cirrus_set_opts(u_short s, char *buf)
377377

378378
static void vg46x_get_state(u_short s)
379379
{
380-
vg46x_state_t *p = &socket[s].state.vg46x;
380+
struct vg46x_state *p = &socket[s].state.vg46x;
381381
p->ctl = i365_get(s, VG468_CTL);
382382
if (socket[s].type == IS_VG469)
383383
p->ema = i365_get(s, VG469_EXT_MODE);
384384
}
385385

386386
static void vg46x_set_state(u_short s)
387387
{
388-
vg46x_state_t *p = &socket[s].state.vg46x;
388+
struct vg46x_state *p = &socket[s].state.vg46x;
389389
i365_set(s, VG468_CTL, p->ctl);
390390
if (socket[s].type == IS_VG469)
391391
i365_set(s, VG469_EXT_MODE, p->ema);
392392
}
393393

394394
static u_int __init vg46x_set_opts(u_short s, char *buf)
395395
{
396-
vg46x_state_t *p = &socket[s].state.vg46x;
396+
struct vg46x_state *p = &socket[s].state.vg46x;
397397

398398
flip(p->ctl, VG468_CTL_ASYNC, async_clock);
399399
flip(p->ema, VG469_MODE_CABLE, cable_mode);

0 commit comments

Comments
 (0)