Skip to content

Commit

Permalink
kdump: use print_mask_arg0 appropriately
Browse files Browse the repository at this point in the history
Some callers are using print_mask_arg() when they should be using
print_mask_arg0(); the latter should be used when all flags are optional
and there's not a flag to be decoded with a 0-mask.  This turns:

nmount(0x6991e009000,0x8,0<><invalid>0)

into:

nmount(0x6991e009000,0x8,0)

Reviewed by:	jhb
Differential Revision:	https://reviews.freebsd.org/D43007
  • Loading branch information
kevans91 committed Dec 13, 2023
1 parent 5437c3b commit a206524
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions usr.bin/kdump/kdump.c
Original file line number Diff line number Diff line change
Expand Up @@ -922,7 +922,8 @@ ktrsyscall_freebsd(struct ktr_syscall *ktr, register_t **resip,
print_number(ip, narg, c);
print_number(ip, narg, c);
putchar(',');
print_mask_arg(sysdecode_close_range_flags, *ip);
print_mask_arg0(sysdecode_close_range_flags,
*ip);
ip += 3;
narg -= 3;
break;
Expand Down Expand Up @@ -988,14 +989,14 @@ ktrsyscall_freebsd(struct ktr_syscall *ktr, register_t **resip,
print_number(ip, narg, c);
print_number(ip, narg, c);
putchar(',');
print_mask_arg(sysdecode_mount_flags, *ip);
print_mask_arg0(sysdecode_mount_flags, *ip);
ip++;
narg--;
break;
case SYS_unmount:
print_number(ip, narg, c);
putchar(',');
print_mask_arg(sysdecode_mount_flags, *ip);
print_mask_arg0(sysdecode_mount_flags, *ip);
ip++;
narg--;
break;
Expand Down Expand Up @@ -1453,7 +1454,7 @@ ktrsyscall_freebsd(struct ktr_syscall *ktr, register_t **resip,
print_number(ip, narg, c);
print_number(ip, narg, c);
putchar(',');
print_mask_arg(sysdecode_mount_flags, *ip);
print_mask_arg0(sysdecode_mount_flags, *ip);
ip++;
narg--;
break;
Expand Down

0 comments on commit a206524

Please sign in to comment.