diff options
author | Larry Finger <Larry.Finger@lwfinger.net> | 2009-04-18 22:09:08 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-05-08 22:39:27 -0400 |
commit | be286fd229e95658516ddf880054ea3c9ad9bb34 (patch) | |
tree | 9e615c1889fcab2d1d1408ff80014c2b4fc74db9 | |
parent | a9ed12e5c149b05adf13bea5f1e96d68c2127faf (diff) |
Staging: rtl8187se: Fix compilation warnings and procfs directory leak
Fix some warnings during compilation and correct a programming error
that was leaking a directory in /proc.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Tested-by: Bernhard Schiffner <bernhard@schiffner-limbach.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | drivers/staging/rtl8187se/r8180.h | 2 | ||||
-rw-r--r-- | drivers/staging/rtl8187se/r8180_core.c | 46 |
2 files changed, 9 insertions, 39 deletions
diff --git a/drivers/staging/rtl8187se/r8180.h b/drivers/staging/rtl8187se/r8180.h index 12215fc61ddc..db446b7e2e08 100644 --- a/drivers/staging/rtl8187se/r8180.h +++ b/drivers/staging/rtl8187se/r8180.h | |||
@@ -19,7 +19,7 @@ | |||
19 | #define R8180H | 19 | #define R8180H |
20 | 20 | ||
21 | 21 | ||
22 | #define RTL8180_MODULE_NAME "rtl8180" | 22 | #define RTL8180_MODULE_NAME "r8180" |
23 | #define DMESG(x,a...) printk(KERN_INFO RTL8180_MODULE_NAME ": " x "\n", ## a) | 23 | #define DMESG(x,a...) printk(KERN_INFO RTL8180_MODULE_NAME ": " x "\n", ## a) |
24 | #define DMESGW(x,a...) printk(KERN_WARNING RTL8180_MODULE_NAME ": WW:" x "\n", ## a) | 24 | #define DMESGW(x,a...) printk(KERN_WARNING RTL8180_MODULE_NAME ": WW:" x "\n", ## a) |
25 | #define DMESGE(x,a...) printk(KERN_WARNING RTL8180_MODULE_NAME ": EE:" x "\n", ## a) | 25 | #define DMESGE(x,a...) printk(KERN_WARNING RTL8180_MODULE_NAME ": EE:" x "\n", ## a) |
diff --git a/drivers/staging/rtl8187se/r8180_core.c b/drivers/staging/rtl8187se/r8180_core.c index 6ecd12de4296..e10413cee0df 100644 --- a/drivers/staging/rtl8187se/r8180_core.c +++ b/drivers/staging/rtl8187se/r8180_core.c | |||
@@ -640,11 +640,9 @@ void rtl8180_proc_init_one(struct net_device *dev) | |||
640 | { | 640 | { |
641 | struct proc_dir_entry *e; | 641 | struct proc_dir_entry *e; |
642 | struct r8180_priv *priv = (struct r8180_priv *)ieee80211_priv(dev); | 642 | struct r8180_priv *priv = (struct r8180_priv *)ieee80211_priv(dev); |
643 | priv->dir_dev = create_proc_entry(dev->name, | 643 | priv->dir_dev = rtl8180_proc; |
644 | S_IFDIR | S_IRUGO | S_IXUGO, | ||
645 | rtl8180_proc); | ||
646 | if (!priv->dir_dev) { | 644 | if (!priv->dir_dev) { |
647 | DMESGE("Unable to initialize /proc/net/rtl8180/%s\n", | 645 | DMESGE("Unable to initialize /proc/net/r8180/%s\n", |
648 | dev->name); | 646 | dev->name); |
649 | return; | 647 | return; |
650 | } | 648 | } |
@@ -654,7 +652,7 @@ void rtl8180_proc_init_one(struct net_device *dev) | |||
654 | 652 | ||
655 | if (!e) { | 653 | if (!e) { |
656 | DMESGE("Unable to initialize " | 654 | DMESGE("Unable to initialize " |
657 | "/proc/net/rtl8180/%s/stats-hw\n", | 655 | "/proc/net/r8180/%s/stats-hw\n", |
658 | dev->name); | 656 | dev->name); |
659 | } | 657 | } |
660 | 658 | ||
@@ -663,7 +661,7 @@ void rtl8180_proc_init_one(struct net_device *dev) | |||
663 | 661 | ||
664 | if (!e) { | 662 | if (!e) { |
665 | DMESGE("Unable to initialize " | 663 | DMESGE("Unable to initialize " |
666 | "/proc/net/rtl8180/%s/stats-rx\n", | 664 | "/proc/net/r8180/%s/stats-rx\n", |
667 | dev->name); | 665 | dev->name); |
668 | } | 666 | } |
669 | 667 | ||
@@ -673,7 +671,7 @@ void rtl8180_proc_init_one(struct net_device *dev) | |||
673 | 671 | ||
674 | if (!e) { | 672 | if (!e) { |
675 | DMESGE("Unable to initialize " | 673 | DMESGE("Unable to initialize " |
676 | "/proc/net/rtl8180/%s/stats-tx\n", | 674 | "/proc/net/r8180/%s/stats-tx\n", |
677 | dev->name); | 675 | dev->name); |
678 | } | 676 | } |
679 | #if 0 | 677 | #if 0 |
@@ -702,7 +700,7 @@ void rtl8180_proc_init_one(struct net_device *dev) | |||
702 | 700 | ||
703 | if (!e) { | 701 | if (!e) { |
704 | DMESGE("Unable to initialize " | 702 | DMESGE("Unable to initialize " |
705 | "/proc/net/rtl8180/%s/registers\n", | 703 | "/proc/net/r8180/%s/registers\n", |
706 | dev->name); | 704 | dev->name); |
707 | } | 705 | } |
708 | } | 706 | } |
@@ -977,13 +975,6 @@ void check_tx_ring(struct net_device *dev, int pri) | |||
977 | *tmp & (1<<15)? "ok": "err", *(tmp+4)); | 975 | *tmp & (1<<15)? "ok": "err", *(tmp+4)); |
978 | } | 976 | } |
979 | 977 | ||
980 | DMESG("nic at %d", | ||
981 | (nic-nicbegin) / 8 /4); | ||
982 | DMESG("tail at %d", ((int)tail - (int)begin) /8 /4); | ||
983 | DMESG("head at %d", ((int)head - (int)begin) /8 /4); | ||
984 | DMESG("check free desc returns %d", check_nic_enought_desc(dev,pri)); | ||
985 | DMESG("free desc is %d\n", get_curr_tx_free_desc(dev,pri)); | ||
986 | //rtl8180_reset(dev); | ||
987 | return; | 978 | return; |
988 | } | 979 | } |
989 | 980 | ||
@@ -1736,17 +1727,7 @@ short alloc_tx_desc_ring(struct net_device *dev, int bufsize, int count, | |||
1736 | * descriptor's buffer must be 256 byte aligned | 1727 | * descriptor's buffer must be 256 byte aligned |
1737 | * we shouldn't be here, since we set DMA mask ! | 1728 | * we shouldn't be here, since we set DMA mask ! |
1738 | */ | 1729 | */ |
1739 | DMESGW("Fixing TX alignment"); | 1730 | WARN(1, "DMA buffer is not aligned\n"); |
1740 | desc = (u32*)((u8*)desc + 256); | ||
1741 | #if (defined(CONFIG_HIGHMEM64G) || defined(CONFIG_64BIT_PHYS_ADDR)) | ||
1742 | desc = (u32*)((u64)desc &~ 0xff); | ||
1743 | dma_desc = (dma_addr_t)((u8*)dma_desc + 256); | ||
1744 | dma_desc = (dma_addr_t)((u64)dma_desc &~ 0xff); | ||
1745 | #else | ||
1746 | desc = (u32*)((u32)desc &~ 0xff); | ||
1747 | dma_desc = (dma_addr_t)((u8*)dma_desc + 256); | ||
1748 | dma_desc = (dma_addr_t)((u32)dma_desc &~ 0xff); | ||
1749 | #endif | ||
1750 | } | 1731 | } |
1751 | tmp=desc; | 1732 | tmp=desc; |
1752 | for (i=0;i<count;i++) | 1733 | for (i=0;i<count;i++) |
@@ -1984,18 +1965,7 @@ short alloc_rx_desc_ring(struct net_device *dev, u16 bufsize, int count) | |||
1984 | * descriptor's buffer must be 256 byte aligned | 1965 | * descriptor's buffer must be 256 byte aligned |
1985 | * should never happen since we specify the DMA mask | 1966 | * should never happen since we specify the DMA mask |
1986 | */ | 1967 | */ |
1987 | 1968 | WARN(1, "DMA buffer is not aligned\n"); | |
1988 | DMESGW("Fixing RX alignment"); | ||
1989 | desc = (u32*)((u8*)desc + 256); | ||
1990 | #if (defined(CONFIG_HIGHMEM64G) || defined(CONFIG_64BIT_PHYS_ADDR)) | ||
1991 | desc = (u32*)((u64)desc &~ 0xff); | ||
1992 | dma_desc = (dma_addr_t)((u8*)dma_desc + 256); | ||
1993 | dma_desc = (dma_addr_t)((u64)dma_desc &~ 0xff); | ||
1994 | #else | ||
1995 | desc = (u32*)((u32)desc &~ 0xff); | ||
1996 | dma_desc = (dma_addr_t)((u8*)dma_desc + 256); | ||
1997 | dma_desc = (dma_addr_t)((u32)dma_desc &~ 0xff); | ||
1998 | #endif | ||
1999 | } | 1969 | } |
2000 | 1970 | ||
2001 | priv->rxring=desc; | 1971 | priv->rxring=desc; |