Commit 3ce3c1c4 authored by Himangi Saraogi's avatar Himangi Saraogi Committed by Dominik Brodowski

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: default avatarHimangi Saraogi <himangi774@gmail.com>
Acked-by: default avatarJulia Lawall <julia.lawall@lip6.fr>
Signed-off-by: default avatarDominik Brodowski <linux@dominikbrodowski.net>
parent 8b0eb837
...@@ -84,32 +84,32 @@ MODULE_LICENSE("GPL"); ...@@ -84,32 +84,32 @@ MODULE_LICENSE("GPL");
#define IO_MAX_MAPS 2 #define IO_MAX_MAPS 2
#define MEM_MAX_MAPS 5 #define MEM_MAX_MAPS 5
typedef enum { enum vrc4171_slot {
SLOT_PROBE = 0, SLOT_PROBE = 0,
SLOT_NOPROBE_IO, SLOT_NOPROBE_IO,
SLOT_NOPROBE_MEM, SLOT_NOPROBE_MEM,
SLOT_NOPROBE_ALL, SLOT_NOPROBE_ALL,
SLOT_INITIALIZED, SLOT_INITIALIZED,
} vrc4171_slot_t; };
typedef enum { enum vrc4171_slotb {
SLOTB_IS_NONE, SLOTB_IS_NONE,
SLOTB_IS_PCCARD, SLOTB_IS_PCCARD,
SLOTB_IS_CF, SLOTB_IS_CF,
SLOTB_IS_FLASHROM, SLOTB_IS_FLASHROM,
} vrc4171_slotb_t; };
typedef struct vrc4171_socket { struct vrc4171_socket {
vrc4171_slot_t slot; enum vrc4171_slot slot;
struct pcmcia_socket pcmcia_socket; struct pcmcia_socket pcmcia_socket;
char name[24]; char name[24];
int csc_irq; int csc_irq;
int io_irq; int io_irq;
spinlock_t lock; spinlock_t lock;
} vrc4171_socket_t; };
static vrc4171_socket_t vrc4171_sockets[CARD_MAX_SLOTS]; static struct vrc4171_socket vrc4171_sockets[CARD_MAX_SLOTS];
static vrc4171_slotb_t vrc4171_slotb = SLOTB_IS_NONE; static enum vrc4171_slotb vrc4171_slotb = SLOTB_IS_NONE;
static char vrc4171_card_name[] = "NEC VRC4171 Card Controller"; static char vrc4171_card_name[] = "NEC VRC4171 Card Controller";
static unsigned int vrc4171_irq; static unsigned int vrc4171_irq;
static uint16_t vrc4171_irq_mask = 0xdeb8; static uint16_t vrc4171_irq_mask = 0xdeb8;
...@@ -141,7 +141,7 @@ static inline uint16_t vrc4171_get_irq_status(void) ...@@ -141,7 +141,7 @@ static inline uint16_t vrc4171_get_irq_status(void)
return inw(INTERRUPT_STATUS); return inw(INTERRUPT_STATUS);
} }
static inline void vrc4171_set_multifunction_pin(vrc4171_slotb_t config) static inline void vrc4171_set_multifunction_pin(enum vrc4171_slotb config)
{ {
uint16_t config1; uint16_t config1;
...@@ -234,7 +234,7 @@ static inline int search_nonuse_irq(void) ...@@ -234,7 +234,7 @@ static inline int search_nonuse_irq(void)
static int pccard_init(struct pcmcia_socket *sock) static int pccard_init(struct pcmcia_socket *sock)
{ {
vrc4171_socket_t *socket; struct vrc4171_socket *socket;
unsigned int slot; unsigned int slot;
sock->features |= SS_CAP_PCCARD | SS_CAP_PAGE_REGS; sock->features |= SS_CAP_PCCARD | SS_CAP_PAGE_REGS;
...@@ -317,7 +317,7 @@ static inline uint8_t set_Vcc_value(u_char Vcc) ...@@ -317,7 +317,7 @@ static inline uint8_t set_Vcc_value(u_char Vcc)
static int pccard_set_socket(struct pcmcia_socket *sock, socket_state_t *state) static int pccard_set_socket(struct pcmcia_socket *sock, socket_state_t *state)
{ {
vrc4171_socket_t *socket; struct vrc4171_socket *socket;
unsigned int slot; unsigned int slot;
uint8_t voltage, power, control, cscint; uint8_t voltage, power, control, cscint;
...@@ -517,7 +517,7 @@ static inline unsigned int get_events(int slot) ...@@ -517,7 +517,7 @@ static inline unsigned int get_events(int slot)
static irqreturn_t pccard_interrupt(int irq, void *dev_id) static irqreturn_t pccard_interrupt(int irq, void *dev_id)
{ {
vrc4171_socket_t *socket; struct vrc4171_socket *socket;
unsigned int events; unsigned int events;
irqreturn_t retval = IRQ_NONE; irqreturn_t retval = IRQ_NONE;
uint16_t status; uint16_t status;
...@@ -567,7 +567,7 @@ static inline void reserve_using_irq(int slot) ...@@ -567,7 +567,7 @@ static inline void reserve_using_irq(int slot)
static int vrc4171_add_sockets(void) static int vrc4171_add_sockets(void)
{ {
vrc4171_socket_t *socket; struct vrc4171_socket *socket;
int slot, retval; int slot, retval;
for (slot = 0; slot < CARD_MAX_SLOTS; slot++) { for (slot = 0; slot < CARD_MAX_SLOTS; slot++) {
...@@ -617,7 +617,7 @@ static int vrc4171_add_sockets(void) ...@@ -617,7 +617,7 @@ static int vrc4171_add_sockets(void)
static void vrc4171_remove_sockets(void) static void vrc4171_remove_sockets(void)
{ {
vrc4171_socket_t *socket; struct vrc4171_socket *socket;
int slot; int slot;
for (slot = 0; slot < CARD_MAX_SLOTS; slot++) { for (slot = 0; slot < CARD_MAX_SLOTS; slot++) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment