qlge: Fix sizeof usage.
Some usage was only sizing a pointer rather than the data type. Signed-off-by: Ron Mercer <ron.mercer@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
6a47330892
commit
e332471c03
@ -59,7 +59,7 @@ static int ql_update_ring_coalescing(struct ql_adapter *qdev)
|
||||
cqicb->pkt_delay =
|
||||
cpu_to_le16(qdev->tx_max_coalesced_frames);
|
||||
cqicb->flags = FLAGS_LI;
|
||||
status = ql_write_cfg(qdev, cqicb, sizeof(cqicb),
|
||||
status = ql_write_cfg(qdev, cqicb, sizeof(*cqicb),
|
||||
CFG_LCQ, rx_ring->cq_id);
|
||||
if (status) {
|
||||
QPRINTK(qdev, IFUP, ERR,
|
||||
@ -82,7 +82,7 @@ static int ql_update_ring_coalescing(struct ql_adapter *qdev)
|
||||
cqicb->pkt_delay =
|
||||
cpu_to_le16(qdev->rx_max_coalesced_frames);
|
||||
cqicb->flags = FLAGS_LI;
|
||||
status = ql_write_cfg(qdev, cqicb, sizeof(cqicb),
|
||||
status = ql_write_cfg(qdev, cqicb, sizeof(*cqicb),
|
||||
CFG_LCQ, rx_ring->cq_id);
|
||||
if (status) {
|
||||
QPRINTK(qdev, IFUP, ERR,
|
||||
|
@ -2156,7 +2156,7 @@ static int qlge_send(struct sk_buff *skb, struct net_device *ndev)
|
||||
}
|
||||
tx_ring_desc = &tx_ring->q[tx_ring->prod_idx];
|
||||
mac_iocb_ptr = tx_ring_desc->queue_entry;
|
||||
memset((void *)mac_iocb_ptr, 0, sizeof(mac_iocb_ptr));
|
||||
memset((void *)mac_iocb_ptr, 0, sizeof(*mac_iocb_ptr));
|
||||
|
||||
mac_iocb_ptr->opcode = OPCODE_OB_MAC_IOCB;
|
||||
mac_iocb_ptr->tid = tx_ring_desc->index;
|
||||
@ -2795,7 +2795,7 @@ static int ql_start_tx_ring(struct ql_adapter *qdev, struct tx_ring *tx_ring)
|
||||
|
||||
ql_init_tx_ring(qdev, tx_ring);
|
||||
|
||||
err = ql_write_cfg(qdev, wqicb, sizeof(wqicb), CFG_LRQ,
|
||||
err = ql_write_cfg(qdev, wqicb, sizeof(*wqicb), CFG_LRQ,
|
||||
(u16) tx_ring->wq_id);
|
||||
if (err) {
|
||||
QPRINTK(qdev, IFUP, ERR, "Failed to load tx_ring.\n");
|
||||
@ -3060,7 +3060,7 @@ static int ql_start_rss(struct ql_adapter *qdev)
|
||||
int i;
|
||||
u8 *hash_id = (u8 *) ricb->hash_cq_id;
|
||||
|
||||
memset((void *)ricb, 0, sizeof(ricb));
|
||||
memset((void *)ricb, 0, sizeof(*ricb));
|
||||
|
||||
ricb->base_cq = qdev->rss_ring_first_cq_id | RSS_L4K;
|
||||
ricb->flags =
|
||||
@ -3082,7 +3082,7 @@ static int ql_start_rss(struct ql_adapter *qdev)
|
||||
|
||||
QPRINTK(qdev, IFUP, DEBUG, "Initializing RSS.\n");
|
||||
|
||||
status = ql_write_cfg(qdev, ricb, sizeof(ricb), CFG_LR, 0);
|
||||
status = ql_write_cfg(qdev, ricb, sizeof(*ricb), CFG_LR, 0);
|
||||
if (status) {
|
||||
QPRINTK(qdev, IFUP, ERR, "Failed to load RICB.\n");
|
||||
return status;
|
||||
@ -3489,7 +3489,7 @@ static int ql_configure_rings(struct ql_adapter *qdev)
|
||||
|
||||
for (i = 0; i < qdev->tx_ring_count; i++) {
|
||||
tx_ring = &qdev->tx_ring[i];
|
||||
memset((void *)tx_ring, 0, sizeof(tx_ring));
|
||||
memset((void *)tx_ring, 0, sizeof(*tx_ring));
|
||||
tx_ring->qdev = qdev;
|
||||
tx_ring->wq_id = i;
|
||||
tx_ring->wq_len = qdev->tx_ring_size;
|
||||
@ -3505,7 +3505,7 @@ static int ql_configure_rings(struct ql_adapter *qdev)
|
||||
|
||||
for (i = 0; i < qdev->rx_ring_count; i++) {
|
||||
rx_ring = &qdev->rx_ring[i];
|
||||
memset((void *)rx_ring, 0, sizeof(rx_ring));
|
||||
memset((void *)rx_ring, 0, sizeof(*rx_ring));
|
||||
rx_ring->qdev = qdev;
|
||||
rx_ring->cq_id = i;
|
||||
rx_ring->cpu = i % cpu_cnt; /* CPU to run handler on. */
|
||||
@ -3864,7 +3864,7 @@ static int __devinit ql_init_device(struct pci_dev *pdev,
|
||||
int pos, err = 0;
|
||||
u16 val16;
|
||||
|
||||
memset((void *)qdev, 0, sizeof(qdev));
|
||||
memset((void *)qdev, 0, sizeof(*qdev));
|
||||
err = pci_enable_device(pdev);
|
||||
if (err) {
|
||||
dev_err(&pdev->dev, "PCI device enable failed.\n");
|
||||
|
Loading…
Reference in New Issue
Block a user