summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Brown2007-12-06 21:16:46 +0100
committerMichael Brown2007-12-06 21:16:46 +0100
commit1949641d102b0fdc8d4314abaee9ba055481fcc0 (patch)
tree0c302355c988e9b1d2c942bb1cc6d6170a933944
parentKill off some warnings-problematic debug statements in ndp.c; the code (diff)
downloadipxe-1949641d102b0fdc8d4314abaee9ba055481fcc0.tar.gz
ipxe-1949641d102b0fdc8d4314abaee9ba055481fcc0.tar.xz
ipxe-1949641d102b0fdc8d4314abaee9ba055481fcc0.zip
Fix compiler warnings that appear only on OpenBSD.
-rw-r--r--src/arch/i386/drivers/net/undinet.c2
-rw-r--r--src/arch/i386/drivers/net/undirom.c2
-rw-r--r--src/arch/i386/firmware/pcbios/smbios.c4
-rw-r--r--src/arch/i386/image/bzimage.c2
-rw-r--r--src/arch/i386/image/nbi.c2
-rw-r--r--src/arch/i386/prefix/unnrv2b.S14
-rw-r--r--src/arch/i386/transitions/librm.S2
-rw-r--r--src/crypto/asn1.c6
-rw-r--r--src/crypto/chap.c2
-rw-r--r--src/drivers/nvs/spi.c4
-rw-r--r--src/drivers/nvs/threewire.c4
-rw-r--r--src/interface/pxe/pxe_undi.c4
-rw-r--r--src/net/udp/tftp.c14
13 files changed, 31 insertions, 31 deletions
diff --git a/src/arch/i386/drivers/net/undinet.c b/src/arch/i386/drivers/net/undinet.c
index a5746ce8..07bec560 100644
--- a/src/arch/i386/drivers/net/undinet.c
+++ b/src/arch/i386/drivers/net/undinet.c
@@ -217,7 +217,7 @@ static int undinet_call ( struct undi_nic *undinic, unsigned int function,
DBGC ( undinic, "UNDINIC %p %s failed: %s\n", undinic,
undinet_function_name ( function ), strerror ( rc ) );
DBGC ( undinic, "UNDINIC %p parameters at %04x:%04x length "
- "%#02x, entry point at %04x:%04x\n", undinic,
+ "%#02zx, entry point at %04x:%04x\n", undinic,
rm_params.segment, rm_params.offset, params_len,
undinet_entry_point.segment,
undinet_entry_point.offset );
diff --git a/src/arch/i386/drivers/net/undirom.c b/src/arch/i386/drivers/net/undirom.c
index 45bcf969..f977a553 100644
--- a/src/arch/i386/drivers/net/undirom.c
+++ b/src/arch/i386/drivers/net/undirom.c
@@ -70,7 +70,7 @@ static int undirom_parse_pxeromid ( struct undi_rom *undirom,
undirom->data_size = undi_rom_id.DataSize;
DBGC ( undirom, "UNDIROM %p has UNDI loader at %04x:%04x "
- "(code %04x data %04x)\n", undirom,
+ "(code %04zx data %04zx)\n", undirom,
undirom->loader_entry.segment, undirom->loader_entry.offset,
undirom->code_size, undirom->data_size );
return 0;
diff --git a/src/arch/i386/firmware/pcbios/smbios.c b/src/arch/i386/firmware/pcbios/smbios.c
index d8be6f8b..4d710d68 100644
--- a/src/arch/i386/firmware/pcbios/smbios.c
+++ b/src/arch/i386/firmware/pcbios/smbios.c
@@ -220,7 +220,7 @@ int find_smbios_structure ( unsigned int type, void *structure,
strings_offset = ( offset + header.length );
if ( strings_offset > smbios->length ) {
DBG ( "SMBIOS structure at offset %zx with length "
- "%zx extends beyond SMBIOS\n", offset,
+ "%x extends beyond SMBIOS\n", offset,
header.length );
return -ENOENT;
}
@@ -236,7 +236,7 @@ int find_smbios_structure ( unsigned int type, void *structure,
strings->length = ( terminator_offset - strings_offset );
DBG ( "SMBIOS structure at offset %zx has type %d, "
- "length %zx, strings length %zx\n",
+ "length %x, strings length %zx\n",
offset, header.type, header.length, strings->length );
/* If this is the structure we want, return */
diff --git a/src/arch/i386/image/bzimage.c b/src/arch/i386/image/bzimage.c
index f0591681..ed9d286d 100644
--- a/src/arch/i386/image/bzimage.c
+++ b/src/arch/i386/image/bzimage.c
@@ -344,7 +344,7 @@ static int bzimage_exec ( struct image *image ) {
shutdown();
DBGC ( image, "bzImage %p jumping to RM kernel at %04x:0000 "
- "(stack %04x:%04x)\n", image,
+ "(stack %04x:%04zx)\n", image,
( exec_ctx.rm_kernel_seg + 0x20 ),
exec_ctx.rm_kernel_seg, exec_ctx.rm_heap );
diff --git a/src/arch/i386/image/nbi.c b/src/arch/i386/image/nbi.c
index a1d74553..195cfbf7 100644
--- a/src/arch/i386/image/nbi.c
+++ b/src/arch/i386/image/nbi.c
@@ -233,7 +233,7 @@ static int nbi_process_segments ( struct image *image,
} while ( ! NBI_LAST_SEGHEADER ( sh.flags ) );
if ( offset != image->len ) {
- DBGC ( image, "NBI %p length wrong (file %d, metadata %d)\n",
+ DBGC ( image, "NBI %p length wrong (file %zd, metadata %zd)\n",
image, image->len, offset );
return -ENOEXEC;
}
diff --git a/src/arch/i386/prefix/unnrv2b.S b/src/arch/i386/prefix/unnrv2b.S
index 3209fb29..70167a14 100644
--- a/src/arch/i386/prefix/unnrv2b.S
+++ b/src/arch/i386/prefix/unnrv2b.S
@@ -54,7 +54,6 @@
* NOTE: It would be possible to build a smaller version of the
* decompression code for -DKEEP_IT_REAL by using
* #define REG(x) x
- * #define MOVSB movsb
* to use 16-bit registers where possible. This would impose limits
* that the compressed data size must be in the range [1,65533-%si]
* and the uncompressed data size must be in the range [1,65536-%di]
@@ -67,7 +66,7 @@
*/
#define REG(x) e ## x
-#define MOVSB addr32 movsb
+#define ADDR32 addr32
.code16
.globl decompress16
@@ -89,6 +88,7 @@ decompress16:
*/
#define REG(x) e ## x
+#define ADDR32
.code32
.globl decompress
@@ -114,7 +114,7 @@ decompress:
jmp dcl1_n2b
decompr_literals_n2b:
- MOVSB
+ ADDR32 movsb
decompr_loop_n2b:
addl %ebx, %ebx
jnz dcl2_n2b
@@ -132,7 +132,7 @@ loop1_n2b:
sub $3, %xAX
jb decompr_ebpeax_n2b /* if (m_off == 2) goto decompr_ebpeax_n2b ? */
shl $8, %xAX
- movb (%xSI), %al /* m_off = (m_off - 3)*256 + src[ilen++] */
+ ADDR32 movb (%xSI), %al /* m_off = (m_off - 3)*256 + src[ilen++] */
inc %xSI
xor $-1, %xAX
jz decompr_end_n2b /* if (m_off == 0xffffffff) goto decomp_end_n2b */
@@ -156,9 +156,9 @@ decompr_got_mlen_n2b:
cmp $-0xd00, %xBP
adc $1, %xCX /* m_len = m_len + 1 + (last_m_off > 0xd00) */
push %xSI
- lea (%xBP,%xDI), %xSI /* m_pos = dst + olen + -m_off */
+ ADDR32 lea (%xBP,%xDI), %xSI /* m_pos = dst + olen + -m_off */
rep
- es MOVSB /* dst[olen++] = *m_pos++ while(m_len > 0) */
+ es ADDR32 movsb /* dst[olen++] = *m_pos++ while(m_len > 0) */
pop %xSI
jmp decompr_loop_n2b
@@ -167,7 +167,7 @@ getbit1:
addl %ebx, %ebx
jnz 1f
getbit32:
- movl (%xSI), %ebx
+ ADDR32 movl (%xSI), %ebx
sub $-4, %xSI /* sets carry flag */
adcl %ebx, %ebx
1:
diff --git a/src/arch/i386/transitions/librm.S b/src/arch/i386/transitions/librm.S
index fbf3b2ac..b1f9dd59 100644
--- a/src/arch/i386/transitions/librm.S
+++ b/src/arch/i386/transitions/librm.S
@@ -192,7 +192,7 @@ real_to_prot:
movzwl %sp, %edx
movl %ebp, %eax
shll $4, %eax
- leal (%eax,%edx), %esi
+ addr32 leal (%eax,%edx), %esi
subl _virt_offset, %esi
/* Switch to protected mode */
diff --git a/src/crypto/asn1.c b/src/crypto/asn1.c
index 2ff82008..0a69162a 100644
--- a/src/crypto/asn1.c
+++ b/src/crypto/asn1.c
@@ -75,8 +75,8 @@ static int asn1_start_object ( struct asn1_cursor *cursor,
len_len = 1;
}
if ( cursor->len < len_len ) {
- DBGC ( cursor, "ASN1 %p bad length field length %d (max %d)\n",
- cursor, len_len, cursor->len );
+ DBGC ( cursor, "ASN1 %p bad length field length %d (max "
+ "%zd)\n", cursor, len_len, cursor->len );
goto notfound;
}
@@ -88,7 +88,7 @@ static int asn1_start_object ( struct asn1_cursor *cursor,
cursor->len--;
}
if ( cursor->len < len ) {
- DBGC ( cursor, "ASN1 %p bad length %d (max %d)\n",
+ DBGC ( cursor, "ASN1 %p bad length %d (max %zd)\n",
cursor, len, cursor->len );
goto notfound;
}
diff --git a/src/crypto/chap.c b/src/crypto/chap.c
index 2f624564..13b8fda2 100644
--- a/src/crypto/chap.c
+++ b/src/crypto/chap.c
@@ -55,7 +55,7 @@ int chap_init ( struct chap_challenge *chap,
state_len = ( digest->ctxsize + digest->digestsize );
state = malloc ( state_len );
if ( ! state ) {
- DBG ( "CHAP %p could not allocate %d bytes for state\n",
+ DBG ( "CHAP %p could not allocate %zd bytes for state\n",
chap, state_len );
return -ENOMEM;
}
diff --git a/src/drivers/nvs/spi.c b/src/drivers/nvs/spi.c
index fba6b6d6..be6b5904 100644
--- a/src/drivers/nvs/spi.c
+++ b/src/drivers/nvs/spi.c
@@ -87,7 +87,7 @@ int spi_read ( struct nvs_device *nvs, unsigned int address,
device->munge_address );
int rc;
- DBG ( "SPI %p reading %d bytes from %#04x\n", device, len, address );
+ DBG ( "SPI %p reading %zd bytes from %#04x\n", device, len, address );
if ( ( rc = bus->rw ( bus, device, command, address,
NULL, data, len ) ) != 0 ) {
DBG ( "SPI %p failed to read data from device\n", device );
@@ -114,7 +114,7 @@ int spi_write ( struct nvs_device *nvs, unsigned int address,
device->munge_address );
int rc;
- DBG ( "SPI %p writing %d bytes to %#04x\n", device, len, address );
+ DBG ( "SPI %p writing %zd bytes to %#04x\n", device, len, address );
if ( ( rc = bus->rw ( bus, device, SPI_WREN, -1,
NULL, NULL, 0 ) ) != 0 ) {
diff --git a/src/drivers/nvs/threewire.c b/src/drivers/nvs/threewire.c
index 3ce2a906..622e8585 100644
--- a/src/drivers/nvs/threewire.c
+++ b/src/drivers/nvs/threewire.c
@@ -43,7 +43,7 @@ int threewire_read ( struct nvs_device *nvs, unsigned int address,
assert ( bus->mode == SPI_MODE_THREEWIRE );
- DBG ( "3wire %p reading %d bytes at %04x\n", device, len, address );
+ DBG ( "3wire %p reading %zd bytes at %04x\n", device, len, address );
return bus->rw ( bus, device, THREEWIRE_READ, address,
NULL, data, len );
@@ -66,7 +66,7 @@ int threewire_write ( struct nvs_device *nvs, unsigned int address,
assert ( bus->mode == SPI_MODE_THREEWIRE );
- DBG ( "3wire %p writing %d bytes at %04x\n", device, len, address );
+ DBG ( "3wire %p writing %zd bytes at %04x\n", device, len, address );
/* Enable device for writing */
if ( ( rc = bus->rw ( bus, device, THREEWIRE_EWEN,
diff --git a/src/interface/pxe/pxe_undi.c b/src/interface/pxe/pxe_undi.c
index f19dfcc5..76b55df9 100644
--- a/src/interface/pxe/pxe_undi.c
+++ b/src/interface/pxe/pxe_undi.c
@@ -227,11 +227,11 @@ PXENV_EXIT_t pxenv_undi_transmit ( struct s_PXENV_UNDI_TRANSMIT
copy_from_real ( &tbd, undi_transmit->TBD.segment,
undi_transmit->TBD.offset, sizeof ( tbd ) );
len = tbd.ImmedLength;
- DBG ( " %zd", tbd.ImmedLength );
+ DBG ( " %d", tbd.ImmedLength );
for ( i = 0 ; i < tbd.DataBlkCount ; i++ ) {
datablk = &tbd.DataBlock[i];
len += datablk->TDDataLen;
- DBG ( "+%zd", datablk->TDDataLen );
+ DBG ( "+%d", datablk->TDDataLen );
}
/* Allocate and fill I/O buffer */
diff --git a/src/net/udp/tftp.c b/src/net/udp/tftp.c
index c2fdfb1d..d8719ace 100644
--- a/src/net/udp/tftp.c
+++ b/src/net/udp/tftp.c
@@ -496,12 +496,12 @@ static int tftp_rx_oack ( struct tftp_request *tftp, void *buf, size_t len ) {
char *end = buf + len;
char *name;
char *value;
- int rc;
+ int rc = 0;
/* Sanity check */
if ( len < sizeof ( *oack ) ) {
DBGC ( tftp, "TFTP %p received underlength OACK packet "
- "length %d\n", tftp, len );
+ "length %zd\n", tftp, len );
rc = -EINVAL;
goto done;
}
@@ -562,7 +562,7 @@ static int tftp_rx_data ( struct tftp_request *tftp,
/* Sanity check */
if ( iob_len ( iobuf ) < sizeof ( *data ) ) {
DBGC ( tftp, "TFTP %p received underlength DATA packet "
- "length %d\n", tftp, iob_len ( iobuf ) );
+ "length %zd\n", tftp, iob_len ( iobuf ) );
rc = -EINVAL;
goto done;
}
@@ -574,7 +574,7 @@ static int tftp_rx_data ( struct tftp_request *tftp,
data_len = iob_len ( iobuf );
if ( data_len > tftp->blksize ) {
DBGC ( tftp, "TFTP %p received overlength DATA packet "
- "length %d\n", tftp, data_len );
+ "length %zd\n", tftp, data_len );
rc = -EINVAL;
goto done;
}
@@ -633,7 +633,7 @@ static int tftp_rx_error ( struct tftp_request *tftp, void *buf, size_t len ) {
/* Sanity check */
if ( len < sizeof ( *error ) ) {
DBGC ( tftp, "TFTP %p received underlength ERROR packet "
- "length %d\n", tftp, len );
+ "length %zd\n", tftp, len );
return -EINVAL;
}
@@ -671,8 +671,8 @@ static int tftp_rx ( struct tftp_request *tftp,
/* Sanity checks */
if ( len < sizeof ( *common ) ) {
- DBGC ( tftp, "TFTP %p received underlength packet length %d\n",
- tftp, len );
+ DBGC ( tftp, "TFTP %p received underlength packet length "
+ "%zd\n", tftp, len );
goto done;
}
if ( ! meta ) {