Skip to content

Commit

Permalink
com20020_cs: Remove typedef com20020_dev_t
Browse files Browse the repository at this point in the history
The Linux kernel coding style guidelines suggest not using typedefs
for structure types. This patch gets rid of the typedef for
com20020_dev_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: Himangi Saraogi <himangi774@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Himangi Saraogi authored and David S. Miller committed Aug 11, 2014
1 parent f865346 commit 2dfd253
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions drivers/net/arcnet/com20020_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,20 +112,20 @@ static void com20020_detach(struct pcmcia_device *p_dev);

/*====================================================================*/

typedef struct com20020_dev_t {
struct com20020_dev {
struct net_device *dev;
} com20020_dev_t;
};

static int com20020_probe(struct pcmcia_device *p_dev)
{
com20020_dev_t *info;
struct com20020_dev *info;
struct net_device *dev;
struct arcnet_local *lp;

dev_dbg(&p_dev->dev, "com20020_attach()\n");

/* Create new network device */
info = kzalloc(sizeof(struct com20020_dev_t), GFP_KERNEL);
info = kzalloc(sizeof(*info), GFP_KERNEL);
if (!info)
goto fail_alloc_info;

Expand Down Expand Up @@ -160,7 +160,7 @@ static int com20020_probe(struct pcmcia_device *p_dev)

static void com20020_detach(struct pcmcia_device *link)
{
struct com20020_dev_t *info = link->priv;
struct com20020_dev *info = link->priv;
struct net_device *dev = info->dev;

dev_dbg(&link->dev, "detach...\n");
Expand Down Expand Up @@ -199,7 +199,7 @@ static void com20020_detach(struct pcmcia_device *link)
static int com20020_config(struct pcmcia_device *link)
{
struct arcnet_local *lp;
com20020_dev_t *info;
struct com20020_dev *info;
struct net_device *dev;
int i, ret;
int ioaddr;
Expand Down Expand Up @@ -291,7 +291,7 @@ static void com20020_release(struct pcmcia_device *link)

static int com20020_suspend(struct pcmcia_device *link)
{
com20020_dev_t *info = link->priv;
struct com20020_dev *info = link->priv;
struct net_device *dev = info->dev;

if (link->open)
Expand All @@ -302,7 +302,7 @@ static int com20020_suspend(struct pcmcia_device *link)

static int com20020_resume(struct pcmcia_device *link)
{
com20020_dev_t *info = link->priv;
struct com20020_dev *info = link->priv;
struct net_device *dev = info->dev;

if (link->open) {
Expand Down

0 comments on commit 2dfd253

Please sign in to comment.