2022-01-04 21:39:07

by Muhammad Usama Anjum

[permalink] [raw]
Subject: [PATCH] crypto: use signed variable to store status and error checking

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 <[email protected]>
---
drivers/crypto/qat/qat_4xxx/adf_4xxx_hw_data.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

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);
--
2.30.2



2022-01-05 12:13:59

by Cabiddu, Giovanni

[permalink] [raw]
Subject: Re: [PATCH] crypto: use signed variable to store status and error checking

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 <[email protected]>
After fixing,
Acked-by: Giovanni Cabiddu <[email protected]>

Regards,

--
Giovanni