diff mbox series

crypto: use signed variable to store status and error checking

Message ID YdS+cgcyKdXUQaU+@debian-BULLSEYE-live-builder-AMD64
State New
Headers show
Series crypto: use signed variable to store status and error checking | expand

Commit Message

Muhammad Usama Anjum Jan. 4, 2022, 9:38 p.m. UTC
ret should be signed. adf_cfg_get_param_value and match_string return
signed statuses. The return status may be saved wrongly in unsigned ret
variable. Correct the data type of ret to signed int.

Signed-off-by: Muhammad Usama Anjum <usama.anjum@collabora.com>
---
 drivers/crypto/qat/qat_4xxx/adf_4xxx_hw_data.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Cabiddu, Giovanni Jan. 5, 2022, 12:13 p.m. UTC | #1
Thanks for your patch.

Patches to the qat driver have the following headline
     crypto: qat - ...
not just
     crypto: ...

On Wed, Jan 05, 2022 at 02:38:58AM +0500, Muhammad Usama Anjum wrote:
> ret should be signed. adf_cfg_get_param_value and match_string return
Use () when refer to the function().

> signed statuses. The return status may be saved wrongly in unsigned ret
> variable. Correct the data type of ret to signed int.
> 
> Signed-off-by: Muhammad Usama Anjum <usama.anjum@collabora.com>
After fixing,
Acked-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com>

Regards,
diff mbox series

Patch

diff --git a/drivers/crypto/qat/qat_4xxx/adf_4xxx_hw_data.c b/drivers/crypto/qat/qat_4xxx/adf_4xxx_hw_data.c
index 6d10edc40aca..68d39c833332 100644
--- a/drivers/crypto/qat/qat_4xxx/adf_4xxx_hw_data.c
+++ b/drivers/crypto/qat/qat_4xxx/adf_4xxx_hw_data.c
@@ -52,7 +52,7 @@  static const char *const dev_cfg_services[] = {
 static int get_service_enabled(struct adf_accel_dev *accel_dev)
 {
 	char services[ADF_CFG_MAX_VAL_LEN_IN_BYTES] = {0};
-	u32 ret;
+	int ret;
 
 	ret = adf_cfg_get_param_value(accel_dev, ADF_GENERAL_SEC,
 				      ADF_SERVICES_ENABLED, services);