From 84e3de2018bc4862e83b0751bb73f87b94ccc9eb Mon Sep 17 00:00:00 2001 From: "Dmitry V. Levin" Date: Wed, 4 Jan 2017 22:17:26 +0000 Subject: [PATCH] tests: remove redundant casts in fill_memory{,_ex} invocations * tests/ioctl_loop.c (main): Remove redundant casts of fill_memory first argument. * tests/kexec_load.c (main): Likewise. * tests/perf_event_open.c (main): Likewise. * tests/quotactl.c (main): Likewise. * tests/mq_sendrecv.c (main): Remove redundant casts of fill_memory_ex first argument. * tests/quotactl-xfs.c (main): Likewise. --- tests/ioctl_loop.c | 8 ++++---- tests/kexec_load.c | 2 +- tests/mq_sendrecv.c | 4 ++-- tests/perf_event_open.c | 5 ++--- tests/quotactl-xfs.c | 2 +- tests/quotactl.c | 4 ++-- 6 files changed, 12 insertions(+), 13 deletions(-) diff --git a/tests/ioctl_loop.c b/tests/ioctl_loop.c index 6946a2f4..a95e775d 100644 --- a/tests/ioctl_loop.c +++ b/tests/ioctl_loop.c @@ -215,7 +215,7 @@ main(void) ioctl(-1, LOOP_SET_STATUS, NULL); printf("ioctl(-1, LOOP_SET_STATUS, NULL) = -1 EBADF (%m)\n"); - fill_memory((void *) info, sizeof(*info)); + fill_memory(info, sizeof(*info)); info->lo_flags = 0xdeface00; info->lo_name[0] = '\0'; info->lo_encrypt_key[0] = '\0'; @@ -226,7 +226,7 @@ main(void) ioctl(-1, LOOP_SET_STATUS, info); printf(") = -1 EBADF (%m)\n"); - fill_memory((void *) info, sizeof(*info)); + fill_memory(info, sizeof(*info)); info->lo_encrypt_type = LO_CRYPT_NONE; info->lo_flags = LO_FLAGS_READ_ONLY; memset(info->lo_name, 'A', sizeof(info->lo_name)); @@ -253,7 +253,7 @@ main(void) ioctl(-1, LOOP_SET_STATUS64, NULL); printf("ioctl(-1, LOOP_SET_STATUS64, NULL) = -1 EBADF (%m)\n"); - fill_memory((void *) info64, sizeof(*info64)); + fill_memory(info64, sizeof(*info64)); info64->lo_flags = 0xdec0de00; info64->lo_file_name[0] = '\0'; info64->lo_crypt_name[0] = '\0'; @@ -265,7 +265,7 @@ main(void) ioctl(-1, LOOP_SET_STATUS64, info64); printf(") = -1 EBADF (%m)\n"); - fill_memory((void *) info64, sizeof(*info64)); + fill_memory(info64, sizeof(*info64)); info64->lo_flags = LO_FLAGS_READ_ONLY; info64->lo_encrypt_type = LO_CRYPT_NONE; memset(info64->lo_file_name, 'C', sizeof(info64->lo_file_name)); diff --git a/tests/kexec_load.c b/tests/kexec_load.c index 8eb0e272..330238de 100644 --- a/tests/kexec_load.c +++ b/tests/kexec_load.c @@ -85,7 +85,7 @@ main(void) struct segm *segms = tail_alloc(SEGMS_ARRAY_SIZE); unsigned int i; - fill_memory((char *) segms, SEGMS_ARRAY_SIZE); + fill_memory(segms, SEGMS_ARRAY_SIZE); segms[0].buf = segms[0].mem = NULL; rc = syscall(__NR_kexec_load, bogus_zero, bogus_zero, bogus_zero, diff --git a/tests/mq_sendrecv.c b/tests/mq_sendrecv.c index a5bed01b..c151542c 100644 --- a/tests/mq_sendrecv.c +++ b/tests/mq_sendrecv.c @@ -253,7 +253,7 @@ main(void) fill_memory_ex(msg, MSG_SIZE, MSG_START, MSG_SIZE); - fill_memory_ex((char *) bogus_attrs, sizeof(*bogus_attrs) * NUM_ATTRS, + fill_memory_ex(bogus_attrs, sizeof(*bogus_attrs) * NUM_ATTRS, 0xbb, 0x70); @@ -446,7 +446,7 @@ main(void) if (fd != 0) error_msg_and_skip("mq_open returned fd other than 0"); # endif - fill_memory_ex((char *) bogus_attrs, sizeof(*bogus_attrs) * NUM_ATTRS, + fill_memory_ex(bogus_attrs, sizeof(*bogus_attrs) * NUM_ATTRS, 0xbb, 0x70); printf("mq_open(\"" MQ_NAME "\", O_RDWR|O_CREAT|O_NONBLOCK, " "0700, {mq_flags=%#llx, mq_maxmsg=2, mq_msgsize=%u, " diff --git a/tests/perf_event_open.c b/tests/perf_event_open.c index acc0176d..0ffea292 100644 --- a/tests/perf_event_open.c +++ b/tests/perf_event_open.c @@ -712,7 +712,7 @@ main(void) size_t i; int rc; - fill_memory((char *) small_attr, sizeof(*small_attr)); + fill_memory(small_attr, sizeof(*small_attr)); small_attr->size = attr_small_size; for (i = 0; i < ARRAY_SIZE(args); i++) { @@ -740,8 +740,7 @@ main(void) size_t args_idx = i % ARRAY_SIZE(args); const char *ip_desc_str; - fill_memory_ex((char *) attr, size, - fill_start, 0xff); + fill_memory_ex(attr, size, fill_start, 0xff); attr->type = attr_types[type_idx].val; attr->size = size; diff --git a/tests/quotactl-xfs.c b/tests/quotactl-xfs.c index 657fe41e..e420d1c9 100644 --- a/tests/quotactl-xfs.c +++ b/tests/quotactl-xfs.c @@ -283,7 +283,7 @@ main(void) check_quota(CQF_NONE, ARG_STR(QCMD(Q_XSETQLIM, PRJQUOTA)), bogus_special, bogus_special_str, 0, bogus_addr); - fill_memory_ex((char *) xdq, sizeof(*xdq), 0x8e, 0x80); + fill_memory_ex(xdq, sizeof(*xdq), 0x8e, 0x80); check_quota(CQF_ADDR_CB, ARG_STR(QCMD(Q_XSETQLIM, PRJQUOTA)), bogus_dev, bogus_dev_str, 3141592653U, diff --git a/tests/quotactl.c b/tests/quotactl.c index a01040a7..3a7c1132 100644 --- a/tests/quotactl.c +++ b/tests/quotactl.c @@ -249,7 +249,7 @@ main(void) /* Q_SETQUOTA */ - fill_memory((char *) dqblk, sizeof(*dqblk)); + fill_memory(dqblk, sizeof(*dqblk)); check_quota(CQF_NONE, ARG_STR(QCMD(Q_SETQUOTA, PRJQUOTA)), bogus_special, bogus_special_str, 0, bogus_addr); @@ -272,7 +272,7 @@ main(void) /* Q_SETINFO */ - fill_memory((char *) dqinfo, sizeof(*dqinfo)); + fill_memory(dqinfo, sizeof(*dqinfo)); /* In order to check flag printing correctness */ dqinfo->dqi_flags = 0xdeadabcd; -- 2.40.0