Skip to content

Commit

Permalink
drivers/net: Remove typedef axnet_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 axnet_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 7, 2014
1 parent 250b2dd commit abac0d3
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions drivers/net/ethernet/8390/axnet_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ static u32 axnet_msg_enable;

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

typedef struct axnet_dev_t {
struct axnet_dev {
struct pcmcia_device *p_dev;
caddr_t base;
struct timer_list watchdog;
Expand All @@ -118,9 +118,9 @@ typedef struct axnet_dev_t {
int phy_id;
int flags;
int active_low;
} axnet_dev_t;
};

static inline axnet_dev_t *PRIV(struct net_device *dev)
static inline struct axnet_dev *PRIV(struct net_device *dev)
{
void *p = (char *)netdev_priv(dev) + sizeof(struct ei_device);
return p;
Expand All @@ -141,13 +141,13 @@ static const struct net_device_ops axnet_netdev_ops = {

static int axnet_probe(struct pcmcia_device *link)
{
axnet_dev_t *info;
struct axnet_dev *info;
struct net_device *dev;
struct ei_device *ei_local;

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

dev = alloc_etherdev(sizeof(struct ei_device) + sizeof(axnet_dev_t));
dev = alloc_etherdev(sizeof(struct ei_device) + sizeof(struct axnet_dev));
if (!dev)
return -ENOMEM;

Expand Down Expand Up @@ -274,7 +274,7 @@ static int axnet_configcheck(struct pcmcia_device *p_dev, void *priv_data)
static int axnet_config(struct pcmcia_device *link)
{
struct net_device *dev = link->priv;
axnet_dev_t *info = PRIV(dev);
struct axnet_dev *info = PRIV(dev);
int i, j, j2, ret;

dev_dbg(&link->dev, "axnet_config(0x%p)\n", link);
Expand Down Expand Up @@ -389,7 +389,7 @@ static int axnet_suspend(struct pcmcia_device *link)
static int axnet_resume(struct pcmcia_device *link)
{
struct net_device *dev = link->priv;
axnet_dev_t *info = PRIV(dev);
struct axnet_dev *info = PRIV(dev);

if (link->open) {
if (info->active_low == 1)
Expand Down Expand Up @@ -467,7 +467,7 @@ static void mdio_write(unsigned int addr, int phy_id, int loc, int value)
static int axnet_open(struct net_device *dev)
{
int ret;
axnet_dev_t *info = PRIV(dev);
struct axnet_dev *info = PRIV(dev);
struct pcmcia_device *link = info->p_dev;
unsigned int nic_base = dev->base_addr;

Expand Down Expand Up @@ -497,7 +497,7 @@ static int axnet_open(struct net_device *dev)

static int axnet_close(struct net_device *dev)
{
axnet_dev_t *info = PRIV(dev);
struct axnet_dev *info = PRIV(dev);
struct pcmcia_device *link = info->p_dev;

dev_dbg(&link->dev, "axnet_close('%s')\n", dev->name);
Expand Down Expand Up @@ -554,7 +554,7 @@ static irqreturn_t ei_irq_wrapper(int irq, void *dev_id)
static void ei_watchdog(u_long arg)
{
struct net_device *dev = (struct net_device *)(arg);
axnet_dev_t *info = PRIV(dev);
struct axnet_dev *info = PRIV(dev);
unsigned int nic_base = dev->base_addr;
unsigned int mii_addr = nic_base + AXNET_MII_EEP;
u_short link;
Expand Down Expand Up @@ -610,7 +610,7 @@ static void ei_watchdog(u_long arg)

static int axnet_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
{
axnet_dev_t *info = PRIV(dev);
struct axnet_dev *info = PRIV(dev);
struct mii_ioctl_data *data = if_mii(rq);
unsigned int mii_addr = dev->base_addr + AXNET_MII_EEP;
switch (cmd) {
Expand Down Expand Up @@ -1452,7 +1452,7 @@ static void ei_receive(struct net_device *dev)

static void ei_rx_overrun(struct net_device *dev)
{
axnet_dev_t *info = PRIV(dev);
struct axnet_dev *info = PRIV(dev);
long e8390_base = dev->base_addr;
unsigned char was_txing, must_resend = 0;
struct ei_device *ei_local = netdev_priv(dev);
Expand Down Expand Up @@ -1624,7 +1624,7 @@ static void set_multicast_list(struct net_device *dev)

static void AX88190_init(struct net_device *dev, int startp)
{
axnet_dev_t *info = PRIV(dev);
struct axnet_dev *info = PRIV(dev);
long e8390_base = dev->base_addr;
struct ei_device *ei_local = netdev_priv(dev);
int i;
Expand Down

0 comments on commit abac0d3

Please sign in to comment.