aboutsummaryrefslogtreecommitdiff
path: root/testing/sg_tst_ioctl.c
diff options
context:
space:
mode:
authorDouglas Gilbert <dgilbert@interlog.com>2020-09-03 15:32:35 +0000
committerDouglas Gilbert <dgilbert@interlog.com>2020-09-03 15:32:35 +0000
commita37cbfd6b346caf0af438f405a8e72fe69454005 (patch)
tree287e2c661580ae696095783225bedb1bf6fcdab9 /testing/sg_tst_ioctl.c
parente294cca49d78b88ed74f628353970ff907a77e05 (diff)
downloadsg3_utils-a37cbfd6b346caf0af438f405a8e72fe69454005.tar.gz
C++ fix in library, testing cleanup
git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@862 6180dd3e-e324-4e3e-922d-17de1ae2f315
Diffstat (limited to 'testing/sg_tst_ioctl.c')
-rw-r--r--testing/sg_tst_ioctl.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/testing/sg_tst_ioctl.c b/testing/sg_tst_ioctl.c
index 1fd91339..0dff9f1a 100644
--- a/testing/sg_tst_ioctl.c
+++ b/testing/sg_tst_ioctl.c
@@ -60,7 +60,7 @@
* later of the Linux sg driver. */
-static const char * version_str = "Version: 1.18 20200719";
+static const char * version_str = "Version: 1.19 20200825";
#define INQ_REPLY_LEN 128
#define INQ_CMD_LEN 6
@@ -110,7 +110,7 @@ static int dname_last = 0;
static int dname_pos = 0;
static int verbose = 0;
-static const char * relative_cp = NULL;
+static const char * relative_cp = "";
static char * file_name = NULL;
@@ -665,7 +665,7 @@ do_mrqs(int sg_fd, int sg_fd2, int mrqs)
mrq_h4p->flags = SGV4_FLAG_MULTIPLE_REQS;
if (mrq_immed)
mrq_h4p->flags |= SGV4_FLAG_IMMED;
- arr_v4 = calloc(mrqs, sizeof(struct sg_io_v4));
+ arr_v4 = (struct sg_io_v4 *)calloc(mrqs, sizeof(struct sg_io_v4));
if (NULL == arr_v4) {
res = ENOMEM;
goto fini;
@@ -1034,7 +1034,7 @@ dname_range_loop:
is_first = false;
if (nw_given)
- printf("Timing %dx%d calls to ioctl(SG_GET_NUM_WAITING)\n",
+ printf("Timing %d x %d calls to ioctl(SG_GET_NUM_WAITING)\n",
rang, num_sgnw);
else if (iterator_test >= 0) {
k = num_sgnw + 1000;
@@ -1144,10 +1144,10 @@ dname_range_loop:
if (num_sgnw >= 100) {
double m = (double)res_tm.tv_sec +
((double)res_tm.tv_nsec / 1000000000.0);
+ double num = num_sgnw;
if (m > 0.000001)
- printf("%sCalls per second: %.2f\n", relative_cp,
- (double)sum_nw / m);
+ printf("%sCalls per second: %.2f\n", relative_cp, num / m);
}
res = 0;
goto out;