riscv: Trap cleanup - use nitems()

No functional changes, just cleanup.

Reviewed by:	kp
Approved by:	kp (mentor)
Sponsored by:	Axiado
This commit is contained in:
Nick O'Brien 2020-09-23 18:54:14 +00:00
parent aaf78c16f5
commit e1c8f8f87d

View File

@ -136,15 +136,15 @@ dump_regs(struct trapframe *frame)
int n;
int i;
n = (sizeof(frame->tf_t) / sizeof(frame->tf_t[0]));
n = nitems(frame->tf_t);
for (i = 0; i < n; i++)
printf("t[%d] == 0x%016lx\n", i, frame->tf_t[i]);
n = (sizeof(frame->tf_s) / sizeof(frame->tf_s[0]));
n = nitems(frame->tf_s);
for (i = 0; i < n; i++)
printf("s[%d] == 0x%016lx\n", i, frame->tf_s[i]);
n = (sizeof(frame->tf_a) / sizeof(frame->tf_a[0]));
n = nitems(frame->tf_a);
for (i = 0; i < n; i++)
printf("a[%d] == 0x%016lx\n", i, frame->tf_a[i]);