scsi: improve consistency with other decoding functions
Pass pointers to tracee's memory as integers instead of pointers. * scsi.c (print_sg_io_buffer): Change second argument's type to unsigned long. (print_sg_io_req, print_sg_io_res): Update callers. Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com> Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
This commit is contained in:
parent
d07056f4d0
commit
c760251451
10
scsi.c
10
scsi.c
@ -36,7 +36,7 @@
|
||||
#include "xlat/sg_io_dxfer_direction.h"
|
||||
|
||||
static void
|
||||
print_sg_io_buffer(struct tcb *tcp, unsigned char *addr, const unsigned int len)
|
||||
print_sg_io_buffer(struct tcb *tcp, unsigned long addr, const unsigned int len)
|
||||
{
|
||||
unsigned char *buf = NULL;
|
||||
unsigned int allocated, i;
|
||||
@ -45,8 +45,8 @@ print_sg_io_buffer(struct tcb *tcp, unsigned char *addr, const unsigned int len)
|
||||
return;
|
||||
allocated = (len > max_strlen) ? max_strlen : len;
|
||||
if ((buf = malloc(allocated)) == NULL ||
|
||||
umoven(tcp, (unsigned long) addr, allocated, (char *) buf) < 0) {
|
||||
tprintf("%p", addr);
|
||||
umoven(tcp, addr, allocated, (char *) buf) < 0) {
|
||||
tprintf("%#lx", addr);
|
||||
free(buf);
|
||||
return;
|
||||
}
|
||||
@ -65,7 +65,7 @@ print_sg_io_req(struct tcb *tcp, struct sg_io_hdr *sg_io)
|
||||
printxval(sg_io_dxfer_direction, sg_io->dxfer_direction,
|
||||
"SG_DXFER_???");
|
||||
tprintf(", cmd[%u]=[", sg_io->cmd_len);
|
||||
print_sg_io_buffer(tcp, sg_io->cmdp, sg_io->cmd_len);
|
||||
print_sg_io_buffer(tcp, (unsigned long) sg_io->cmdp, sg_io->cmd_len);
|
||||
tprintf("], mx_sb_len=%d, ", sg_io->mx_sb_len);
|
||||
tprintf("iovec_count=%d, ", sg_io->iovec_count);
|
||||
tprintf("dxfer_len=%u, ", sg_io->dxfer_len);
|
||||
@ -94,7 +94,7 @@ print_sg_io_res(struct tcb *tcp, struct sg_io_hdr *sg_io)
|
||||
tprintf(", status=%02x, ", sg_io->status);
|
||||
tprintf("masked_status=%02x, ", sg_io->masked_status);
|
||||
tprintf("sb[%u]=[", sg_io->sb_len_wr);
|
||||
print_sg_io_buffer(tcp, sg_io->sbp, sg_io->sb_len_wr);
|
||||
print_sg_io_buffer(tcp, (unsigned long) sg_io->sbp, sg_io->sb_len_wr);
|
||||
tprintf("], host_status=%#x, ", sg_io->host_status);
|
||||
tprintf("driver_status=%#x, ", sg_io->driver_status);
|
||||
tprintf("resid=%d, ", sg_io->resid);
|
||||
|
Loading…
Reference in New Issue
Block a user