Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

sound: oss: uart401: Remove typedef uart401_devc

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

The following Coccinelle semantic patch detects the case.

@tn@
identifier i;
type td;
@@

-typedef
struct i { ... }
-td
;

@@
type tn.td;
identifier tn.i;
@@

-td
+ struct i

Signed-off-by: Himangi Saraogi <himangi774@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

authored by

Himangi Saraogi and committed by
Takashi Iwai
80e7bbac a509574e

+21 -19
+21 -19
sound/oss/uart401.c
··· 30 30 31 31 #include "mpu401.h" 32 32 33 - typedef struct uart401_devc 33 + struct uart401_devc 34 34 { 35 35 int base; 36 36 int irq; ··· 41 41 int my_dev; 42 42 int share_irq; 43 43 spinlock_t lock; 44 - } 45 - uart401_devc; 44 + }; 46 45 47 46 #define DATAPORT (devc->base) 48 47 #define COMDPORT (devc->base+1) 49 48 #define STATPORT (devc->base+1) 50 49 51 - static int uart401_status(uart401_devc * devc) 50 + static int uart401_status(struct uart401_devc *devc) 52 51 { 53 52 return inb(STATPORT); 54 53 } ··· 55 56 #define input_avail(devc) (!(uart401_status(devc)&INPUT_AVAIL)) 56 57 #define output_ready(devc) (!(uart401_status(devc)&OUTPUT_READY)) 57 58 58 - static void uart401_cmd(uart401_devc * devc, unsigned char cmd) 59 + static void uart401_cmd(struct uart401_devc *devc, unsigned char cmd) 59 60 { 60 61 outb((cmd), COMDPORT); 61 62 } 62 63 63 - static int uart401_read(uart401_devc * devc) 64 + static int uart401_read(struct uart401_devc *devc) 64 65 { 65 66 return inb(DATAPORT); 66 67 } 67 68 68 - static void uart401_write(uart401_devc * devc, unsigned char byte) 69 + static void uart401_write(struct uart401_devc *devc, unsigned char byte) 69 70 { 70 71 outb((byte), DATAPORT); 71 72 } ··· 76 77 #define MPU_RESET 0xFF 77 78 #define UART_MODE_ON 0x3F 78 79 79 - static int reset_uart401(uart401_devc * devc); 80 - static void enter_uart_mode(uart401_devc * devc); 80 + static int reset_uart401(struct uart401_devc *devc); 81 + static void enter_uart_mode(struct uart401_devc *devc); 81 82 82 - static void uart401_input_loop(uart401_devc * devc) 83 + static void uart401_input_loop(struct uart401_devc *devc) 83 84 { 84 85 int work_limit=30000; 85 86 ··· 98 99 99 100 irqreturn_t uart401intr(int irq, void *dev_id) 100 101 { 101 - uart401_devc *devc = dev_id; 102 + struct uart401_devc *devc = dev_id; 102 103 103 104 if (devc == NULL) 104 105 { ··· 117 118 void (*output) (int dev) 118 119 ) 119 120 { 120 - uart401_devc *devc = (uart401_devc *) midi_devs[dev]->devc; 121 + struct uart401_devc *devc = (struct uart401_devc *) 122 + midi_devs[dev]->devc; 121 123 122 124 if (devc->opened) 123 125 return -EBUSY; ··· 138 138 139 139 static void uart401_close(int dev) 140 140 { 141 - uart401_devc *devc = (uart401_devc *) midi_devs[dev]->devc; 141 + struct uart401_devc *devc = (struct uart401_devc *) 142 + midi_devs[dev]->devc; 142 143 143 144 reset_uart401(devc); 144 145 devc->opened = 0; ··· 149 148 { 150 149 int timeout; 151 150 unsigned long flags; 152 - uart401_devc *devc = (uart401_devc *) midi_devs[dev]->devc; 151 + struct uart401_devc *devc = (struct uart401_devc *) 152 + midi_devs[dev]->devc; 153 153 154 154 if (devc->disabled) 155 155 return 1; ··· 221 219 .buffer_status = uart401_buffer_status, 222 220 }; 223 221 224 - static void enter_uart_mode(uart401_devc * devc) 222 + static void enter_uart_mode(struct uart401_devc *devc) 225 223 { 226 224 int ok, timeout; 227 225 unsigned long flags; ··· 243 241 spin_unlock_irqrestore(&devc->lock,flags); 244 242 } 245 243 246 - static int reset_uart401(uart401_devc * devc) 244 + static int reset_uart401(struct uart401_devc *devc) 247 245 { 248 246 int ok, timeout, n; 249 247 ··· 287 285 288 286 int probe_uart401(struct address_info *hw_config, struct module *owner) 289 287 { 290 - uart401_devc *devc; 288 + struct uart401_devc *devc; 291 289 char *name = "MPU-401 (UART) MIDI"; 292 290 int ok = 0; 293 291 unsigned long flags; ··· 302 300 return 0; 303 301 } 304 302 305 - devc = kmalloc(sizeof(uart401_devc), GFP_KERNEL); 303 + devc = kmalloc(sizeof(struct uart401_devc), GFP_KERNEL); 306 304 if (!devc) { 307 305 printk(KERN_WARNING "uart401: Can't allocate memory\n"); 308 306 goto cleanup_region; ··· 394 392 395 393 void unload_uart401(struct address_info *hw_config) 396 394 { 397 - uart401_devc *devc; 395 + struct uart401_devc *devc; 398 396 int n=hw_config->slots[4]; 399 397 400 398 /* Not set up */