From df0088f50712f9540769c542d0b4d27acc4fc527 Mon Sep 17 00:00:00 2001 From: Tadeusz Struk Date: Fri, 25 Jul 2014 15:55:32 -0700 Subject: [PATCH] crypto: qat - use min_t macro prefer min_t() macro over two open-coded logical tests Signed-off-by: Bruce Allan Signed-off-by: Tadeusz Struk Signed-off-by: Herbert Xu --- drivers/crypto/qat/qat_common/qat_uclo.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/crypto/qat/qat_common/qat_uclo.c b/drivers/crypto/qat/qat_common/qat_uclo.c index 17a9954f831e..b1a16eb5a36d 100644 --- a/drivers/crypto/qat/qat_common/qat_uclo.c +++ b/drivers/crypto/qat/qat_common/qat_uclo.c @@ -901,8 +901,8 @@ static int qat_uclo_set_ae_mode(struct icp_qat_fw_loader_handle *handle) (unsigned long *)&handle->hal_handle->ae_mask)) continue; ae_data = &obj_handle->ae_data[ae]; - for (s = 0; s < ae_data->slice_num && s < ICP_QAT_UCLO_MAX_CTX; - s++) { + for (s = 0; s < min_t(unsigned int, ae_data->slice_num, + ICP_QAT_UCLO_MAX_CTX); s++) { if (!obj_handle->ae_data[ae].ae_slices[s].encap_image) continue; uof_image = ae_data->ae_slices[s].encap_image->img_ptr; -- 2.30.2