From 393165d66ad4a2f31061e3400e6849f6985aab08 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Fri, 2 Oct 2015 14:09:04 -0700 Subject: [PATCH] test-tool: Remove three casts This patch does not change any functionality but removes the number of casts in the test tool source code. Signed-off-by: Bart Van Assche --- test-tool/iscsi-support.h | 6 +++--- test-tool/iscsi-test-cu.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/test-tool/iscsi-support.h b/test-tool/iscsi-support.h index df7fb11..df4c65a 100644 --- a/test-tool/iscsi-support.h +++ b/test-tool/iscsi-support.h @@ -198,13 +198,13 @@ extern int sbc3_support; extern int maximum_transfer_length; struct scsi_device { - const char *error_str; + char *error_str; struct iscsi_context *iscsi_ctx; int iscsi_lun; - const char *iscsi_url; + char *iscsi_url; - const char *sgio_dev; + char *sgio_dev; int sgio_fd; }; extern struct scsi_device *sd; diff --git a/test-tool/iscsi-test-cu.c b/test-tool/iscsi-test-cu.c index cb34f78..adc05e3 100644 --- a/test-tool/iscsi-test-cu.c +++ b/test-tool/iscsi-test-cu.c @@ -991,11 +991,11 @@ static int connect_scsi_device(struct scsi_device *sdev, const char *initiatorna static void free_scsi_device(struct scsi_device *sdev) { if (sdev->error_str) { - free(discard_const(sdev->error_str)); + free(sdev->error_str); sdev->error_str = NULL; } if (sdev->iscsi_url) { - free(discard_const(sdev->iscsi_url)); + free(sdev->iscsi_url); sdev->iscsi_url = NULL; } if (sdev->iscsi_ctx) { @@ -1005,7 +1005,7 @@ static void free_scsi_device(struct scsi_device *sdev) } if (sdev->sgio_dev) { - free(discard_const(sdev->sgio_dev)); + free(sdev->sgio_dev); sdev->sgio_dev = NULL; } if (sdev->sgio_fd != -1) {