diff options
author | Dmitry V. Levin <ldv@altlinux.org> | 2017-06-17 21:47:57 +0000 |
---|---|---|
committer | Dmitry V. Levin <ldv@altlinux.org> | 2017-06-17 21:51:48 +0000 |
commit | 6c08f7d65ca98c7ff031c7f6402ffcb051d39cc8 (patch) | |
tree | 05c0f83330077755d2968a4ff67ced7e13561486 /tests/ioctl_mtd.c | |
parent | 170281be5b8e56f3e8e6c8ed6080ad44bc29ab2c (diff) | |
download | strace-6c08f7d65ca98c7ff031c7f6402ffcb051d39cc8.tar.gz |
Fix macros encosure in a do/while loop
Enclose macros with multiple statements and macros starting
with "if" statement in a do/while loop.
Do not enclose single statement macros in a do/while loop.
Reported by kernel's checkpatch.pl script.
Diffstat (limited to 'tests/ioctl_mtd.c')
-rw-r--r-- | tests/ioctl_mtd.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/tests/ioctl_mtd.c b/tests/ioctl_mtd.c index 71d0c0d1e..6a7d94a7c 100644 --- a/tests/ioctl_mtd.c +++ b/tests/ioctl_mtd.c @@ -58,15 +58,17 @@ static const unsigned long lmagic = (unsigned long) 0xdeadbeefbadc0dedULL; (unsigned int) _IOC_NR(cmd), #cmd); \ else \ printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", #cmd); \ - } while (0) - -#define TEST_erase_info_user(cmd, eiu) \ - ioctl(-1, cmd, eiu); \ - printf("ioctl(-1, MIXER_%s(%u) or %s, {start=%#x, length=%#x})" \ - " = -1 EBADF (%m)\n", \ - (_IOC_DIR(cmd) == _IOC_READ) ? "READ" : "WRITE", \ - (unsigned int) _IOC_NR(cmd), #cmd, \ - eiu->start, eiu->length) + } while (0) + +#define TEST_erase_info_user(cmd, eiu) \ + do { \ + ioctl(-1, cmd, eiu); \ + printf("ioctl(-1, MIXER_%s(%u) or %s, {start=%#x, length=%#x})" \ + " = -1 EBADF (%m)\n", \ + (_IOC_DIR(cmd) == _IOC_READ) ? "READ" : "WRITE", \ + (unsigned int) _IOC_NR(cmd), #cmd, \ + eiu->start, eiu->length); \ + } while (0) int main(void) |