Skip to contentSkip to conversation

Fix compile warnings in r8169

PATCH In review Bernhard Walle 2 participants 2 messages Jan 17, 2007 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix compile warnings in r8169

Fix compile warnings in r8169. It doesn't fix "real" bugs, only that the driver compiles cleanly without warnings.

---

 r8169.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/r8169.c +3 -3
@@ -2016,7 +2016,7 @@ static int rtl8169_alloc_rx_skb(struct p
 	if (!skb)
 		goto err_out;
 
-	skb_reserve(skb, (align - 1) & (u32)skb->data);
+	skb_reserve(skb, (align - 1) & (long)skb->data);
 	*sk_buff = skb;
 
 	mapping = pci_map_single(pdev, skb->data, rx_buf_sz,
@@ -2227,7 +2227,7 @@ static int rtl8169_xmit_frags(struct rtl
 {
 	struct skb_shared_info *info = skb_shinfo(skb);
 	unsigned int cur_frag, entry;
-	struct TxDesc *txd;
+	struct TxDesc *txd = NULL;
 
 	entry = tp->cur_tx;
 	for (cur_frag = 0; cur_frag < info->nr_frags; cur_frag++) {
@@ -2487,7 +2487,7 @@ static inline int rtl8169_try_rx_copy(st
 
 		skb = dev_alloc_skb(pkt_size + align);
 		if (skb) {
-			skb_reserve(skb, (align - 1) & (u32)skb->data);
+			skb_reserve(skb, (align - 1) & (long)skb->data);
 			eth_copy_and_sum(skb, sk_buff[0]->data, pkt_size, 0);
 			*sk_buff = skb;
 			rtl8169_mark_to_asic(desc, rx_buf_sz);
#1 lore raw

Bernhard Walle <[email protected]> :

Quoted 2 lines
drivers/net/r8169.c +0 -0

[...]

drivers/net/r8169.c static int rtl8169_xmit_frags(struct rtl · line 2233

Quoted 9 lines
drivers/net/r8169.c +1 -1
@@ -2227,7 +2227,7 @@ static int rtl8169_xmit_frags(struct rtl
 {
 	struct skb_shared_info *info = skb_shinfo(skb);
 	unsigned int cur_frag, entry;
-	struct TxDesc *txd;
+	struct TxDesc *txd = NULL;
 
 	entry = tp->cur_tx;
 	for (cur_frag = 0; cur_frag < info->nr_frags; cur_frag++) {

The driver is right. This change does not alleviate the maintenance of the driver nor does it add incentive to fix the compiler.

Signature · 1 line
Ueimor