Browse Source

[compiler] Fix 64bit compile time errors

Apart from format specifier fixes there are two changes in proper code:
- Change type of regs in skge_hw to unsigned long
- Cast result of sizeof in myri10ge to uint32_t

Both don't change anything for i386 and should be fine on x86_64.

Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com>
Signed-off-by: Joshua Oreman <oremanj@rwcr.net>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Piotr Jaroszyński 14 years ago
parent
commit
7c6d3752c9

+ 2
- 2
src/drivers/net/ath5k/ath5k.c View File

@@ -843,7 +843,7 @@ ath5k_rxbuf_setup(struct ath5k_softc *sc, struct ath5k_buf *bf)
843 843
 	if (ah->ah_setup_rx_desc(ah, ds,
844 844
 				 iob_tailroom(iob),	/* buffer size */
845 845
 				 0) != 0) {
846
-		DBG("ath5k: error setting up RX descriptor for %d bytes\n", iob_tailroom(iob));
846
+		DBG("ath5k: error setting up RX descriptor for %zd bytes\n", iob_tailroom(iob));
847 847
 		return -EINVAL;
848 848
 	}
849 849
 
@@ -1293,7 +1293,7 @@ ath5k_tx_processq(struct ath5k_softc *sc, struct ath5k_txq *txq)
1293 1293
 		iob = bf->iob;
1294 1294
 		bf->iob = NULL;
1295 1295
 
1296
-		DBG2("ath5k: tx %d bytes complete, %d retries\n",
1296
+		DBG2("ath5k: tx %zd bytes complete, %d retries\n",
1297 1297
 		     iob_len(iob), ts.ts_retry[0]);
1298 1298
 
1299 1299
 		net80211_tx_complete(sc->dev, iob, ts.ts_retry[0],

+ 1
- 1
src/drivers/net/eepro100.c View File

@@ -448,7 +448,7 @@ static int ifec_net_transmit ( struct net_device *netdev,
448 448
 		return -ENOBUFS;
449 449
 	}
450 450
 
451
-	DBG2 ( "transmitting packet (%d bytes). status = %hX, cmd=%hX\n",
451
+	DBG2 ( "transmitting packet (%zd bytes). status = %hX, cmd=%hX\n",
452 452
 		iob_len ( iobuf ), tcb->status, inw ( ioaddr + SCBCmd ) );
453 453
 
454 454
 	tcb->command   = CmdSuspend | CmdTx | CmdTxFlex;

+ 2
- 2
src/drivers/net/myri10ge.c View File

@@ -723,7 +723,7 @@ static int myri10ge_net_open ( struct net_device *netdev )
723 723
 
724 724
 	/* Set the interrupt queue size. */
725 725
 
726
-	data[0] = ( sizeof ( priv->dma->receive_completion )
726
+	data[0] = ( (uint32_t)( sizeof ( priv->dma->receive_completion ) )
727 727
 		    | MXGEFW_CMD_SET_INTRQ_SIZE_FLAG_NO_STRICT_SIZE_CHECK );
728 728
 	TRY ( CMD_SET_ , INTRQ_SIZE , );
729 729
 
@@ -973,7 +973,7 @@ static int myri10ge_net_transmit ( struct net_device *netdev,
973 973
 		return -ENOBUFS;
974 974
 	}
975 975
 
976
-	DBG2 ( "TX %p+%d ", iobuf->data, iob_len ( iobuf ) );
976
+	DBG2 ( "TX %p+%zd ", iobuf->data, iob_len ( iobuf ) );
977 977
 	DBG2_HD ( iobuf->data, 14 );
978 978
 
979 979
 	/* Record the packet being transmitted, so we can later report

+ 3
- 3
src/drivers/net/skge.c View File

@@ -1983,13 +1983,13 @@ static void skge_rx_refill(struct net_device *dev)
1983 1983
 		if (iob || (control & BMU_OWN))
1984 1984
 			continue;
1985 1985
 
1986
-		DBG2("refilling rx desc %d: ", (ring->to_clean - ring->start));
1986
+		DBG2("refilling rx desc %zd: ", (ring->to_clean - ring->start));
1987 1987
 
1988 1988
 		iob = alloc_iob(RX_BUF_SIZE);
1989 1989
 		if (iob) {
1990 1990
 			skge_rx_setup(skge, e, iob, RX_BUF_SIZE);
1991 1991
 		} else {
1992
-			DBG("descr %d: alloc_iob() failed\n",
1992
+			DBG("descr %zd: alloc_iob() failed\n",
1993 1993
 			     (ring->to_clean - ring->start));
1994 1994
 			/* We pass the descriptor to the NIC even if the
1995 1995
 			 * allocation failed. The card will stop as soon as it
@@ -2354,7 +2354,7 @@ static int skge_probe(struct pci_device *pdev,
2354 2354
 
2355 2355
 	hw->pdev = pdev;
2356 2356
 
2357
-	hw->regs = (u32)ioremap(pci_bar_start(pdev, PCI_BASE_ADDRESS_0),
2357
+	hw->regs = (unsigned long)ioremap(pci_bar_start(pdev, PCI_BASE_ADDRESS_0),
2358 2358
 				SKGE_REG_SIZE);
2359 2359
 	if (!hw->regs) {
2360 2360
 		DBG(PFX "cannot map device registers\n");

+ 1
- 1
src/drivers/net/skge.h View File

@@ -2461,7 +2461,7 @@ struct skge_ring {
2461 2461
 
2462 2462
 
2463 2463
 struct skge_hw {
2464
-	u32	     regs;
2464
+	unsigned long	     regs;
2465 2465
 	struct pci_device    *pdev;
2466 2466
 	u32		     intr_mask;
2467 2467
 	struct net_device    *dev[2];

+ 3
- 3
src/net/80211/wpa.c View File

@@ -383,7 +383,7 @@ static int wpa_maybe_install_gtk ( struct wpa_common_ctx *ctx,
383 383
 		return -ENOENT;
384 384
 
385 385
 	if ( ie->len - 6u > sizeof ( ctx->gtk.tk ) ) {
386
-		DBGC ( ctx, "WPA %p: GTK KDE is too long (%d bytes, max %d)\n",
386
+		DBGC ( ctx, "WPA %p: GTK KDE is too long (%d bytes, max %zd)\n",
387 387
 		       ctx, ie->len - 4, sizeof ( ctx->gtk.tk ) );
388 388
 		return -EINVAL;
389 389
 	}
@@ -737,7 +737,7 @@ static int wpa_handle_1_of_2 ( struct wpa_common_ctx *ctx,
737 737
 			return rc; /* non-fatal */
738 738
 		}
739 739
 		if ( pkt->datalen > sizeof ( ctx->gtk.tk ) ) {
740
-			DBGC ( ctx, "WPA %p: too much GTK data (%d > %d)\n",
740
+			DBGC ( ctx, "WPA %p: too much GTK data (%d > %zd)\n",
741 741
 			       ctx, pkt->datalen, sizeof ( ctx->gtk.tk ) );
742 742
 			return wpa_fail ( ctx, -EINVAL );
743 743
 		}
@@ -813,7 +813,7 @@ static int eapol_key_rx ( struct io_buffer *iob, struct net_device *netdev,
813 813
 	}
814 814
 
815 815
 	if ( ( void * ) ( pkt + 1 ) + ntohs ( pkt->datalen ) > iob->tail ) {
816
-		DBGC ( ctx, "WPA %p: packet truncated (has %d extra bytes, "
816
+		DBGC ( ctx, "WPA %p: packet truncated (has %zd extra bytes, "
817 817
 		       "states %d)\n", ctx, iob->tail - ( void * ) ( pkt + 1 ),
818 818
 		       ntohs ( pkt->datalen ) );
819 819
 		rc = -EINVAL;

Loading…
Cancel
Save