File tree 1 file changed +8
-10
lines changed
1 file changed +8
-10
lines changed Original file line number Diff line number Diff line change @@ -155,23 +155,21 @@ static int ufs_qcom_ice_program_key(struct ufs_hba *hba,
155
155
{
156
156
struct ufs_qcom_host * host = ufshcd_get_variant (hba );
157
157
union ufs_crypto_cap_entry cap ;
158
- bool config_enable =
159
- cfg -> config_enable & UFS_CRYPTO_CONFIGURATION_ENABLE ;
158
+
159
+ if (!(cfg -> config_enable & UFS_CRYPTO_CONFIGURATION_ENABLE ))
160
+ return qcom_ice_evict_key (host -> ice , slot );
160
161
161
162
/* Only AES-256-XTS has been tested so far. */
162
163
cap = hba -> crypto_cap_array [cfg -> crypto_cap_idx ];
163
164
if (cap .algorithm_id != UFS_CRYPTO_ALG_AES_XTS ||
164
165
cap .key_size != UFS_CRYPTO_KEY_SIZE_256 )
165
166
return - EOPNOTSUPP ;
166
167
167
- if (config_enable )
168
- return qcom_ice_program_key (host -> ice ,
169
- QCOM_ICE_CRYPTO_ALG_AES_XTS ,
170
- QCOM_ICE_CRYPTO_KEY_SIZE_256 ,
171
- cfg -> crypto_key ,
172
- cfg -> data_unit_size , slot );
173
- else
174
- return qcom_ice_evict_key (host -> ice , slot );
168
+ return qcom_ice_program_key (host -> ice ,
169
+ QCOM_ICE_CRYPTO_ALG_AES_XTS ,
170
+ QCOM_ICE_CRYPTO_KEY_SIZE_256 ,
171
+ cfg -> crypto_key ,
172
+ cfg -> data_unit_size , slot );
175
173
}
176
174
177
175
#else
You can’t perform that action at this time.
0 commit comments