From: Bruce Allan Date: Mon, 27 Jul 2015 19:58:32 +0000 (-0700) Subject: crypto: qat - remove unnecessary list iteration X-Git-Tag: v4.3-rc3~6^2~93 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=caa8c508494c5de3ea70b44804abfd003f6b0107;p=platform%2Fkernel%2Flinux-exynos.git crypto: qat - remove unnecessary list iteration There's no need to iterate through the list for instances in the accel_table since the number of devices is already known in this file. Signed-off-by: Bruce Allan Signed-off-by: Tadeusz Struk Signed-off-by: Herbert Xu --- diff --git a/drivers/crypto/qat/qat_common/adf_dev_mgr.c b/drivers/crypto/qat/qat_common/adf_dev_mgr.c index 4bd38e3..b574a82 100644 --- a/drivers/crypto/qat/qat_common/adf_dev_mgr.c +++ b/drivers/crypto/qat/qat_common/adf_dev_mgr.c @@ -182,12 +182,7 @@ int adf_devmgr_verify_id(uint32_t id) void adf_devmgr_get_num_dev(uint32_t *num) { - struct list_head *itr; - - *num = 0; - list_for_each(itr, &accel_table) { - (*num)++; - } + *num = num_devices; } int adf_dev_in_use(struct adf_accel_dev *accel_dev)