aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/atm/iphase.c6
-rw-r--r--drivers/atm/iphase.h2
-rw-r--r--drivers/atm/solos-pci.c8
-rw-r--r--drivers/isdn/sc/interrupt.c18
-rw-r--r--drivers/net/fec.c3
-rw-r--r--drivers/net/r8169.c65
-rw-r--r--drivers/net/wimax/i2400m/rx.c26
7 files changed, 71 insertions, 57 deletions
diff --git a/drivers/atm/iphase.c b/drivers/atm/iphase.c
index 8b358d7d958f..9309d4724e13 100644
--- a/drivers/atm/iphase.c
+++ b/drivers/atm/iphase.c
@@ -3156,7 +3156,6 @@ static int __devinit ia_init_one(struct pci_dev *pdev,
3156{ 3156{
3157 struct atm_dev *dev; 3157 struct atm_dev *dev;
3158 IADEV *iadev; 3158 IADEV *iadev;
3159 unsigned long flags;
3160 int ret; 3159 int ret;
3161 3160
3162 iadev = kzalloc(sizeof(*iadev), GFP_KERNEL); 3161 iadev = kzalloc(sizeof(*iadev), GFP_KERNEL);
@@ -3188,19 +3187,14 @@ static int __devinit ia_init_one(struct pci_dev *pdev,
3188 ia_dev[iadev_count] = iadev; 3187 ia_dev[iadev_count] = iadev;
3189 _ia_dev[iadev_count] = dev; 3188 _ia_dev[iadev_count] = dev;
3190 iadev_count++; 3189 iadev_count++;
3191 spin_lock_init(&iadev->misc_lock);
3192 /* First fixes first. I don't want to think about this now. */
3193 spin_lock_irqsave(&iadev->misc_lock, flags);
3194 if (ia_init(dev) || ia_start(dev)) { 3190 if (ia_init(dev) || ia_start(dev)) {
3195 IF_INIT(printk("IA register failed!\n");) 3191 IF_INIT(printk("IA register failed!\n");)
3196 iadev_count--; 3192 iadev_count--;
3197 ia_dev[iadev_count] = NULL; 3193 ia_dev[iadev_count] = NULL;
3198 _ia_dev[iadev_count] = NULL; 3194 _ia_dev[iadev_count] = NULL;
3199 spin_unlock_irqrestore(&iadev->misc_lock, flags);
3200 ret = -EINVAL; 3195 ret = -EINVAL;
3201 goto err_out_deregister_dev; 3196 goto err_out_deregister_dev;
3202 } 3197 }
3203 spin_unlock_irqrestore(&iadev->misc_lock, flags);
3204 IF_EVENT(printk("iadev_count = %d\n", iadev_count);) 3198 IF_EVENT(printk("iadev_count = %d\n", iadev_count);)
3205 3199
3206 iadev->next_board = ia_boards; 3200 iadev->next_board = ia_boards;
diff --git a/drivers/atm/iphase.h b/drivers/atm/iphase.h
index b2cd20f549cb..077735e0e04b 100644
--- a/drivers/atm/iphase.h
+++ b/drivers/atm/iphase.h
@@ -1022,7 +1022,7 @@ typedef struct iadev_t {
1022 struct dle_q rx_dle_q; 1022 struct dle_q rx_dle_q;
1023 struct free_desc_q *rx_free_desc_qhead; 1023 struct free_desc_q *rx_free_desc_qhead;
1024 struct sk_buff_head rx_dma_q; 1024 struct sk_buff_head rx_dma_q;
1025 spinlock_t rx_lock, misc_lock; 1025 spinlock_t rx_lock;
1026 struct atm_vcc **rx_open; /* list of all open VCs */ 1026 struct atm_vcc **rx_open; /* list of all open VCs */
1027 u16 num_rx_desc, rx_buf_sz, rxing; 1027 u16 num_rx_desc, rx_buf_sz, rxing;
1028 u32 rx_pkt_ram, rx_tmp_cnt; 1028 u32 rx_pkt_ram, rx_tmp_cnt;
diff --git a/drivers/atm/solos-pci.c b/drivers/atm/solos-pci.c
index f916ddf63938..f46138ab38b6 100644
--- a/drivers/atm/solos-pci.c
+++ b/drivers/atm/solos-pci.c
@@ -444,6 +444,7 @@ static ssize_t console_show(struct device *dev, struct device_attribute *attr,
444 struct atm_dev *atmdev = container_of(dev, struct atm_dev, class_dev); 444 struct atm_dev *atmdev = container_of(dev, struct atm_dev, class_dev);
445 struct solos_card *card = atmdev->dev_data; 445 struct solos_card *card = atmdev->dev_data;
446 struct sk_buff *skb; 446 struct sk_buff *skb;
447 unsigned int len;
447 448
448 spin_lock(&card->cli_queue_lock); 449 spin_lock(&card->cli_queue_lock);
449 skb = skb_dequeue(&card->cli_queue[SOLOS_CHAN(atmdev)]); 450 skb = skb_dequeue(&card->cli_queue[SOLOS_CHAN(atmdev)]);
@@ -451,11 +452,12 @@ static ssize_t console_show(struct device *dev, struct device_attribute *attr,
451 if(skb == NULL) 452 if(skb == NULL)
452 return sprintf(buf, "No data.\n"); 453 return sprintf(buf, "No data.\n");
453 454
454 memcpy(buf, skb->data, skb->len); 455 len = skb->len;
455 dev_dbg(&card->dev->dev, "len: %d\n", skb->len); 456 memcpy(buf, skb->data, len);
457 dev_dbg(&card->dev->dev, "len: %d\n", len);
456 458
457 kfree_skb(skb); 459 kfree_skb(skb);
458 return skb->len; 460 return len;
459} 461}
460 462
461static int send_command(struct solos_card *card, int dev, const char *buf, size_t size) 463static int send_command(struct solos_card *card, int dev, const char *buf, size_t size)
diff --git a/drivers/isdn/sc/interrupt.c b/drivers/isdn/sc/interrupt.c
index 485be8b1e1b3..f0225bc0f267 100644
--- a/drivers/isdn/sc/interrupt.c
+++ b/drivers/isdn/sc/interrupt.c
@@ -112,11 +112,19 @@ irqreturn_t interrupt_handler(int dummy, void *card_inst)
112 } 112 }
113 else if(callid>=0x0000 && callid<=0x7FFF) 113 else if(callid>=0x0000 && callid<=0x7FFF)
114 { 114 {
115 int len;
116
115 pr_debug("%s: Got Incoming Call\n", 117 pr_debug("%s: Got Incoming Call\n",
116 sc_adapter[card]->devicename); 118 sc_adapter[card]->devicename);
117 strcpy(setup.phone,&(rcvmsg.msg_data.byte_array[4])); 119 len = strlcpy(setup.phone, &(rcvmsg.msg_data.byte_array[4]),
118 strcpy(setup.eazmsn, 120 sizeof(setup.phone));
119 sc_adapter[card]->channel[rcvmsg.phy_link_no-1].dn); 121 if (len >= sizeof(setup.phone))
122 continue;
123 len = strlcpy(setup.eazmsn,
124 sc_adapter[card]->channel[rcvmsg.phy_link_no - 1].dn,
125 sizeof(setup.eazmsn));
126 if (len >= sizeof(setup.eazmsn))
127 continue;
120 setup.si1 = 7; 128 setup.si1 = 7;
121 setup.si2 = 0; 129 setup.si2 = 0;
122 setup.plan = 0; 130 setup.plan = 0;
@@ -176,7 +184,9 @@ irqreturn_t interrupt_handler(int dummy, void *card_inst)
176 * Handle a GetMyNumber Rsp 184 * Handle a GetMyNumber Rsp
177 */ 185 */
178 if (IS_CE_MESSAGE(rcvmsg,Call,0,GetMyNumber)){ 186 if (IS_CE_MESSAGE(rcvmsg,Call,0,GetMyNumber)){
179 strcpy(sc_adapter[card]->channel[rcvmsg.phy_link_no-1].dn,rcvmsg.msg_data.byte_array); 187 strlcpy(sc_adapter[card]->channel[rcvmsg.phy_link_no - 1].dn,
188 rcvmsg.msg_data.byte_array,
189 sizeof(rcvmsg.msg_data.byte_array));
180 continue; 190 continue;
181 } 191 }
182 192
diff --git a/drivers/net/fec.c b/drivers/net/fec.c
index 768b840aeb6b..e83f67d22fe3 100644
--- a/drivers/net/fec.c
+++ b/drivers/net/fec.c
@@ -1311,6 +1311,9 @@ fec_probe(struct platform_device *pdev)
1311 if (ret) 1311 if (ret)
1312 goto failed_mii_init; 1312 goto failed_mii_init;
1313 1313
1314 /* Carrier starts down, phylib will bring it up */
1315 netif_carrier_off(ndev);
1316
1314 ret = register_netdev(ndev); 1317 ret = register_netdev(ndev);
1315 if (ret) 1318 if (ret)
1316 goto failed_register; 1319 goto failed_register;
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index fe3b7622fba0..bc669a40ae96 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -1217,7 +1217,8 @@ static void rtl8169_update_counters(struct net_device *dev)
1217 if ((RTL_R8(ChipCmd) & CmdRxEnb) == 0) 1217 if ((RTL_R8(ChipCmd) & CmdRxEnb) == 0)
1218 return; 1218 return;
1219 1219
1220 counters = pci_alloc_consistent(tp->pci_dev, sizeof(*counters), &paddr); 1220 counters = dma_alloc_coherent(&tp->pci_dev->dev, sizeof(*counters),
1221 &paddr, GFP_KERNEL);
1221 if (!counters) 1222 if (!counters)
1222 return; 1223 return;
1223 1224
@@ -1238,7 +1239,8 @@ static void rtl8169_update_counters(struct net_device *dev)
1238 RTL_W32(CounterAddrLow, 0); 1239 RTL_W32(CounterAddrLow, 0);
1239 RTL_W32(CounterAddrHigh, 0); 1240 RTL_W32(CounterAddrHigh, 0);
1240 1241
1241 pci_free_consistent(tp->pci_dev, sizeof(*counters), counters, paddr); 1242 dma_free_coherent(&tp->pci_dev->dev, sizeof(*counters), counters,
1243 paddr);
1242} 1244}
1243 1245
1244static void rtl8169_get_ethtool_stats(struct net_device *dev, 1246static void rtl8169_get_ethtool_stats(struct net_device *dev,
@@ -3298,15 +3300,15 @@ static int rtl8169_open(struct net_device *dev)
3298 3300
3299 /* 3301 /*
3300 * Rx and Tx desscriptors needs 256 bytes alignment. 3302 * Rx and Tx desscriptors needs 256 bytes alignment.
3301 * pci_alloc_consistent provides more. 3303 * dma_alloc_coherent provides more.
3302 */ 3304 */
3303 tp->TxDescArray = pci_alloc_consistent(pdev, R8169_TX_RING_BYTES, 3305 tp->TxDescArray = dma_alloc_coherent(&pdev->dev, R8169_TX_RING_BYTES,
3304 &tp->TxPhyAddr); 3306 &tp->TxPhyAddr, GFP_KERNEL);
3305 if (!tp->TxDescArray) 3307 if (!tp->TxDescArray)
3306 goto err_pm_runtime_put; 3308 goto err_pm_runtime_put;
3307 3309
3308 tp->RxDescArray = pci_alloc_consistent(pdev, R8169_RX_RING_BYTES, 3310 tp->RxDescArray = dma_alloc_coherent(&pdev->dev, R8169_RX_RING_BYTES,
3309 &tp->RxPhyAddr); 3311 &tp->RxPhyAddr, GFP_KERNEL);
3310 if (!tp->RxDescArray) 3312 if (!tp->RxDescArray)
3311 goto err_free_tx_0; 3313 goto err_free_tx_0;
3312 3314
@@ -3340,12 +3342,12 @@ out:
3340err_release_ring_2: 3342err_release_ring_2:
3341 rtl8169_rx_clear(tp); 3343 rtl8169_rx_clear(tp);
3342err_free_rx_1: 3344err_free_rx_1:
3343 pci_free_consistent(pdev, R8169_RX_RING_BYTES, tp->RxDescArray, 3345 dma_free_coherent(&pdev->dev, R8169_RX_RING_BYTES, tp->RxDescArray,
3344 tp->RxPhyAddr); 3346 tp->RxPhyAddr);
3345 tp->RxDescArray = NULL; 3347 tp->RxDescArray = NULL;
3346err_free_tx_0: 3348err_free_tx_0:
3347 pci_free_consistent(pdev, R8169_TX_RING_BYTES, tp->TxDescArray, 3349 dma_free_coherent(&pdev->dev, R8169_TX_RING_BYTES, tp->TxDescArray,
3348 tp->TxPhyAddr); 3350 tp->TxPhyAddr);
3349 tp->TxDescArray = NULL; 3351 tp->TxDescArray = NULL;
3350err_pm_runtime_put: 3352err_pm_runtime_put:
3351 pm_runtime_put_noidle(&pdev->dev); 3353 pm_runtime_put_noidle(&pdev->dev);
@@ -3981,7 +3983,7 @@ static void rtl8169_free_rx_skb(struct rtl8169_private *tp,
3981{ 3983{
3982 struct pci_dev *pdev = tp->pci_dev; 3984 struct pci_dev *pdev = tp->pci_dev;
3983 3985
3984 pci_unmap_single(pdev, le64_to_cpu(desc->addr), tp->rx_buf_sz, 3986 dma_unmap_single(&pdev->dev, le64_to_cpu(desc->addr), tp->rx_buf_sz,
3985 PCI_DMA_FROMDEVICE); 3987 PCI_DMA_FROMDEVICE);
3986 dev_kfree_skb(*sk_buff); 3988 dev_kfree_skb(*sk_buff);
3987 *sk_buff = NULL; 3989 *sk_buff = NULL;
@@ -4006,7 +4008,7 @@ static inline void rtl8169_map_to_asic(struct RxDesc *desc, dma_addr_t mapping,
4006static struct sk_buff *rtl8169_alloc_rx_skb(struct pci_dev *pdev, 4008static struct sk_buff *rtl8169_alloc_rx_skb(struct pci_dev *pdev,
4007 struct net_device *dev, 4009 struct net_device *dev,
4008 struct RxDesc *desc, int rx_buf_sz, 4010 struct RxDesc *desc, int rx_buf_sz,
4009 unsigned int align) 4011 unsigned int align, gfp_t gfp)
4010{ 4012{
4011 struct sk_buff *skb; 4013 struct sk_buff *skb;
4012 dma_addr_t mapping; 4014 dma_addr_t mapping;
@@ -4014,13 +4016,13 @@ static struct sk_buff *rtl8169_alloc_rx_skb(struct pci_dev *pdev,
4014 4016
4015 pad = align ? align : NET_IP_ALIGN; 4017 pad = align ? align : NET_IP_ALIGN;
4016 4018
4017 skb = netdev_alloc_skb(dev, rx_buf_sz + pad); 4019 skb = __netdev_alloc_skb(dev, rx_buf_sz + pad, gfp);
4018 if (!skb) 4020 if (!skb)
4019 goto err_out; 4021 goto err_out;
4020 4022
4021 skb_reserve(skb, align ? ((pad - 1) & (unsigned long)skb->data) : pad); 4023 skb_reserve(skb, align ? ((pad - 1) & (unsigned long)skb->data) : pad);
4022 4024
4023 mapping = pci_map_single(pdev, skb->data, rx_buf_sz, 4025 mapping = dma_map_single(&pdev->dev, skb->data, rx_buf_sz,
4024 PCI_DMA_FROMDEVICE); 4026 PCI_DMA_FROMDEVICE);
4025 4027
4026 rtl8169_map_to_asic(desc, mapping, rx_buf_sz); 4028 rtl8169_map_to_asic(desc, mapping, rx_buf_sz);
@@ -4045,7 +4047,7 @@ static void rtl8169_rx_clear(struct rtl8169_private *tp)
4045} 4047}
4046 4048
4047static u32 rtl8169_rx_fill(struct rtl8169_private *tp, struct net_device *dev, 4049static u32 rtl8169_rx_fill(struct rtl8169_private *tp, struct net_device *dev,
4048 u32 start, u32 end) 4050 u32 start, u32 end, gfp_t gfp)
4049{ 4051{
4050 u32 cur; 4052 u32 cur;
4051 4053
@@ -4060,7 +4062,7 @@ static u32 rtl8169_rx_fill(struct rtl8169_private *tp, struct net_device *dev,
4060 4062
4061 skb = rtl8169_alloc_rx_skb(tp->pci_dev, dev, 4063 skb = rtl8169_alloc_rx_skb(tp->pci_dev, dev,
4062 tp->RxDescArray + i, 4064 tp->RxDescArray + i,
4063 tp->rx_buf_sz, tp->align); 4065 tp->rx_buf_sz, tp->align, gfp);
4064 if (!skb) 4066 if (!skb)
4065 break; 4067 break;
4066 4068
@@ -4088,7 +4090,7 @@ static int rtl8169_init_ring(struct net_device *dev)
4088 memset(tp->tx_skb, 0x0, NUM_TX_DESC * sizeof(struct ring_info)); 4090 memset(tp->tx_skb, 0x0, NUM_TX_DESC * sizeof(struct ring_info));
4089 memset(tp->Rx_skbuff, 0x0, NUM_RX_DESC * sizeof(struct sk_buff *)); 4091 memset(tp->Rx_skbuff, 0x0, NUM_RX_DESC * sizeof(struct sk_buff *));
4090 4092
4091 if (rtl8169_rx_fill(tp, dev, 0, NUM_RX_DESC) != NUM_RX_DESC) 4093 if (rtl8169_rx_fill(tp, dev, 0, NUM_RX_DESC, GFP_KERNEL) != NUM_RX_DESC)
4092 goto err_out; 4094 goto err_out;
4093 4095
4094 rtl8169_mark_as_last_descriptor(tp->RxDescArray + NUM_RX_DESC - 1); 4096 rtl8169_mark_as_last_descriptor(tp->RxDescArray + NUM_RX_DESC - 1);
@@ -4105,7 +4107,8 @@ static void rtl8169_unmap_tx_skb(struct pci_dev *pdev, struct ring_info *tx_skb,
4105{ 4107{
4106 unsigned int len = tx_skb->len; 4108 unsigned int len = tx_skb->len;
4107 4109
4108 pci_unmap_single(pdev, le64_to_cpu(desc->addr), len, PCI_DMA_TODEVICE); 4110 dma_unmap_single(&pdev->dev, le64_to_cpu(desc->addr), len,
4111 PCI_DMA_TODEVICE);
4109 desc->opts1 = 0x00; 4112 desc->opts1 = 0x00;
4110 desc->opts2 = 0x00; 4113 desc->opts2 = 0x00;
4111 desc->addr = 0x00; 4114 desc->addr = 0x00;
@@ -4249,7 +4252,8 @@ static int rtl8169_xmit_frags(struct rtl8169_private *tp, struct sk_buff *skb,
4249 txd = tp->TxDescArray + entry; 4252 txd = tp->TxDescArray + entry;
4250 len = frag->size; 4253 len = frag->size;
4251 addr = ((void *) page_address(frag->page)) + frag->page_offset; 4254 addr = ((void *) page_address(frag->page)) + frag->page_offset;
4252 mapping = pci_map_single(tp->pci_dev, addr, len, PCI_DMA_TODEVICE); 4255 mapping = dma_map_single(&tp->pci_dev->dev, addr, len,
4256 PCI_DMA_TODEVICE);
4253 4257
4254 /* anti gcc 2.95.3 bugware (sic) */ 4258 /* anti gcc 2.95.3 bugware (sic) */
4255 status = opts1 | len | (RingEnd * !((entry + 1) % NUM_TX_DESC)); 4259 status = opts1 | len | (RingEnd * !((entry + 1) % NUM_TX_DESC));
@@ -4319,7 +4323,8 @@ static netdev_tx_t rtl8169_start_xmit(struct sk_buff *skb,
4319 tp->tx_skb[entry].skb = skb; 4323 tp->tx_skb[entry].skb = skb;
4320 } 4324 }
4321 4325
4322 mapping = pci_map_single(tp->pci_dev, skb->data, len, PCI_DMA_TODEVICE); 4326 mapping = dma_map_single(&tp->pci_dev->dev, skb->data, len,
4327 PCI_DMA_TODEVICE);
4323 4328
4324 tp->tx_skb[entry].len = len; 4329 tp->tx_skb[entry].len = len;
4325 txd->addr = cpu_to_le64(mapping); 4330 txd->addr = cpu_to_le64(mapping);
@@ -4482,8 +4487,8 @@ static inline bool rtl8169_try_rx_copy(struct sk_buff **sk_buff,
4482 if (!skb) 4487 if (!skb)
4483 goto out; 4488 goto out;
4484 4489
4485 pci_dma_sync_single_for_cpu(tp->pci_dev, addr, pkt_size, 4490 dma_sync_single_for_cpu(&tp->pci_dev->dev, addr, pkt_size,
4486 PCI_DMA_FROMDEVICE); 4491 PCI_DMA_FROMDEVICE);
4487 skb_copy_from_linear_data(*sk_buff, skb->data, pkt_size); 4492 skb_copy_from_linear_data(*sk_buff, skb->data, pkt_size);
4488 *sk_buff = skb; 4493 *sk_buff = skb;
4489 done = true; 4494 done = true;
@@ -4552,11 +4557,11 @@ static int rtl8169_rx_interrupt(struct net_device *dev,
4552 } 4557 }
4553 4558
4554 if (rtl8169_try_rx_copy(&skb, tp, pkt_size, addr)) { 4559 if (rtl8169_try_rx_copy(&skb, tp, pkt_size, addr)) {
4555 pci_dma_sync_single_for_device(pdev, addr, 4560 dma_sync_single_for_device(&pdev->dev, addr,
4556 pkt_size, PCI_DMA_FROMDEVICE); 4561 pkt_size, PCI_DMA_FROMDEVICE);
4557 rtl8169_mark_to_asic(desc, tp->rx_buf_sz); 4562 rtl8169_mark_to_asic(desc, tp->rx_buf_sz);
4558 } else { 4563 } else {
4559 pci_unmap_single(pdev, addr, tp->rx_buf_sz, 4564 dma_unmap_single(&pdev->dev, addr, tp->rx_buf_sz,
4560 PCI_DMA_FROMDEVICE); 4565 PCI_DMA_FROMDEVICE);
4561 tp->Rx_skbuff[entry] = NULL; 4566 tp->Rx_skbuff[entry] = NULL;
4562 } 4567 }
@@ -4587,7 +4592,7 @@ static int rtl8169_rx_interrupt(struct net_device *dev,
4587 count = cur_rx - tp->cur_rx; 4592 count = cur_rx - tp->cur_rx;
4588 tp->cur_rx = cur_rx; 4593 tp->cur_rx = cur_rx;
4589 4594
4590 delta = rtl8169_rx_fill(tp, dev, tp->dirty_rx, tp->cur_rx); 4595 delta = rtl8169_rx_fill(tp, dev, tp->dirty_rx, tp->cur_rx, GFP_ATOMIC);
4591 if (!delta && count) 4596 if (!delta && count)
4592 netif_info(tp, intr, dev, "no Rx buffer allocated\n"); 4597 netif_info(tp, intr, dev, "no Rx buffer allocated\n");
4593 tp->dirty_rx += delta; 4598 tp->dirty_rx += delta;
@@ -4773,10 +4778,10 @@ static int rtl8169_close(struct net_device *dev)
4773 4778
4774 free_irq(dev->irq, dev); 4779 free_irq(dev->irq, dev);
4775 4780
4776 pci_free_consistent(pdev, R8169_RX_RING_BYTES, tp->RxDescArray, 4781 dma_free_coherent(&pdev->dev, R8169_RX_RING_BYTES, tp->RxDescArray,
4777 tp->RxPhyAddr); 4782 tp->RxPhyAddr);
4778 pci_free_consistent(pdev, R8169_TX_RING_BYTES, tp->TxDescArray, 4783 dma_free_coherent(&pdev->dev, R8169_TX_RING_BYTES, tp->TxDescArray,
4779 tp->TxPhyAddr); 4784 tp->TxPhyAddr);
4780 tp->TxDescArray = NULL; 4785 tp->TxDescArray = NULL;
4781 tp->RxDescArray = NULL; 4786 tp->RxDescArray = NULL;
4782 4787
diff --git a/drivers/net/wimax/i2400m/rx.c b/drivers/net/wimax/i2400m/rx.c
index c4876d029201..844133b44af0 100644
--- a/drivers/net/wimax/i2400m/rx.c
+++ b/drivers/net/wimax/i2400m/rx.c
@@ -1244,16 +1244,16 @@ int i2400m_rx(struct i2400m *i2400m, struct sk_buff *skb)
1244 int i, result; 1244 int i, result;
1245 struct device *dev = i2400m_dev(i2400m); 1245 struct device *dev = i2400m_dev(i2400m);
1246 const struct i2400m_msg_hdr *msg_hdr; 1246 const struct i2400m_msg_hdr *msg_hdr;
1247 size_t pl_itr, pl_size, skb_len; 1247 size_t pl_itr, pl_size;
1248 unsigned long flags; 1248 unsigned long flags;
1249 unsigned num_pls, single_last; 1249 unsigned num_pls, single_last, skb_len;
1250 1250
1251 skb_len = skb->len; 1251 skb_len = skb->len;
1252 d_fnstart(4, dev, "(i2400m %p skb %p [size %zu])\n", 1252 d_fnstart(4, dev, "(i2400m %p skb %p [size %u])\n",
1253 i2400m, skb, skb_len); 1253 i2400m, skb, skb_len);
1254 result = -EIO; 1254 result = -EIO;
1255 msg_hdr = (void *) skb->data; 1255 msg_hdr = (void *) skb->data;
1256 result = i2400m_rx_msg_hdr_check(i2400m, msg_hdr, skb->len); 1256 result = i2400m_rx_msg_hdr_check(i2400m, msg_hdr, skb_len);
1257 if (result < 0) 1257 if (result < 0)
1258 goto error_msg_hdr_check; 1258 goto error_msg_hdr_check;
1259 result = -EIO; 1259 result = -EIO;
@@ -1261,10 +1261,10 @@ int i2400m_rx(struct i2400m *i2400m, struct sk_buff *skb)
1261 pl_itr = sizeof(*msg_hdr) + /* Check payload descriptor(s) */ 1261 pl_itr = sizeof(*msg_hdr) + /* Check payload descriptor(s) */
1262 num_pls * sizeof(msg_hdr->pld[0]); 1262 num_pls * sizeof(msg_hdr->pld[0]);
1263 pl_itr = ALIGN(pl_itr, I2400M_PL_ALIGN); 1263 pl_itr = ALIGN(pl_itr, I2400M_PL_ALIGN);
1264 if (pl_itr > skb->len) { /* got all the payload descriptors? */ 1264 if (pl_itr > skb_len) { /* got all the payload descriptors? */
1265 dev_err(dev, "RX: HW BUG? message too short (%u bytes) for " 1265 dev_err(dev, "RX: HW BUG? message too short (%u bytes) for "
1266 "%u payload descriptors (%zu each, total %zu)\n", 1266 "%u payload descriptors (%zu each, total %zu)\n",
1267 skb->len, num_pls, sizeof(msg_hdr->pld[0]), pl_itr); 1267 skb_len, num_pls, sizeof(msg_hdr->pld[0]), pl_itr);
1268 goto error_pl_descr_short; 1268 goto error_pl_descr_short;
1269 } 1269 }
1270 /* Walk each payload payload--check we really got it */ 1270 /* Walk each payload payload--check we really got it */
@@ -1272,7 +1272,7 @@ int i2400m_rx(struct i2400m *i2400m, struct sk_buff *skb)
1272 /* work around old gcc warnings */ 1272 /* work around old gcc warnings */
1273 pl_size = i2400m_pld_size(&msg_hdr->pld[i]); 1273 pl_size = i2400m_pld_size(&msg_hdr->pld[i]);
1274 result = i2400m_rx_pl_descr_check(i2400m, &msg_hdr->pld[i], 1274 result = i2400m_rx_pl_descr_check(i2400m, &msg_hdr->pld[i],
1275 pl_itr, skb->len); 1275 pl_itr, skb_len);
1276 if (result < 0) 1276 if (result < 0)
1277 goto error_pl_descr_check; 1277 goto error_pl_descr_check;
1278 single_last = num_pls == 1 || i == num_pls - 1; 1278 single_last = num_pls == 1 || i == num_pls - 1;
@@ -1290,16 +1290,16 @@ int i2400m_rx(struct i2400m *i2400m, struct sk_buff *skb)
1290 if (i < i2400m->rx_pl_min) 1290 if (i < i2400m->rx_pl_min)
1291 i2400m->rx_pl_min = i; 1291 i2400m->rx_pl_min = i;
1292 i2400m->rx_num++; 1292 i2400m->rx_num++;
1293 i2400m->rx_size_acc += skb->len; 1293 i2400m->rx_size_acc += skb_len;
1294 if (skb->len < i2400m->rx_size_min) 1294 if (skb_len < i2400m->rx_size_min)
1295 i2400m->rx_size_min = skb->len; 1295 i2400m->rx_size_min = skb_len;
1296 if (skb->len > i2400m->rx_size_max) 1296 if (skb_len > i2400m->rx_size_max)
1297 i2400m->rx_size_max = skb->len; 1297 i2400m->rx_size_max = skb_len;
1298 spin_unlock_irqrestore(&i2400m->rx_lock, flags); 1298 spin_unlock_irqrestore(&i2400m->rx_lock, flags);
1299error_pl_descr_check: 1299error_pl_descr_check:
1300error_pl_descr_short: 1300error_pl_descr_short:
1301error_msg_hdr_check: 1301error_msg_hdr_check:
1302 d_fnend(4, dev, "(i2400m %p skb %p [size %zu]) = %d\n", 1302 d_fnend(4, dev, "(i2400m %p skb %p [size %u]) = %d\n",
1303 i2400m, skb, skb_len, result); 1303 i2400m, skb, skb_len, result);
1304 return result; 1304 return result;
1305} 1305}