Skip to content

Commit 3ce3c1c

Browse files
himangi774Dominik Brodowski
authored andcommitted
pcmcia/vrc4171: Remove typedefs for enums and struct
The Linux kernel coding style guidelines suggest not using typedefs for structure and enum types. This patch gets rid of the typedefs for vrc4171_slot_t, vrc4171_slotb_t and vrc4171_socket_t. Also, the names of the enums and the struct 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 Signed-off-by: Himangi Saraogi <[email protected]> Acked-by: Julia Lawall <[email protected]> Signed-off-by: Dominik Brodowski <[email protected]>
1 parent 8b0eb83 commit 3ce3c1c

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

drivers/pcmcia/vrc4171_card.c

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -84,32 +84,32 @@ MODULE_LICENSE("GPL");
8484
#define IO_MAX_MAPS 2
8585
#define MEM_MAX_MAPS 5
8686

87-
typedef enum {
87+
enum vrc4171_slot {
8888
SLOT_PROBE = 0,
8989
SLOT_NOPROBE_IO,
9090
SLOT_NOPROBE_MEM,
9191
SLOT_NOPROBE_ALL,
9292
SLOT_INITIALIZED,
93-
} vrc4171_slot_t;
93+
};
9494

95-
typedef enum {
95+
enum vrc4171_slotb {
9696
SLOTB_IS_NONE,
9797
SLOTB_IS_PCCARD,
9898
SLOTB_IS_CF,
9999
SLOTB_IS_FLASHROM,
100-
} vrc4171_slotb_t;
100+
};
101101

102-
typedef struct vrc4171_socket {
103-
vrc4171_slot_t slot;
102+
struct vrc4171_socket {
103+
enum vrc4171_slot slot;
104104
struct pcmcia_socket pcmcia_socket;
105105
char name[24];
106106
int csc_irq;
107107
int io_irq;
108108
spinlock_t lock;
109-
} vrc4171_socket_t;
109+
};
110110

111-
static vrc4171_socket_t vrc4171_sockets[CARD_MAX_SLOTS];
112-
static vrc4171_slotb_t vrc4171_slotb = SLOTB_IS_NONE;
111+
static struct vrc4171_socket vrc4171_sockets[CARD_MAX_SLOTS];
112+
static enum vrc4171_slotb vrc4171_slotb = SLOTB_IS_NONE;
113113
static char vrc4171_card_name[] = "NEC VRC4171 Card Controller";
114114
static unsigned int vrc4171_irq;
115115
static uint16_t vrc4171_irq_mask = 0xdeb8;
@@ -141,7 +141,7 @@ static inline uint16_t vrc4171_get_irq_status(void)
141141
return inw(INTERRUPT_STATUS);
142142
}
143143

144-
static inline void vrc4171_set_multifunction_pin(vrc4171_slotb_t config)
144+
static inline void vrc4171_set_multifunction_pin(enum vrc4171_slotb config)
145145
{
146146
uint16_t config1;
147147

@@ -234,7 +234,7 @@ static inline int search_nonuse_irq(void)
234234

235235
static int pccard_init(struct pcmcia_socket *sock)
236236
{
237-
vrc4171_socket_t *socket;
237+
struct vrc4171_socket *socket;
238238
unsigned int slot;
239239

240240
sock->features |= SS_CAP_PCCARD | SS_CAP_PAGE_REGS;
@@ -317,7 +317,7 @@ static inline uint8_t set_Vcc_value(u_char Vcc)
317317

318318
static int pccard_set_socket(struct pcmcia_socket *sock, socket_state_t *state)
319319
{
320-
vrc4171_socket_t *socket;
320+
struct vrc4171_socket *socket;
321321
unsigned int slot;
322322
uint8_t voltage, power, control, cscint;
323323

@@ -517,7 +517,7 @@ static inline unsigned int get_events(int slot)
517517

518518
static irqreturn_t pccard_interrupt(int irq, void *dev_id)
519519
{
520-
vrc4171_socket_t *socket;
520+
struct vrc4171_socket *socket;
521521
unsigned int events;
522522
irqreturn_t retval = IRQ_NONE;
523523
uint16_t status;
@@ -567,7 +567,7 @@ static inline void reserve_using_irq(int slot)
567567

568568
static int vrc4171_add_sockets(void)
569569
{
570-
vrc4171_socket_t *socket;
570+
struct vrc4171_socket *socket;
571571
int slot, retval;
572572

573573
for (slot = 0; slot < CARD_MAX_SLOTS; slot++) {
@@ -617,7 +617,7 @@ static int vrc4171_add_sockets(void)
617617

618618
static void vrc4171_remove_sockets(void)
619619
{
620-
vrc4171_socket_t *socket;
620+
struct vrc4171_socket *socket;
621621
int slot;
622622

623623
for (slot = 0; slot < CARD_MAX_SLOTS; slot++) {

0 commit comments

Comments
 (0)