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
 	if (ah->ah_setup_rx_desc(ah, ds,
843
 	if (ah->ah_setup_rx_desc(ah, ds,
844
 				 iob_tailroom(iob),	/* buffer size */
844
 				 iob_tailroom(iob),	/* buffer size */
845
 				 0) != 0) {
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
 		return -EINVAL;
847
 		return -EINVAL;
848
 	}
848
 	}
849
 
849
 
1293
 		iob = bf->iob;
1293
 		iob = bf->iob;
1294
 		bf->iob = NULL;
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
 		     iob_len(iob), ts.ts_retry[0]);
1297
 		     iob_len(iob), ts.ts_retry[0]);
1298
 
1298
 
1299
 		net80211_tx_complete(sc->dev, iob, ts.ts_retry[0],
1299
 		net80211_tx_complete(sc->dev, iob, ts.ts_retry[0],

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

448
 		return -ENOBUFS;
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
 		iob_len ( iobuf ), tcb->status, inw ( ioaddr + SCBCmd ) );
452
 		iob_len ( iobuf ), tcb->status, inw ( ioaddr + SCBCmd ) );
453
 
453
 
454
 	tcb->command   = CmdSuspend | CmdTx | CmdTxFlex;
454
 	tcb->command   = CmdSuspend | CmdTx | CmdTxFlex;

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

723
 
723
 
724
 	/* Set the interrupt queue size. */
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
 		    | MXGEFW_CMD_SET_INTRQ_SIZE_FLAG_NO_STRICT_SIZE_CHECK );
727
 		    | MXGEFW_CMD_SET_INTRQ_SIZE_FLAG_NO_STRICT_SIZE_CHECK );
728
 	TRY ( CMD_SET_ , INTRQ_SIZE , );
728
 	TRY ( CMD_SET_ , INTRQ_SIZE , );
729
 
729
 
973
 		return -ENOBUFS;
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
 	DBG2_HD ( iobuf->data, 14 );
977
 	DBG2_HD ( iobuf->data, 14 );
978
 
978
 
979
 	/* Record the packet being transmitted, so we can later report
979
 	/* Record the packet being transmitted, so we can later report

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

1983
 		if (iob || (control & BMU_OWN))
1983
 		if (iob || (control & BMU_OWN))
1984
 			continue;
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
 		iob = alloc_iob(RX_BUF_SIZE);
1988
 		iob = alloc_iob(RX_BUF_SIZE);
1989
 		if (iob) {
1989
 		if (iob) {
1990
 			skge_rx_setup(skge, e, iob, RX_BUF_SIZE);
1990
 			skge_rx_setup(skge, e, iob, RX_BUF_SIZE);
1991
 		} else {
1991
 		} else {
1992
-			DBG("descr %d: alloc_iob() failed\n",
1992
+			DBG("descr %zd: alloc_iob() failed\n",
1993
 			     (ring->to_clean - ring->start));
1993
 			     (ring->to_clean - ring->start));
1994
 			/* We pass the descriptor to the NIC even if the
1994
 			/* We pass the descriptor to the NIC even if the
1995
 			 * allocation failed. The card will stop as soon as it
1995
 			 * allocation failed. The card will stop as soon as it
2354
 
2354
 
2355
 	hw->pdev = pdev;
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
 				SKGE_REG_SIZE);
2358
 				SKGE_REG_SIZE);
2359
 	if (!hw->regs) {
2359
 	if (!hw->regs) {
2360
 		DBG(PFX "cannot map device registers\n");
2360
 		DBG(PFX "cannot map device registers\n");

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

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

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

383
 		return -ENOENT;
383
 		return -ENOENT;
384
 
384
 
385
 	if ( ie->len - 6u > sizeof ( ctx->gtk.tk ) ) {
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
 		       ctx, ie->len - 4, sizeof ( ctx->gtk.tk ) );
387
 		       ctx, ie->len - 4, sizeof ( ctx->gtk.tk ) );
388
 		return -EINVAL;
388
 		return -EINVAL;
389
 	}
389
 	}
737
 			return rc; /* non-fatal */
737
 			return rc; /* non-fatal */
738
 		}
738
 		}
739
 		if ( pkt->datalen > sizeof ( ctx->gtk.tk ) ) {
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
 			       ctx, pkt->datalen, sizeof ( ctx->gtk.tk ) );
741
 			       ctx, pkt->datalen, sizeof ( ctx->gtk.tk ) );
742
 			return wpa_fail ( ctx, -EINVAL );
742
 			return wpa_fail ( ctx, -EINVAL );
743
 		}
743
 		}
813
 	}
813
 	}
814
 
814
 
815
 	if ( ( void * ) ( pkt + 1 ) + ntohs ( pkt->datalen ) > iob->tail ) {
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
 		       "states %d)\n", ctx, iob->tail - ( void * ) ( pkt + 1 ),
817
 		       "states %d)\n", ctx, iob->tail - ( void * ) ( pkt + 1 ),
818
 		       ntohs ( pkt->datalen ) );
818
 		       ntohs ( pkt->datalen ) );
819
 		rc = -EINVAL;
819
 		rc = -EINVAL;

Loading…
Cancel
Save