crypto: qat - remove unnecessary list iteration
authorBruce Allan <bruce.w.allan@intel.com>
Mon, 27 Jul 2015 19:58:32 +0000 (12:58 -0700)
committerHerbert Xu <herbert@gondor.apana.org.au>
Tue, 28 Jul 2015 07:03:35 +0000 (15:03 +0800)
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 <bruce.w.allan@intel.com>
Signed-off-by: Tadeusz Struk <tadeusz.struk@intel.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/qat/qat_common/adf_dev_mgr.c

index 4bd38e362884c542fba66542be918beb2286f37f..b574a82368a40bc9e7714ca17503e5c8077c77ed 100644 (file)
@@ -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)