diff mbox series

[02/13] scsi: ufs: qcom: Fix the return value of ufs_qcom_ice_program_key()

Message ID 20231201151417.65500-3-manivannan.sadhasivam@linaro.org (mailing list archive)
State Superseded
Headers show
Series scsi: ufs: qcom: Minor code cleanups | expand

Commit Message

Manivannan Sadhasivam Dec. 1, 2023, 3:14 p.m. UTC
Currently, the function returns -EINVAL if algorithm other than AES-256-XTS
is requested. But the correct error code is -EOPNOTSUPP. Fix it!

Cc: Abel Vesa <abel.vesa@linaro.org>
Fixes: 56541c7c4468 ("scsi: ufs: ufs-qcom: Switch to the new ICE API")
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
---
 drivers/ufs/host/ufs-qcom.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Abel Vesa Dec. 1, 2023, 5:49 p.m. UTC | #1
On 23-12-01 20:44:06, Manivannan Sadhasivam wrote:
> Currently, the function returns -EINVAL if algorithm other than AES-256-XTS
> is requested. But the correct error code is -EOPNOTSUPP. Fix it!
> 
> Cc: Abel Vesa <abel.vesa@linaro.org>
> Fixes: 56541c7c4468 ("scsi: ufs: ufs-qcom: Switch to the new ICE API")
> Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>

LGTM.

Reviewed-by: Abel Vesa <abel.vesa@linaro.org>

> ---
>  drivers/ufs/host/ufs-qcom.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/ufs/host/ufs-qcom.c b/drivers/ufs/host/ufs-qcom.c
> index cbb6a696cd97..852179e456f2 100644
> --- a/drivers/ufs/host/ufs-qcom.c
> +++ b/drivers/ufs/host/ufs-qcom.c
> @@ -158,7 +158,7 @@ static int ufs_qcom_ice_program_key(struct ufs_hba *hba,
>  	cap = hba->crypto_cap_array[cfg->crypto_cap_idx];
>  	if (cap.algorithm_id != UFS_CRYPTO_ALG_AES_XTS ||
>  	    cap.key_size != UFS_CRYPTO_KEY_SIZE_256)
> -		return -EINVAL;
> +		return -EOPNOTSUPP;
>  
>  	if (config_enable)
>  		return qcom_ice_program_key(host->ice,
> -- 
> 2.25.1
>
diff mbox series

Patch

diff --git a/drivers/ufs/host/ufs-qcom.c b/drivers/ufs/host/ufs-qcom.c
index cbb6a696cd97..852179e456f2 100644
--- a/drivers/ufs/host/ufs-qcom.c
+++ b/drivers/ufs/host/ufs-qcom.c
@@ -158,7 +158,7 @@  static int ufs_qcom_ice_program_key(struct ufs_hba *hba,
 	cap = hba->crypto_cap_array[cfg->crypto_cap_idx];
 	if (cap.algorithm_id != UFS_CRYPTO_ALG_AES_XTS ||
 	    cap.key_size != UFS_CRYPTO_KEY_SIZE_256)
-		return -EINVAL;
+		return -EOPNOTSUPP;
 
 	if (config_enable)
 		return qcom_ice_program_key(host->ice,