Skip to contentSkip to conversation

rtl8192su build fixes and warning cleanups

PATCH New Jeff Mahoney 1 participant 6 messages Aug 4, 2009 Staging

lore
Share & tools
lore
#0 lore raw

cover rtl8192su build fixes and warning cleanups

Hi Greg -

Here are several patches to fix compilation and eliminate warnings for the rtl8192su driver.

Please apply.

Thanks.

-Jeff

Signature · 2 lines
Jeff Mahoney
SUSE Labs
#1 lore raw

PATCH 1/5 rtl8192su: compile fixes

This patch removes -fhard-float and the software float helpers. In-kernel floating point is not allowed.

---
 drivers/staging/rtl8192su/Makefile      |    1 -
 drivers/staging/rtl8192su/r8192U_core.c |   22 ++++++++--------------
 2 files changed, 8 insertions(+), 15 deletions(-)
drivers/staging/rtl8192su/Makefile +0 -1
@@ -2,7 +2,6 @@ NIC_SELECT = RTL8192SU
 
 EXTRA_CFLAGS += -std=gnu89
 EXTRA_CFLAGS += -O2
-EXTRA_CFLAGS += -mhard-float -DCONFIG_FORCE_HARD_FLOAT=y
 
 EXTRA_CFLAGS += -DJACKSON_NEW_RX
 EXTRA_CFLAGS += -DTHOMAS_BEACON -DTHOMAS_TURBO
drivers/staging/rtl8192su/r8192U_core.c +0 -8
@@ -24,14 +24,6 @@
  * Jerry chuang <[email protected]>
  */
 
-#ifndef CONFIG_FORCE_HARD_FLOAT
-double __floatsidf (int i) { return i; }
-unsigned int __fixunsdfsi (double d) { return d; }
-double __adddf3(double a, double b) { return a+b; }
-double __addsf3(float a, float b) { return a+b; }
-double __subdf3(double a, double b) { return a-b; }
-double __extendsfdf2(float a) {return a;}
-#endif
 
 #undef LOOP_TEST
 #undef DUMP_RX
#2 lore raw

PATCH 2/5 rtl8192su: fix up printk warnings

In reply to Jeff Mahoney

This patch addresses printk warnings.

---

 drivers/staging/rtl8192su/ieee80211/ieee80211_wx.c   |    2 +-
 drivers/staging/rtl8192su/ieee80211/rtl819x_BAProc.c |    6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)
drivers/staging/rtl8192su/ieee80211/ieee80211_wx.c +1 -1
@@ -987,7 +987,7 @@ int ieee80211_wx_set_gen_ie(struct ieee8
 	{
 		if (len != ie[1]+2)
 		{
-			printk("len:%d, ie:%d\n", len, ie[1]);
+			printk("len: %Zd, ie:%d\n", len, ie[1]);
 			return -EINVAL;
 		}
 		buf = kmalloc(len, GFP_KERNEL);
drivers/staging/rtl8192su/ieee80211/rtl819x_BAProc.c +3 -3
@@ -382,7 +382,7 @@ int ieee80211_rx_ADDBAReq( struct ieee80
 
 	if (skb->len < sizeof( struct ieee80211_hdr_3addr) + 9)
 	{
-		IEEE80211_DEBUG(IEEE80211_DL_ERR, " Invalid skb len in BAREQ(%d / %d)\n", skb->len, 	(sizeof( struct ieee80211_hdr_3addr) + 9));
+		IEEE80211_DEBUG(IEEE80211_DL_ERR, " Invalid skb len in BAREQ(%d / %ld)\n", skb->len, 	(sizeof( struct ieee80211_hdr_3addr) + 9));
 		return -1;
 	}
 
@@ -483,7 +483,7 @@ int ieee80211_rx_ADDBARsp( struct ieee80
 
 	if (skb->len < sizeof( struct ieee80211_hdr_3addr) + 9)
 	{
-		IEEE80211_DEBUG(IEEE80211_DL_ERR, " Invalid skb len in BARSP(%d / %d)\n", skb->len, 	(sizeof( struct ieee80211_hdr_3addr) + 9));
+		IEEE80211_DEBUG(IEEE80211_DL_ERR, " Invalid skb len in BARSP(%d / %ld)\n", skb->len, 	(sizeof( struct ieee80211_hdr_3addr) + 9));
 		return -1;
 	}
 	rsp = ( struct ieee80211_hdr_3addr*)skb->data;
@@ -613,7 +613,7 @@ int ieee80211_rx_DELBA(struct ieee80211_
 
 	if (skb->len < sizeof( struct ieee80211_hdr_3addr) + 6)
 	{
-		IEEE80211_DEBUG(IEEE80211_DL_ERR, " Invalid skb len in DELBA(%d / %d)\n", skb->len, 	(sizeof( struct ieee80211_hdr_3addr) + 6));
+		IEEE80211_DEBUG(IEEE80211_DL_ERR, " Invalid skb len in DELBA(%d / %ld)\n", skb->len, 	(sizeof( struct ieee80211_hdr_3addr) + 6));
 		return -1;
 	}
 
#3 lore raw

PATCH 3/5 rtl8192su: fixup size comparison warning

In reply to Jeff Mahoney

sizeof(val) returns type unsigned long. count is already unsigned long, so just use that. This fixes a compile warning.

---

 drivers/staging/rtl8192su/ieee80211/ieee80211_module.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8192su/ieee80211/ieee80211_module.c +1 -1
@@ -304,7 +304,7 @@ static int store_debug_level(struct file
 			     unsigned long count, void *data)
 {
 	char buf[] = "0x00000000";
-	unsigned long len = min(sizeof(buf) - 1, (u32)count);
+	unsigned long len = min(sizeof(buf) - 1, count);
 	char *p = (char *)buf;
 	unsigned long val;
 
#4 lore raw

PATCH 4/5 rtl8192su: stop using skb->tail

In reply to Jeff Mahoney

This patch replaces uses of skb->tail with skb_tail_pointer(skb).

---

 drivers/staging/rtl8192su/r8192U_core.c |   13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)
drivers/staging/rtl8192su/r8192U_core.c +7 -6
@@ -1715,7 +1708,7 @@ static int rtl8192_rx_initiate(struct ne
                 }
 //		printk("nomal packet IN request!\n");
                 usb_fill_bulk_urb(entry, priv->udev,
-                                  usb_rcvbulkpipe(priv->udev, 3), skb->tail,
+                                  usb_rcvbulkpipe(priv->udev, 3), skb_tail_pointer(skb),
                                   RX_URB_SIZE, rtl8192_rx_isr, skb);
                 info = (struct rtl8192_rx_info *) skb->cb;
                 info->urb = entry;
@@ -1745,7 +1738,7 @@ static int rtl8192_rx_initiate(struct ne
                         break;
                 }
                 usb_fill_bulk_urb(entry, priv->udev,
-                                  usb_rcvbulkpipe(priv->udev, 9), skb->tail,
+                                  usb_rcvbulkpipe(priv->udev, 9), skb_tail_pointer(skb),
                                   RX_URB_SIZE, rtl8192_rx_isr, skb);
                 info = (struct rtl8192_rx_info *) skb->cb;
                 info->urb = entry;
@@ -2135,7 +2128,8 @@ static void rtl8192_rx_isr(struct urb *u
         }
 
 	usb_fill_bulk_urb(urb, priv->udev,
-			usb_rcvbulkpipe(priv->udev, out_pipe), skb->tail,
+			usb_rcvbulkpipe(priv->udev, out_pipe),
+			skb_tail_pointer(skb),
 			RX_URB_SIZE, rtl8192_rx_isr, skb);
 
         info = (struct rtl8192_rx_info *) skb->cb;
@@ -2143,7 +2137,7 @@ static void rtl8192_rx_isr(struct urb *u
         info->dev = dev;
 	info->out_pipe = out_pipe;
 
-        urb->transfer_buffer = skb->tail;
+        urb->transfer_buffer = skb_tail_pointer(skb);
         urb->context = skb;
         skb_queue_tail(&priv->rx_queue, skb);
 #if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
@@ -2356,8 +2350,8 @@ struct sk_buff *DrvAggr_Aggregation(stru
 		/* Subframe drv Tx descriptor and firmware info setting */
 		skb = pSendList->tx_agg_frames[i];
 		tcb_desc = (cb_desc *)(skb->cb + MAX_DEV_ADDR_SIZE);
-		tx_agg_desc = (tx_desc_819x_usb_aggr_subframe *)agg_skb->tail;
-		tx_fwinfo = (tx_fwinfo_819x_usb *)(agg_skb->tail + sizeof(tx_desc_819x_usb_aggr_subframe));
+		tx_agg_desc = (tx_desc_819x_usb_aggr_subframe *)agg_skb_tail_pointer(skb);
+		tx_fwinfo = (tx_fwinfo_819x_usb *)(agg_skb_tail_pointer(skb) + sizeof(tx_desc_819x_usb_aggr_subframe));
 
 		memset(tx_fwinfo,0,sizeof(tx_fwinfo_819x_usb));
 		/* DWORD 0 */
#5 lore raw

PATCH 5/5 rtl8192su: add linux/vmalloc.h

In reply to Jeff Mahoney

Some arches don't provide vmalloc.h through the includes already included in rtl8192su. This patch adds it.

---

 drivers/staging/rtl8192su/r8192U_core.c |    1 +
 1 file changed, 1 insertion(+)
drivers/staging/rtl8192su/r8192U_core.c +1 -0
@@ -24,6 +24,7 @@
  * Jerry chuang <[email protected]>
  */
 
+#include <linux/vmalloc.h>
 
 #undef LOOP_TEST
 #undef DUMP_RX