From 17ef76b3d1e2a7e494399b5b204f41aac421b134 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Thu, 7 Mar 2019 17:54:26 +0000 Subject: [PATCH] Change (int)ARRAY_SIZE(...) back into ARRAY_SIZE(...) This patch does not change any functionality. git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8012 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/dev_handlers/scst_user.c | 8 ++++---- scst/src/scst_lib.c | 6 +++--- scst/src/scst_main.c | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/scst/src/dev_handlers/scst_user.c b/scst/src/dev_handlers/scst_user.c index b800fb67e..eb6798995 100644 --- a/scst/src/dev_handlers/scst_user.c +++ b/scst/src/dev_handlers/scst_user.c @@ -2754,7 +2754,7 @@ static int dev_user_unjam_dev(struct scst_user_dev *dev) spin_lock_irq(&dev->udev_cmd_threads.cmd_list_lock); repeat: - for (i = 0; i < (int)ARRAY_SIZE(dev->ucmd_hash); i++) { + for (i = 0; i < ARRAY_SIZE(dev->ucmd_hash); i++) { struct list_head *head = &dev->ucmd_hash[i]; list_for_each_entry(ucmd, head, hash_list_entry) { @@ -3368,7 +3368,7 @@ static int dev_user_register_dev(struct file *file, dev->blocking = 0; } else dev->blocking = 1; - for (i = 0; i < (int)ARRAY_SIZE(dev->ucmd_hash); i++) + for (i = 0; i < ARRAY_SIZE(dev->ucmd_hash); i++) INIT_LIST_HEAD(&dev->ucmd_hash[i]); scst_init_threads(&dev->udev_cmd_threads); @@ -3923,7 +3923,7 @@ static void dev_user_check_lost_ucmds(struct scst_user_dev *dev) { int i; - for (i = 0; i < (int)ARRAY_SIZE(dev->ucmd_hash); i++) { + for (i = 0; i < ARRAY_SIZE(dev->ucmd_hash); i++) { struct list_head *head = &dev->ucmd_hash[i]; struct scst_user_cmd *ucmd2, *tmp; @@ -4001,7 +4001,7 @@ static ssize_t dev_user_sysfs_commands_show(struct kobject *kobj, udev = dev->dh_priv; spin_lock_irqsave(&udev->udev_cmd_threads.cmd_list_lock, flags); - for (i = 0; i < (int)ARRAY_SIZE(udev->ucmd_hash); i++) { + for (i = 0; i < ARRAY_SIZE(udev->ucmd_hash); i++) { struct list_head *head = &udev->ucmd_hash[i]; struct scst_user_cmd *ucmd; diff --git a/scst/src/scst_lib.c b/scst/src/scst_lib.c index ba4f0c1e9..0220c4c42 100644 --- a/scst/src/scst_lib.c +++ b/scst/src/scst_lib.c @@ -1669,7 +1669,7 @@ static const struct scst_sdbops scst_scsi_op_table[] = { .get_cdb_info = get_cdb_info_len_10} }; -#define SCST_CDB_TBL_SIZE ((int)ARRAY_SIZE(scst_scsi_op_table)) +#define SCST_CDB_TBL_SIZE (ARRAY_SIZE(scst_scsi_op_table)) static void scst_del_tgt_dev(struct scst_tgt_dev *tgt_dev); static void scst_free_tgt_dev(struct scst_tgt_dev *tgt_dev); @@ -4162,7 +4162,7 @@ static void scst_init_order_data(struct scst_order_data *order_data) order_data->curr_sn = (typeof(order_data->curr_sn))(-20); order_data->expected_sn = order_data->curr_sn; order_data->cur_sn_slot = &order_data->sn_slots[0]; - for (i = 0; i < (int)ARRAY_SIZE(order_data->sn_slots); i++) + for (i = 0; i < ARRAY_SIZE(order_data->sn_slots); i++) atomic_set(&order_data->sn_slots[i], 0); spin_lock_init(&order_data->init_done_lock); return; @@ -15337,7 +15337,7 @@ static void __init scst_scsi_op_list_init(void) TRACE_ENTRY(); - TRACE_DBG("tblsize=%d", SCST_CDB_TBL_SIZE); + TRACE_DBG("tblsize=%zd", SCST_CDB_TBL_SIZE); for (i = 0; i < 256; i++) scst_scsi_op_list[i] = SCST_CDB_TBL_SIZE; diff --git a/scst/src/scst_main.c b/scst/src/scst_main.c index 39bd1c69b..1abab803c 100644 --- a/scst/src/scst_main.c +++ b/scst/src/scst_main.c @@ -826,7 +826,7 @@ int scst_get_cmd_counter(void) { int i, res = 0; - for (i = 0; i < (int)ARRAY_SIZE(scst_percpu_infos); i++) + for (i = 0; i < ARRAY_SIZE(scst_percpu_infos); i++) res += atomic_read(&scst_percpu_infos[i].cpu_cmd_count); return res; } @@ -2545,7 +2545,7 @@ static int __init init_scst(void) if (res != 0) goto out_destroy_sgv_pool; - for (i = 0; i < (int)ARRAY_SIZE(scst_percpu_infos); i++) { + for (i = 0; i < ARRAY_SIZE(scst_percpu_infos); i++) { atomic_set(&scst_percpu_infos[i].cpu_cmd_count, 0); spin_lock_init(&scst_percpu_infos[i].tasklet_lock); INIT_LIST_HEAD(&scst_percpu_infos[i].tasklet_cmd_list);