提交 61ecba64 编写于 作者: H Himangi Saraogi 提交者: David S. Miller

airo_cs: Remove typedef local_info_t

The Linux kernel coding style guidelines suggest not using typedefs
for structure types. This patch gets rid of the typedef for
local_info_t. Also, the name of the struct is changed to drop the _t,
to make the name look less typedef-like.

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: NHimangi Saraogi <himangi774@gmail.com>
Acked-by: NJulia Lawall <julia.lawall@lip6.fr>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 f0db82a5
...@@ -56,18 +56,18 @@ static void airo_release(struct pcmcia_device *link); ...@@ -56,18 +56,18 @@ static void airo_release(struct pcmcia_device *link);
static void airo_detach(struct pcmcia_device *p_dev); static void airo_detach(struct pcmcia_device *p_dev);
typedef struct local_info_t { struct local_info {
struct net_device *eth_dev; struct net_device *eth_dev;
} local_info_t; };
static int airo_probe(struct pcmcia_device *p_dev) static int airo_probe(struct pcmcia_device *p_dev)
{ {
local_info_t *local; struct local_info *local;
dev_dbg(&p_dev->dev, "airo_attach()\n"); dev_dbg(&p_dev->dev, "airo_attach()\n");
/* Allocate space for private device-specific data */ /* Allocate space for private device-specific data */
local = kzalloc(sizeof(local_info_t), GFP_KERNEL); local = kzalloc(sizeof(*local), GFP_KERNEL);
if (!local) if (!local)
return -ENOMEM; return -ENOMEM;
...@@ -82,10 +82,11 @@ static void airo_detach(struct pcmcia_device *link) ...@@ -82,10 +82,11 @@ static void airo_detach(struct pcmcia_device *link)
airo_release(link); airo_release(link);
if (((local_info_t *)link->priv)->eth_dev) { if (((struct local_info *)link->priv)->eth_dev) {
stop_airo_card(((local_info_t *)link->priv)->eth_dev, 0); stop_airo_card(((struct local_info *)link->priv)->eth_dev,
0);
} }
((local_info_t *)link->priv)->eth_dev = NULL; ((struct local_info *)link->priv)->eth_dev = NULL;
kfree(link->priv); kfree(link->priv);
} /* airo_detach */ } /* airo_detach */
...@@ -101,7 +102,7 @@ static int airo_cs_config_check(struct pcmcia_device *p_dev, void *priv_data) ...@@ -101,7 +102,7 @@ static int airo_cs_config_check(struct pcmcia_device *p_dev, void *priv_data)
static int airo_config(struct pcmcia_device *link) static int airo_config(struct pcmcia_device *link)
{ {
local_info_t *dev; struct local_info *dev;
int ret; int ret;
dev = link->priv; dev = link->priv;
...@@ -121,10 +122,10 @@ static int airo_config(struct pcmcia_device *link) ...@@ -121,10 +122,10 @@ static int airo_config(struct pcmcia_device *link)
ret = pcmcia_enable_device(link); ret = pcmcia_enable_device(link);
if (ret) if (ret)
goto failed; goto failed;
((local_info_t *)link->priv)->eth_dev = ((struct local_info *)link->priv)->eth_dev =
init_airo_card(link->irq, init_airo_card(link->irq,
link->resource[0]->start, 1, &link->dev); link->resource[0]->start, 1, &link->dev);
if (!((local_info_t *)link->priv)->eth_dev) if (!((struct local_info *)link->priv)->eth_dev)
goto failed; goto failed;
return 0; return 0;
...@@ -142,7 +143,7 @@ static void airo_release(struct pcmcia_device *link) ...@@ -142,7 +143,7 @@ static void airo_release(struct pcmcia_device *link)
static int airo_suspend(struct pcmcia_device *link) static int airo_suspend(struct pcmcia_device *link)
{ {
local_info_t *local = link->priv; struct local_info *local = link->priv;
netif_device_detach(local->eth_dev); netif_device_detach(local->eth_dev);
...@@ -151,7 +152,7 @@ static int airo_suspend(struct pcmcia_device *link) ...@@ -151,7 +152,7 @@ static int airo_suspend(struct pcmcia_device *link)
static int airo_resume(struct pcmcia_device *link) static int airo_resume(struct pcmcia_device *link)
{ {
local_info_t *local = link->priv; struct local_info *local = link->priv;
if (link->open) { if (link->open) {
reset_airo_card(local->eth_dev); reset_airo_card(local->eth_dev);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册