RISC-V: fix some mismatched format specifiers

RISC-V is currently built with -Wno-format, which is how these went
undetected. Address them now before re-enabling those warnings.

Differential Revision:	https://reviews.freebsd.org/D26319
This commit is contained in:
Mitchell Horne 2020-09-08 13:21:13 +00:00
parent 88e43c7ca4
commit 7c7b8f577e
6 changed files with 12 additions and 12 deletions

View file

@ -363,7 +363,7 @@ axidma_desc_alloc(struct axidma_softc *sc, struct xdma_channel *xchan,
chan->mem_vaddr = kva_alloc(chan->mem_size);
pmap_kenter_device(chan->mem_vaddr, chan->mem_size, chan->mem_paddr);
device_printf(sc->dev, "Allocated chunk %lx %d\n",
device_printf(sc->dev, "Allocated chunk %lx %lu\n",
chan->mem_paddr, chan->mem_size);
for (i = 0; i < nsegments; i++) {

View file

@ -416,7 +416,7 @@ oprint(struct riscv_op *op, vm_offset_t loc, int insn)
imm |= ((insn >> 12) & 0x1) << 5;
if (imm & (1 << 5))
imm |= (0x7ffffff << 5); /* sign ext */
db_printf("0x%lx", imm);
db_printf("0x%x", imm);
break;
case 'o':
imm = ((insn >> 2) & 0x1f) << 0;
@ -524,7 +524,7 @@ oprint(struct riscv_op *op, vm_offset_t loc, int insn)
imm = (insn >> 12) & 0xfffff;
if (imm & (1 << 20))
imm |= (0xfff << 20); /* sign extend */
db_printf("0x%lx", imm);
db_printf("0x%x", imm);
break;
case 'j':
/* imm[11:0] << 20 */

View file

@ -73,9 +73,9 @@ struct intc_irqsrc isrcs[INTC_NIRQS];
static void
riscv_mask_irq(void *source)
{
uintptr_t irq;
int irq;
irq = (uintptr_t)source;
irq = (int)(uintptr_t)source;
switch (irq) {
case IRQ_TIMER_SUPERVISOR:
@ -95,9 +95,9 @@ riscv_mask_irq(void *source)
static void
riscv_unmask_irq(void *source)
{
uintptr_t irq;
int irq;
irq = (uintptr_t)source;
irq = (int)(uintptr_t)source;
switch (irq) {
case IRQ_TIMER_SUPERVISOR:

View file

@ -590,7 +590,7 @@ pmap_bootstrap(vm_offset_t l1pt, vm_paddr_t kernstart, vm_size_t kernlen)
if (physmap[i + 1] > max_pa)
max_pa = physmap[i + 1];
}
printf("physmap_idx %lx\n", physmap_idx);
printf("physmap_idx %u\n", physmap_idx);
printf("min_pa %lx\n", min_pa);
printf("max_pa %lx\n", max_pa);

View file

@ -104,7 +104,7 @@ sbi_print_version(void)
switch (sbi_impl_id) {
case (SBI_IMPL_ID_BBL):
printf("SBI: Berkely Boot Loader %u\n", sbi_impl_version);
printf("SBI: Berkely Boot Loader %lu\n", sbi_impl_version);
break;
case (SBI_IMPL_ID_OPENSBI):
major = sbi_impl_version >> OPENSBI_VERSION_MAJOR_OFFSET;
@ -112,7 +112,7 @@ sbi_print_version(void)
printf("SBI: OpenSBI v%u.%u\n", major, minor);
break;
default:
printf("SBI: Unrecognized Implementation: %u\n", sbi_impl_id);
printf("SBI: Unrecognized Implementation: %lu\n", sbi_impl_id);
break;
}

View file

@ -306,7 +306,7 @@ do_trap_supervisor(struct trapframe *frame)
break;
default:
dump_regs(frame);
panic("Unknown kernel exception %x trap value %lx\n",
panic("Unknown kernel exception %lx trap value %lx\n",
exception, frame->tf_stval);
}
}
@ -375,7 +375,7 @@ do_trap_user(struct trapframe *frame)
break;
default:
dump_regs(frame);
panic("Unknown userland exception %x, trap value %lx\n",
panic("Unknown userland exception %lx, trap value %lx\n",
exception, frame->tf_stval);
}
}