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

Staging: wilc1000: Remove and rename struct typedefs from .c files

Using typedef for a structure type is not suggested in Linux kernel coding
style guidelines. So remove typedefs from structures wilc_sdio_t,
wilc_spi_t and wilc_mac_cfg_t.
Also remove '_t' suffix from the struct names by hand.

The following semantic patch detects cases:

@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

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Bhumika Goyal and committed by
Greg Kroah-Hartman
6a707a9e 5bc32160

+13 -13
+4 -4
drivers/staging/wilc1000/wilc_sdio.c
··· 30 30 31 31 #define WILC_SDIO_BLOCK_SIZE 512 32 32 33 - typedef struct { 33 + struct wilc_sdio { 34 34 bool irq_gpio; 35 35 u32 block_size; 36 36 int nint; 37 37 #define MAX_NUN_INT_THRPT_ENH2 (5) /* Max num interrupts allowed in registers 0xf7, 0xf8 */ 38 38 int has_thrpt_enh3; 39 - } wilc_sdio_t; 39 + }; 40 40 41 - static wilc_sdio_t g_sdio; 41 + static struct wilc_sdio g_sdio; 42 42 43 43 static int sdio_write_reg(struct wilc *wilc, u32 addr, u32 data); 44 44 static int sdio_read_reg(struct wilc *wilc, u32 addr, u32 *data); ··· 675 675 u32 chipid; 676 676 677 677 if (!resume) { 678 - memset(&g_sdio, 0, sizeof(wilc_sdio_t)); 678 + memset(&g_sdio, 0, sizeof(struct wilc_sdio)); 679 679 g_sdio.irq_gpio = wilc->dev_irq_num; 680 680 } 681 681
+4 -4
drivers/staging/wilc1000/wilc_spi.c
··· 24 24 #include "wilc_wlan.h" 25 25 #include "wilc_wfi_netdevice.h" 26 26 27 - typedef struct { 27 + struct wilc_spi { 28 28 int crc_off; 29 29 int nint; 30 30 int has_thrpt_enh; 31 - } wilc_spi_t; 31 + }; 32 32 33 - static wilc_spi_t g_spi; 33 + static struct wilc_spi g_spi; 34 34 35 35 static int wilc_spi_read(struct wilc *wilc, u32, u8 *, u32); 36 36 static int wilc_spi_write(struct wilc *wilc, u32, u8 *, u32); ··· 861 861 return 1; 862 862 } 863 863 864 - memset(&g_spi, 0, sizeof(wilc_spi_t)); 864 + memset(&g_spi, 0, sizeof(struct wilc_spi)); 865 865 866 866 /** 867 867 * configure protocol
+5 -5
drivers/staging/wilc1000/wilc_wlan_cfg.c
··· 19 19 * 20 20 ********************************************/ 21 21 22 - typedef struct { 22 + struct wilc_mac_cfg { 23 23 wilc_debug_func dPrint; 24 24 25 25 int mac_status; ··· 40 40 u8 firmware_info[8]; 41 41 u8 scan_result[256]; 42 42 u8 scan_result1[256]; 43 - } wilc_mac_cfg_t; 43 + }; 44 44 45 - static wilc_mac_cfg_t g_mac; 45 + static struct wilc_mac_cfg g_mac; 46 46 47 47 static struct wilc_cfg_byte g_cfg_byte[] = { 48 48 {WID_BSS_TYPE, 0}, ··· 349 349 350 350 static int wilc_wlan_parse_info_frame(u8 *info, int size) 351 351 { 352 - wilc_mac_cfg_t *pd = &g_mac; 352 + struct wilc_mac_cfg *pd = &g_mac; 353 353 u32 wid, len; 354 354 int type = WILC_CFG_RSP_STATUS; 355 355 ··· 539 539 540 540 int wilc_wlan_cfg_init(wilc_debug_func func) 541 541 { 542 - memset((void *)&g_mac, 0, sizeof(wilc_mac_cfg_t)); 542 + memset((void *)&g_mac, 0, sizeof(struct wilc_mac_cfg)); 543 543 g_mac.dPrint = func; 544 544 return 1; 545 545 }