aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/8390
diff options
context:
space:
mode:
authorHimangi Saraogi <himangi774@gmail.com>2014-08-07 16:40:39 -0400
committerDavid S. Miller <davem@davemloft.net>2014-08-07 19:02:58 -0400
commit250b2dd44929ec03077100b6ae2906800e4f744f (patch)
tree6422a32e519cab0f825d2756a8b9bf6e4a18ed6d /drivers/net/ethernet/8390
parentf073d52d63e01f4ac40105c63995a84930c2ee96 (diff)
drivers/net: Remove typedefs pcnet_dev_t and hw_info_t
The Linux kernel coding style guidelines suggest not using typedefs for structure types. This patch gets rid of the typedefs for pcnet_dev_t and hw_info_t. Also, the name of the structs is changed to drop the _t, to make the name look less typedef-like. The following Coccinelle semantic patch detects the cases: @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>
Diffstat (limited to 'drivers/net/ethernet/8390')
-rw-r--r--drivers/net/ethernet/8390/pcnet_cs.c68
1 files changed, 34 insertions, 34 deletions
diff --git a/drivers/net/ethernet/8390/pcnet_cs.c b/drivers/net/ethernet/8390/pcnet_cs.c
index ca3c2b921cf6..9fb7b9d4fd6c 100644
--- a/drivers/net/ethernet/8390/pcnet_cs.c
+++ b/drivers/net/ethernet/8390/pcnet_cs.c
@@ -111,11 +111,11 @@ static void pcnet_detach(struct pcmcia_device *p_dev);
111 111
112/*====================================================================*/ 112/*====================================================================*/
113 113
114typedef struct hw_info_t { 114struct hw_info {
115 u_int offset; 115 u_int offset;
116 u_char a0, a1, a2; 116 u_char a0, a1, a2;
117 u_int flags; 117 u_int flags;
118} hw_info_t; 118};
119 119
120#define DELAY_OUTPUT 0x01 120#define DELAY_OUTPUT 0x01
121#define HAS_MISC_REG 0x02 121#define HAS_MISC_REG 0x02
@@ -132,7 +132,7 @@ typedef struct hw_info_t {
132#define MII_PHYID_REG1 0x02 132#define MII_PHYID_REG1 0x02
133#define MII_PHYID_REG2 0x03 133#define MII_PHYID_REG2 0x03
134 134
135static hw_info_t hw_info[] = { 135static struct hw_info hw_info[] = {
136 { /* Accton EN2212 */ 0x0ff0, 0x00, 0x00, 0xe8, DELAY_OUTPUT }, 136 { /* Accton EN2212 */ 0x0ff0, 0x00, 0x00, 0xe8, DELAY_OUTPUT },
137 { /* Allied Telesis LA-PCM */ 0x0ff0, 0x00, 0x00, 0xf4, 0 }, 137 { /* Allied Telesis LA-PCM */ 0x0ff0, 0x00, 0x00, 0xf4, 0 },
138 { /* APEX MultiCard */ 0x03f4, 0x00, 0x20, 0xe5, 0 }, 138 { /* APEX MultiCard */ 0x03f4, 0x00, 0x20, 0xe5, 0 },
@@ -196,11 +196,11 @@ static hw_info_t hw_info[] = {
196 196
197#define NR_INFO ARRAY_SIZE(hw_info) 197#define NR_INFO ARRAY_SIZE(hw_info)
198 198
199static hw_info_t default_info = { 0, 0, 0, 0, 0 }; 199static struct hw_info default_info = { 0, 0, 0, 0, 0 };
200static hw_info_t dl10019_info = { 0, 0, 0, 0, IS_DL10019|HAS_MII }; 200static struct hw_info dl10019_info = { 0, 0, 0, 0, IS_DL10019|HAS_MII };
201static hw_info_t dl10022_info = { 0, 0, 0, 0, IS_DL10022|HAS_MII }; 201static struct hw_info dl10022_info = { 0, 0, 0, 0, IS_DL10022|HAS_MII };
202 202
203typedef struct pcnet_dev_t { 203struct pcnet_dev {
204 struct pcmcia_device *p_dev; 204 struct pcmcia_device *p_dev;
205 u_int flags; 205 u_int flags;
206 void __iomem *base; 206 void __iomem *base;
@@ -210,12 +210,12 @@ typedef struct pcnet_dev_t {
210 u_char eth_phy, pna_phy; 210 u_char eth_phy, pna_phy;
211 u_short link_status; 211 u_short link_status;
212 u_long mii_reset; 212 u_long mii_reset;
213} pcnet_dev_t; 213};
214 214
215static inline pcnet_dev_t *PRIV(struct net_device *dev) 215static inline struct pcnet_dev *PRIV(struct net_device *dev)
216{ 216{
217 char *p = netdev_priv(dev); 217 char *p = netdev_priv(dev);
218 return (pcnet_dev_t *)(p + sizeof(struct ei_device)); 218 return (struct pcnet_dev *)(p + sizeof(struct ei_device));
219} 219}
220 220
221static const struct net_device_ops pcnet_netdev_ops = { 221static const struct net_device_ops pcnet_netdev_ops = {
@@ -237,13 +237,13 @@ static const struct net_device_ops pcnet_netdev_ops = {
237 237
238static int pcnet_probe(struct pcmcia_device *link) 238static int pcnet_probe(struct pcmcia_device *link)
239{ 239{
240 pcnet_dev_t *info; 240 struct pcnet_dev *info;
241 struct net_device *dev; 241 struct net_device *dev;
242 242
243 dev_dbg(&link->dev, "pcnet_attach()\n"); 243 dev_dbg(&link->dev, "pcnet_attach()\n");
244 244
245 /* Create new ethernet device */ 245 /* Create new ethernet device */
246 dev = __alloc_ei_netdev(sizeof(pcnet_dev_t)); 246 dev = __alloc_ei_netdev(sizeof(struct pcnet_dev));
247 if (!dev) return -ENOMEM; 247 if (!dev) return -ENOMEM;
248 info = PRIV(dev); 248 info = PRIV(dev);
249 info->p_dev = link; 249 info->p_dev = link;
@@ -276,7 +276,7 @@ static void pcnet_detach(struct pcmcia_device *link)
276 276
277======================================================================*/ 277======================================================================*/
278 278
279static hw_info_t *get_hwinfo(struct pcmcia_device *link) 279static struct hw_info *get_hwinfo(struct pcmcia_device *link)
280{ 280{
281 struct net_device *dev = link->priv; 281 struct net_device *dev = link->priv;
282 u_char __iomem *base, *virt; 282 u_char __iomem *base, *virt;
@@ -317,7 +317,7 @@ static hw_info_t *get_hwinfo(struct pcmcia_device *link)
317 317
318======================================================================*/ 318======================================================================*/
319 319
320static hw_info_t *get_prom(struct pcmcia_device *link) 320static struct hw_info *get_prom(struct pcmcia_device *link)
321{ 321{
322 struct net_device *dev = link->priv; 322 struct net_device *dev = link->priv;
323 unsigned int ioaddr = dev->base_addr; 323 unsigned int ioaddr = dev->base_addr;
@@ -371,7 +371,7 @@ static hw_info_t *get_prom(struct pcmcia_device *link)
371 371
372======================================================================*/ 372======================================================================*/
373 373
374static hw_info_t *get_dl10019(struct pcmcia_device *link) 374static struct hw_info *get_dl10019(struct pcmcia_device *link)
375{ 375{
376 struct net_device *dev = link->priv; 376 struct net_device *dev = link->priv;
377 int i; 377 int i;
@@ -393,7 +393,7 @@ static hw_info_t *get_dl10019(struct pcmcia_device *link)
393 393
394======================================================================*/ 394======================================================================*/
395 395
396static hw_info_t *get_ax88190(struct pcmcia_device *link) 396static struct hw_info *get_ax88190(struct pcmcia_device *link)
397{ 397{
398 struct net_device *dev = link->priv; 398 struct net_device *dev = link->priv;
399 unsigned int ioaddr = dev->base_addr; 399 unsigned int ioaddr = dev->base_addr;
@@ -424,7 +424,7 @@ static hw_info_t *get_ax88190(struct pcmcia_device *link)
424 424
425======================================================================*/ 425======================================================================*/
426 426
427static hw_info_t *get_hwired(struct pcmcia_device *link) 427static struct hw_info *get_hwired(struct pcmcia_device *link)
428{ 428{
429 struct net_device *dev = link->priv; 429 struct net_device *dev = link->priv;
430 int i; 430 int i;
@@ -489,12 +489,12 @@ static int pcnet_confcheck(struct pcmcia_device *p_dev, void *priv_data)
489 return try_io_port(p_dev); 489 return try_io_port(p_dev);
490} 490}
491 491
492static hw_info_t *pcnet_try_config(struct pcmcia_device *link, 492static struct hw_info *pcnet_try_config(struct pcmcia_device *link,
493 int *has_shmem, int try) 493 int *has_shmem, int try)
494{ 494{
495 struct net_device *dev = link->priv; 495 struct net_device *dev = link->priv;
496 hw_info_t *local_hw_info; 496 struct hw_info *local_hw_info;
497 pcnet_dev_t *info = PRIV(dev); 497 struct pcnet_dev *info = PRIV(dev);
498 int priv = try; 498 int priv = try;
499 int ret; 499 int ret;
500 500
@@ -553,10 +553,10 @@ static hw_info_t *pcnet_try_config(struct pcmcia_device *link,
553static int pcnet_config(struct pcmcia_device *link) 553static int pcnet_config(struct pcmcia_device *link)
554{ 554{
555 struct net_device *dev = link->priv; 555 struct net_device *dev = link->priv;
556 pcnet_dev_t *info = PRIV(dev); 556 struct pcnet_dev *info = PRIV(dev);
557 int start_pg, stop_pg, cm_offset; 557 int start_pg, stop_pg, cm_offset;
558 int has_shmem = 0; 558 int has_shmem = 0;
559 hw_info_t *local_hw_info; 559 struct hw_info *local_hw_info;
560 struct ei_device *ei_local; 560 struct ei_device *ei_local;
561 561
562 dev_dbg(&link->dev, "pcnet_config\n"); 562 dev_dbg(&link->dev, "pcnet_config\n");
@@ -639,7 +639,7 @@ failed:
639 639
640static void pcnet_release(struct pcmcia_device *link) 640static void pcnet_release(struct pcmcia_device *link)
641{ 641{
642 pcnet_dev_t *info = PRIV(link->priv); 642 struct pcnet_dev *info = PRIV(link->priv);
643 643
644 dev_dbg(&link->dev, "pcnet_release\n"); 644 dev_dbg(&link->dev, "pcnet_release\n");
645 645
@@ -836,7 +836,7 @@ static void write_asic(unsigned int ioaddr, int location, short asic_data)
836static void set_misc_reg(struct net_device *dev) 836static void set_misc_reg(struct net_device *dev)
837{ 837{
838 unsigned int nic_base = dev->base_addr; 838 unsigned int nic_base = dev->base_addr;
839 pcnet_dev_t *info = PRIV(dev); 839 struct pcnet_dev *info = PRIV(dev);
840 u_char tmp; 840 u_char tmp;
841 841
842 if (info->flags & HAS_MISC_REG) { 842 if (info->flags & HAS_MISC_REG) {
@@ -873,7 +873,7 @@ static void set_misc_reg(struct net_device *dev)
873 873
874static void mii_phy_probe(struct net_device *dev) 874static void mii_phy_probe(struct net_device *dev)
875{ 875{
876 pcnet_dev_t *info = PRIV(dev); 876 struct pcnet_dev *info = PRIV(dev);
877 unsigned int mii_addr = dev->base_addr + DLINK_GPIO; 877 unsigned int mii_addr = dev->base_addr + DLINK_GPIO;
878 int i; 878 int i;
879 u_int tmp, phyid; 879 u_int tmp, phyid;
@@ -898,7 +898,7 @@ static void mii_phy_probe(struct net_device *dev)
898static int pcnet_open(struct net_device *dev) 898static int pcnet_open(struct net_device *dev)
899{ 899{
900 int ret; 900 int ret;
901 pcnet_dev_t *info = PRIV(dev); 901 struct pcnet_dev *info = PRIV(dev);
902 struct pcmcia_device *link = info->p_dev; 902 struct pcmcia_device *link = info->p_dev;
903 unsigned int nic_base = dev->base_addr; 903 unsigned int nic_base = dev->base_addr;
904 904
@@ -931,7 +931,7 @@ static int pcnet_open(struct net_device *dev)
931 931
932static int pcnet_close(struct net_device *dev) 932static int pcnet_close(struct net_device *dev)
933{ 933{
934 pcnet_dev_t *info = PRIV(dev); 934 struct pcnet_dev *info = PRIV(dev);
935 struct pcmcia_device *link = info->p_dev; 935 struct pcmcia_device *link = info->p_dev;
936 936
937 dev_dbg(&link->dev, "pcnet_close('%s')\n", dev->name); 937 dev_dbg(&link->dev, "pcnet_close('%s')\n", dev->name);
@@ -982,7 +982,7 @@ static void pcnet_reset_8390(struct net_device *dev)
982 982
983static int set_config(struct net_device *dev, struct ifmap *map) 983static int set_config(struct net_device *dev, struct ifmap *map)
984{ 984{
985 pcnet_dev_t *info = PRIV(dev); 985 struct pcnet_dev *info = PRIV(dev);
986 if ((map->port != (u_char)(-1)) && (map->port != dev->if_port)) { 986 if ((map->port != (u_char)(-1)) && (map->port != dev->if_port)) {
987 if (!(info->flags & HAS_MISC_REG)) 987 if (!(info->flags & HAS_MISC_REG))
988 return -EOPNOTSUPP; 988 return -EOPNOTSUPP;
@@ -1000,7 +1000,7 @@ static int set_config(struct net_device *dev, struct ifmap *map)
1000static irqreturn_t ei_irq_wrapper(int irq, void *dev_id) 1000static irqreturn_t ei_irq_wrapper(int irq, void *dev_id)
1001{ 1001{
1002 struct net_device *dev = dev_id; 1002 struct net_device *dev = dev_id;
1003 pcnet_dev_t *info; 1003 struct pcnet_dev *info;
1004 irqreturn_t ret = ei_interrupt(irq, dev_id); 1004 irqreturn_t ret = ei_interrupt(irq, dev_id);
1005 1005
1006 if (ret == IRQ_HANDLED) { 1006 if (ret == IRQ_HANDLED) {
@@ -1013,7 +1013,7 @@ static irqreturn_t ei_irq_wrapper(int irq, void *dev_id)
1013static void ei_watchdog(u_long arg) 1013static void ei_watchdog(u_long arg)
1014{ 1014{
1015 struct net_device *dev = (struct net_device *)arg; 1015 struct net_device *dev = (struct net_device *)arg;
1016 pcnet_dev_t *info = PRIV(dev); 1016 struct pcnet_dev *info = PRIV(dev);
1017 unsigned int nic_base = dev->base_addr; 1017 unsigned int nic_base = dev->base_addr;
1018 unsigned int mii_addr = nic_base + DLINK_GPIO; 1018 unsigned int mii_addr = nic_base + DLINK_GPIO;
1019 u_short link; 1019 u_short link;
@@ -1101,7 +1101,7 @@ reschedule:
1101 1101
1102static int ei_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) 1102static int ei_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
1103{ 1103{
1104 pcnet_dev_t *info = PRIV(dev); 1104 struct pcnet_dev *info = PRIV(dev);
1105 struct mii_ioctl_data *data = if_mii(rq); 1105 struct mii_ioctl_data *data = if_mii(rq);
1106 unsigned int mii_addr = dev->base_addr + DLINK_GPIO; 1106 unsigned int mii_addr = dev->base_addr + DLINK_GPIO;
1107 1107
@@ -1214,7 +1214,7 @@ static void dma_block_output(struct net_device *dev, int count,
1214 const u_char *buf, const int start_page) 1214 const u_char *buf, const int start_page)
1215{ 1215{
1216 unsigned int nic_base = dev->base_addr; 1216 unsigned int nic_base = dev->base_addr;
1217 pcnet_dev_t *info = PRIV(dev); 1217 struct pcnet_dev *info = PRIV(dev);
1218#ifdef PCMCIA_DEBUG 1218#ifdef PCMCIA_DEBUG
1219 int retries = 0; 1219 int retries = 0;
1220 struct ei_device *ei_local = netdev_priv(dev); 1220 struct ei_device *ei_local = netdev_priv(dev);
@@ -1403,7 +1403,7 @@ static int setup_shmem_window(struct pcmcia_device *link, int start_pg,
1403 int stop_pg, int cm_offset) 1403 int stop_pg, int cm_offset)
1404{ 1404{
1405 struct net_device *dev = link->priv; 1405 struct net_device *dev = link->priv;
1406 pcnet_dev_t *info = PRIV(dev); 1406 struct pcnet_dev *info = PRIV(dev);
1407 int i, window_size, offset, ret; 1407 int i, window_size, offset, ret;
1408 1408
1409 window_size = (stop_pg - start_pg) << 8; 1409 window_size = (stop_pg - start_pg) << 8;