Skip to content

Commit

Permalink
ethernet: amd: Remove typedef local_info_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 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: 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 0d5501c commit f865346
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions drivers/net/ethernet/xircom/xirc2ps_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ static void xirc2ps_detach(struct pcmcia_device *p_dev);

static irqreturn_t xirc2ps_interrupt(int irq, void *dev_id);

typedef struct local_info_t {
struct local_info {
struct net_device *dev;
struct pcmcia_device *p_dev;

Expand All @@ -281,7 +281,7 @@ typedef struct local_info_t {
unsigned last_ptr_value; /* last packets transmitted value */
const char *manf_str;
struct work_struct tx_timeout_task;
} local_info_t;
};

/****************
* Some more prototypes
Expand Down Expand Up @@ -475,12 +475,12 @@ static int
xirc2ps_probe(struct pcmcia_device *link)
{
struct net_device *dev;
local_info_t *local;
struct local_info *local;

dev_dbg(&link->dev, "attach()\n");

/* Allocate the device structure */
dev = alloc_etherdev(sizeof(local_info_t));
dev = alloc_etherdev(sizeof(struct local_info));
if (!dev)
return -ENOMEM;
local = netdev_priv(dev);
Expand Down Expand Up @@ -536,7 +536,7 @@ static int
set_card_type(struct pcmcia_device *link)
{
struct net_device *dev = link->priv;
local_info_t *local = netdev_priv(dev);
struct local_info *local = netdev_priv(dev);
u8 *buf;
unsigned int cisrev, mediaid, prodid;
size_t len;
Expand Down Expand Up @@ -690,7 +690,7 @@ static int
xirc2ps_config(struct pcmcia_device * link)
{
struct net_device *dev = link->priv;
local_info_t *local = netdev_priv(dev);
struct local_info *local = netdev_priv(dev);
unsigned int ioaddr;
int err;
u8 *buf;
Expand Down Expand Up @@ -931,7 +931,7 @@ xirc2ps_release(struct pcmcia_device *link)

if (link->resource[2]->end) {
struct net_device *dev = link->priv;
local_info_t *local = netdev_priv(dev);
struct local_info *local = netdev_priv(dev);
if (local->dingo)
iounmap(local->dingo_ccr - 0x0800);
}
Expand Down Expand Up @@ -975,7 +975,7 @@ static irqreturn_t
xirc2ps_interrupt(int irq, void *dev_id)
{
struct net_device *dev = (struct net_device *)dev_id;
local_info_t *lp = netdev_priv(dev);
struct local_info *lp = netdev_priv(dev);
unsigned int ioaddr;
u_char saved_page;
unsigned bytes_rcvd;
Expand Down Expand Up @@ -1194,8 +1194,8 @@ xirc2ps_interrupt(int irq, void *dev_id)
static void
xirc2ps_tx_timeout_task(struct work_struct *work)
{
local_info_t *local =
container_of(work, local_info_t, tx_timeout_task);
struct local_info *local =
container_of(work, struct local_info, tx_timeout_task);
struct net_device *dev = local->dev;
/* reset the card */
do_reset(dev,1);
Expand All @@ -1206,7 +1206,7 @@ xirc2ps_tx_timeout_task(struct work_struct *work)
static void
xirc_tx_timeout(struct net_device *dev)
{
local_info_t *lp = netdev_priv(dev);
struct local_info *lp = netdev_priv(dev);
dev->stats.tx_errors++;
netdev_notice(dev, "transmit timed out\n");
schedule_work(&lp->tx_timeout_task);
Expand All @@ -1215,7 +1215,7 @@ xirc_tx_timeout(struct net_device *dev)
static netdev_tx_t
do_start_xmit(struct sk_buff *skb, struct net_device *dev)
{
local_info_t *lp = netdev_priv(dev);
struct local_info *lp = netdev_priv(dev);
unsigned int ioaddr = dev->base_addr;
int okay;
unsigned freespace;
Expand Down Expand Up @@ -1300,7 +1300,7 @@ static void set_address(struct set_address_info *sa_info, char *addr)
static void set_addresses(struct net_device *dev)
{
unsigned int ioaddr = dev->base_addr;
local_info_t *lp = netdev_priv(dev);
struct local_info *lp = netdev_priv(dev);
struct netdev_hw_addr *ha;
struct set_address_info sa_info;
int i;
Expand Down Expand Up @@ -1362,7 +1362,7 @@ set_multicast_list(struct net_device *dev)
static int
do_config(struct net_device *dev, struct ifmap *map)
{
local_info_t *local = netdev_priv(dev);
struct local_info *local = netdev_priv(dev);

pr_debug("do_config(%p)\n", dev);
if (map->port != 255 && map->port != dev->if_port) {
Expand All @@ -1387,7 +1387,7 @@ do_config(struct net_device *dev, struct ifmap *map)
static int
do_open(struct net_device *dev)
{
local_info_t *lp = netdev_priv(dev);
struct local_info *lp = netdev_priv(dev);
struct pcmcia_device *link = lp->p_dev;

dev_dbg(&link->dev, "do_open(%p)\n", dev);
Expand Down Expand Up @@ -1421,7 +1421,7 @@ static const struct ethtool_ops netdev_ethtool_ops = {
static int
do_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
{
local_info_t *local = netdev_priv(dev);
struct local_info *local = netdev_priv(dev);
unsigned int ioaddr = dev->base_addr;
struct mii_ioctl_data *data = if_mii(rq);

Expand Down Expand Up @@ -1453,7 +1453,7 @@ do_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
static void
hardreset(struct net_device *dev)
{
local_info_t *local = netdev_priv(dev);
struct local_info *local = netdev_priv(dev);
unsigned int ioaddr = dev->base_addr;

SelectPage(4);
Expand All @@ -1470,7 +1470,7 @@ hardreset(struct net_device *dev)
static void
do_reset(struct net_device *dev, int full)
{
local_info_t *local = netdev_priv(dev);
struct local_info *local = netdev_priv(dev);
unsigned int ioaddr = dev->base_addr;
unsigned value;

Expand Down Expand Up @@ -1631,7 +1631,7 @@ do_reset(struct net_device *dev, int full)
static int
init_mii(struct net_device *dev)
{
local_info_t *local = netdev_priv(dev);
struct local_info *local = netdev_priv(dev);
unsigned int ioaddr = dev->base_addr;
unsigned control, status, linkpartner;
int i;
Expand Down Expand Up @@ -1715,7 +1715,7 @@ static int
do_stop(struct net_device *dev)
{
unsigned int ioaddr = dev->base_addr;
local_info_t *lp = netdev_priv(dev);
struct local_info *lp = netdev_priv(dev);
struct pcmcia_device *link = lp->p_dev;

dev_dbg(&link->dev, "do_stop(%p)\n", dev);
Expand Down

0 comments on commit f865346

Please sign in to comment.