Commit aaa4d308 authored by Jiri Benc's avatar Jiri Benc Committed by Jeff Garzik

[PATCH] ieee80211: fix ipw 64bit compilation warnings

On Mon, 06 Jun 2005 14:29:52 +0800, Zhu Yi wrote:
> ("%zd", sizeof()) should be better.

Thanks. This is a corrected version of the patch.

This patch fixes warnings when compiling ipw2100 and ipw2200 on x86_64.
Signed-off-by: default avatarJiri Benc <jbenc@suse.cz>
Signed-off-by: default avatarJirka Bohac <jbohac@suse.cz>
parent e19b813e
...@@ -493,7 +493,7 @@ int ipw2100_get_ordinal(struct ipw2100_priv *priv, u32 ord, ...@@ -493,7 +493,7 @@ int ipw2100_get_ordinal(struct ipw2100_priv *priv, u32 ord,
*len = IPW_ORD_TAB_1_ENTRY_SIZE; *len = IPW_ORD_TAB_1_ENTRY_SIZE;
IPW_DEBUG_WARNING(DRV_NAME IPW_DEBUG_WARNING(DRV_NAME
": ordinal buffer length too small, need %d\n", ": ordinal buffer length too small, need %zd\n",
IPW_ORD_TAB_1_ENTRY_SIZE); IPW_ORD_TAB_1_ENTRY_SIZE);
return -EINVAL; return -EINVAL;
...@@ -2302,7 +2302,7 @@ static inline void ipw2100_corruption_detected(struct ipw2100_priv *priv, ...@@ -2302,7 +2302,7 @@ static inline void ipw2100_corruption_detected(struct ipw2100_priv *priv,
#endif #endif
IPW_DEBUG_INFO(DRV_NAME ": PCI latency error detected at " IPW_DEBUG_INFO(DRV_NAME ": PCI latency error detected at "
"0x%04X.\n", i * sizeof(struct ipw2100_status)); "0x%04zX.\n", i * sizeof(struct ipw2100_status));
#ifdef ACPI_CSTATE_LIMIT_DEFINED #ifdef ACPI_CSTATE_LIMIT_DEFINED
IPW_DEBUG_INFO(DRV_NAME ": Disabling C3 transitions.\n"); IPW_DEBUG_INFO(DRV_NAME ": Disabling C3 transitions.\n");
...@@ -2398,7 +2398,7 @@ static inline void isr_rx(struct ipw2100_priv *priv, int i, ...@@ -2398,7 +2398,7 @@ static inline void isr_rx(struct ipw2100_priv *priv, int i,
/* Make a copy of the frame so we can dump it to the logs if /* Make a copy of the frame so we can dump it to the logs if
* ieee80211_rx fails */ * ieee80211_rx fails */
memcpy(packet_data, packet->skb->data, memcpy(packet_data, packet->skb->data,
min(status->frame_size, IPW_RX_NIC_BUFFER_LENGTH)); min_t(u32, status->frame_size, IPW_RX_NIC_BUFFER_LENGTH));
#endif #endif
if (!ieee80211_rx(priv->ieee, packet->skb, stats)) { if (!ieee80211_rx(priv->ieee, packet->skb, stats)) {
...@@ -2730,21 +2730,21 @@ static inline int __ipw2100_tx_process(struct ipw2100_priv *priv) ...@@ -2730,21 +2730,21 @@ static inline int __ipw2100_tx_process(struct ipw2100_priv *priv)
{ {
int i = txq->oldest; int i = txq->oldest;
IPW_DEBUG_TX( IPW_DEBUG_TX(
"TX%d V=%p P=%p T=%p L=%d\n", i, "TX%d V=%p P=%04X T=%04X L=%d\n", i,
&txq->drv[i], &txq->drv[i],
(void*)txq->nic + i * sizeof(struct ipw2100_bd), (u32)(txq->nic + i * sizeof(struct ipw2100_bd)),
(void*)txq->drv[i].host_addr, txq->drv[i].host_addr,
txq->drv[i].buf_length); txq->drv[i].buf_length);
if (packet->type == DATA) { if (packet->type == DATA) {
i = (i + 1) % txq->entries; i = (i + 1) % txq->entries;
IPW_DEBUG_TX( IPW_DEBUG_TX(
"TX%d V=%p P=%p T=%p L=%d\n", i, "TX%d V=%p P=%04X T=%04X L=%d\n", i,
&txq->drv[i], &txq->drv[i],
(void*)txq->nic + i * (u32)(txq->nic + i *
sizeof(struct ipw2100_bd), sizeof(struct ipw2100_bd)),
(void*)txq->drv[i].host_addr, (u32)txq->drv[i].host_addr,
txq->drv[i].buf_length); txq->drv[i].buf_length);
} }
} }
...@@ -4212,7 +4212,7 @@ static void bd_queue_initialize( ...@@ -4212,7 +4212,7 @@ static void bd_queue_initialize(
{ {
IPW_DEBUG_INFO("enter\n"); IPW_DEBUG_INFO("enter\n");
IPW_DEBUG_INFO("initializing bd queue at virt=%p, phys=%08x\n", q->drv, q->nic); IPW_DEBUG_INFO("initializing bd queue at virt=%p, phys=%08x\n", q->drv, (u32)q->nic);
write_register(priv->net_dev, base, q->nic); write_register(priv->net_dev, base, q->nic);
write_register(priv->net_dev, size, q->entries); write_register(priv->net_dev, size, q->entries);
...@@ -8431,7 +8431,7 @@ int ipw2100_get_firmware(struct ipw2100_priv *priv, struct ipw2100_fw *fw) ...@@ -8431,7 +8431,7 @@ int ipw2100_get_firmware(struct ipw2100_priv *priv, struct ipw2100_fw *fw)
priv->net_dev->name, fw_name); priv->net_dev->name, fw_name);
return rc; return rc;
} }
IPW_DEBUG_INFO("firmware data %p size %d\n", fw->fw_entry->data, IPW_DEBUG_INFO("firmware data %p size %zd\n", fw->fw_entry->data,
fw->fw_entry->size); fw->fw_entry->size);
ipw2100_mod_firmware_load(fw); ipw2100_mod_firmware_load(fw);
......
...@@ -241,8 +241,8 @@ static void _ipw_write_reg8(struct ipw_priv *priv, u32 reg, u8 value) ...@@ -241,8 +241,8 @@ static void _ipw_write_reg8(struct ipw_priv *priv, u32 reg, u8 value)
IPW_DEBUG_IO(" reg = 0x%8X : value = 0x%8X\n", reg, value); IPW_DEBUG_IO(" reg = 0x%8X : value = 0x%8X\n", reg, value);
_ipw_write32(priv, CX2_INDIRECT_ADDR, reg & CX2_INDIRECT_ADDR_MASK); _ipw_write32(priv, CX2_INDIRECT_ADDR, reg & CX2_INDIRECT_ADDR_MASK);
_ipw_write8(priv, CX2_INDIRECT_DATA, value); _ipw_write8(priv, CX2_INDIRECT_DATA, value);
IPW_DEBUG_IO(" reg = 0x%8X : value = 0x%8X\n", IPW_DEBUG_IO(" reg = 0x%8lX : value = 0x%8X\n",
(unsigned)(priv->hw_base + CX2_INDIRECT_DATA), (unsigned long)(priv->hw_base + CX2_INDIRECT_DATA),
value); value);
} }
...@@ -508,7 +508,7 @@ static int ipw_get_ordinal(struct ipw_priv *priv, u32 ord, void *val, ...@@ -508,7 +508,7 @@ static int ipw_get_ordinal(struct ipw_priv *priv, u32 ord, void *val,
/* verify we have enough room to store the value */ /* verify we have enough room to store the value */
if (*len < sizeof(u32)) { if (*len < sizeof(u32)) {
IPW_DEBUG_ORD("ordinal buffer length too small, " IPW_DEBUG_ORD("ordinal buffer length too small, "
"need %d\n", sizeof(u32)); "need %zd\n", sizeof(u32));
return -EINVAL; return -EINVAL;
} }
...@@ -541,7 +541,7 @@ static int ipw_get_ordinal(struct ipw_priv *priv, u32 ord, void *val, ...@@ -541,7 +541,7 @@ static int ipw_get_ordinal(struct ipw_priv *priv, u32 ord, void *val,
/* verify we have enough room to store the value */ /* verify we have enough room to store the value */
if (*len < sizeof(u32)) { if (*len < sizeof(u32)) {
IPW_DEBUG_ORD("ordinal buffer length too small, " IPW_DEBUG_ORD("ordinal buffer length too small, "
"need %d\n", sizeof(u32)); "need %zd\n", sizeof(u32));
return -EINVAL; return -EINVAL;
} }
...@@ -1740,7 +1740,7 @@ static int ipw_fw_dma_write_command_block(struct ipw_priv *priv, int index, stru ...@@ -1740,7 +1740,7 @@ static int ipw_fw_dma_write_command_block(struct ipw_priv *priv, int index, stru
u32 address = CX2_SHARED_SRAM_DMA_CONTROL + (sizeof(struct command_block) * index); u32 address = CX2_SHARED_SRAM_DMA_CONTROL + (sizeof(struct command_block) * index);
IPW_DEBUG_FW(">> :\n"); IPW_DEBUG_FW(">> :\n");
ipw_write_indirect(priv, address, (u8*)cb, sizeof(struct command_block)); ipw_write_indirect(priv, address, (u8*)cb, (int)sizeof(struct command_block));
IPW_DEBUG_FW("<< :\n"); IPW_DEBUG_FW("<< :\n");
return 0; return 0;
...@@ -2342,7 +2342,7 @@ static int ipw_get_fw(struct ipw_priv *priv, ...@@ -2342,7 +2342,7 @@ static int ipw_get_fw(struct ipw_priv *priv,
return -EINVAL; return -EINVAL;
} }
IPW_DEBUG_INFO("Loading firmware '%s' file v%d.%d (%d bytes)\n", IPW_DEBUG_INFO("Loading firmware '%s' file v%d.%d (%zd bytes)\n",
name, name,
IPW_FW_MAJOR(header->version), IPW_FW_MAJOR(header->version),
IPW_FW_MINOR(header->version), IPW_FW_MINOR(header->version),
...@@ -2697,7 +2697,7 @@ static int ipw_queue_tx_init(struct ipw_priv *priv, ...@@ -2697,7 +2697,7 @@ static int ipw_queue_tx_init(struct ipw_priv *priv,
q->bd = pci_alloc_consistent(dev,sizeof(q->bd[0])*count, &q->q.dma_addr); q->bd = pci_alloc_consistent(dev,sizeof(q->bd[0])*count, &q->q.dma_addr);
if (!q->bd) { if (!q->bd) {
IPW_ERROR("pci_alloc_consistent(%d) failed\n", IPW_ERROR("pci_alloc_consistent(%zd) failed\n",
sizeof(q->bd[0]) * count); sizeof(q->bd[0]) * count);
kfree(q->txb); kfree(q->txb);
q->txb = NULL; q->txb = NULL;
...@@ -3466,8 +3466,8 @@ static inline void ipw_rx_notification(struct ipw_priv* priv, ...@@ -3466,8 +3466,8 @@ static inline void ipw_rx_notification(struct ipw_priv* priv,
x->channel_num); x->channel_num);
} else { } else {
IPW_DEBUG_SCAN("Scan result of wrong size %d " IPW_DEBUG_SCAN("Scan result of wrong size %d "
"(should be %d)\n", "(should be %zd)\n",
notif->size,sizeof(*x)); notif->size, sizeof(*x));
} }
break; break;
} }
...@@ -3482,8 +3482,8 @@ static inline void ipw_rx_notification(struct ipw_priv* priv, ...@@ -3482,8 +3482,8 @@ static inline void ipw_rx_notification(struct ipw_priv* priv,
x->status); x->status);
} else { } else {
IPW_ERROR("Scan completed of wrong size %d " IPW_ERROR("Scan completed of wrong size %d "
"(should be %d)\n", "(should be %zd)\n",
notif->size,sizeof(*x)); notif->size, sizeof(*x));
} }
priv->status &= ~(STATUS_SCANNING | STATUS_SCAN_ABORTING); priv->status &= ~(STATUS_SCANNING | STATUS_SCAN_ABORTING);
...@@ -3515,7 +3515,7 @@ static inline void ipw_rx_notification(struct ipw_priv* priv, ...@@ -3515,7 +3515,7 @@ static inline void ipw_rx_notification(struct ipw_priv* priv,
IPW_ERROR("Frag length: %d\n", x->frag_length); IPW_ERROR("Frag length: %d\n", x->frag_length);
} else { } else {
IPW_ERROR("Frag length of wrong size %d " IPW_ERROR("Frag length of wrong size %d "
"(should be %d)\n", "(should be %zd)\n",
notif->size, sizeof(*x)); notif->size, sizeof(*x));
} }
break; break;
...@@ -3532,8 +3532,8 @@ static inline void ipw_rx_notification(struct ipw_priv* priv, ...@@ -3532,8 +3532,8 @@ static inline void ipw_rx_notification(struct ipw_priv* priv,
memcpy(&priv->last_link_deterioration, x, sizeof(*x)); memcpy(&priv->last_link_deterioration, x, sizeof(*x));
} else { } else {
IPW_ERROR("Link Deterioration of wrong size %d " IPW_ERROR("Link Deterioration of wrong size %d "
"(should be %d)\n", "(should be %zd)\n",
notif->size,sizeof(*x)); notif->size, sizeof(*x));
} }
break; break;
} }
...@@ -3552,7 +3552,7 @@ static inline void ipw_rx_notification(struct ipw_priv* priv, ...@@ -3552,7 +3552,7 @@ static inline void ipw_rx_notification(struct ipw_priv* priv,
struct notif_beacon_state *x = &notif->u.beacon_state; struct notif_beacon_state *x = &notif->u.beacon_state;
if (notif->size != sizeof(*x)) { if (notif->size != sizeof(*x)) {
IPW_ERROR("Beacon state of wrong size %d (should " IPW_ERROR("Beacon state of wrong size %d (should "
"be %d)\n", notif->size, sizeof(*x)); "be %zd)\n", notif->size, sizeof(*x));
break; break;
} }
...@@ -3602,8 +3602,8 @@ static inline void ipw_rx_notification(struct ipw_priv* priv, ...@@ -3602,8 +3602,8 @@ static inline void ipw_rx_notification(struct ipw_priv* priv,
break; break;
} }
IPW_ERROR("TGi Tx Key of wrong size %d (should be %d)\n", IPW_ERROR("TGi Tx Key of wrong size %d (should be %zd)\n",
notif->size,sizeof(*x)); notif->size, sizeof(*x));
break; break;
} }
...@@ -3616,8 +3616,8 @@ static inline void ipw_rx_notification(struct ipw_priv* priv, ...@@ -3616,8 +3616,8 @@ static inline void ipw_rx_notification(struct ipw_priv* priv,
break; break;
} }
IPW_ERROR("Calibration of wrong size %d (should be %d)\n", IPW_ERROR("Calibration of wrong size %d (should be %zd)\n",
notif->size,sizeof(*x)); notif->size, sizeof(*x));
break; break;
} }
...@@ -3628,7 +3628,7 @@ static inline void ipw_rx_notification(struct ipw_priv* priv, ...@@ -3628,7 +3628,7 @@ static inline void ipw_rx_notification(struct ipw_priv* priv,
break; break;
} }
IPW_ERROR("Noise stat is wrong size %d (should be %d)\n", IPW_ERROR("Noise stat is wrong size %d (should be %zd)\n",
notif->size, sizeof(u32)); notif->size, sizeof(u32));
break; break;
} }
...@@ -4823,7 +4823,7 @@ static inline void ipw_handle_data_packet(struct ipw_priv *priv, ...@@ -4823,7 +4823,7 @@ static inline void ipw_handle_data_packet(struct ipw_priv *priv,
} }
/* Advance skb->data to the start of the actual payload */ /* Advance skb->data to the start of the actual payload */
skb_reserve(rxb->skb, (u32)&pkt->u.frame.data[0] - (u32)pkt); skb_reserve(rxb->skb, offsetof(struct ipw_rx_packet, u.frame.data));
/* Set the size of the skb to the size of the frame */ /* Set the size of the skb to the size of the frame */
skb_put(rxb->skb, pkt->u.frame.length); skb_put(rxb->skb, pkt->u.frame.length);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment