]> www.infradead.org Git - users/jedix/linux-maple.git/commit
scsi: soc: qcom: ice: Make qcom_ice_program_key() take struct blk_crypto_key
authorEric Biggers <ebiggers@google.com>
Fri, 4 Apr 2025 23:15:30 +0000 (16:15 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Sat, 12 Apr 2025 01:10:29 +0000 (21:10 -0400)
commit11d4c388a38ab6e95a7be82a44a55ecc32cd6a14
tree5cac053548a61aebe0f003a43c92a3672da8d0f2
parent0af2f6be1b4281385b618cb86ad946eded089ac8
scsi: soc: qcom: ice: Make qcom_ice_program_key() take struct blk_crypto_key

qcom_ice_program_key() currently accepts the key as an array of bytes,
algorithm ID, key size enum, and data unit size.  However both callers
have a struct blk_crypto_key which contains all that information.  Thus
they both have similar code that converts the blk_crypto_key into the
form that qcom_ice_program_key() wants.  Once wrapped key support is
added, the key type would need to be added to the arguments too.

Therefore, this patch changes qcom_ice_program_key() to take in all this
information as a struct blk_crypto_key directly.  The calling code is
updated accordingly.  This ends up being much simpler, and it makes the
key type be passed down automatically once wrapped key support is added.

Based on a patch by Gaurav Kashyap <quic_gaurkash@quicinc.com> that
replaced the byte array argument only.  This patch makes the
blk_crypto_key replace other arguments like the algorithm ID too,
ensuring that there remains only one source of truth.

Acked-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Tested-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> # sm8650
Signed-off-by: Eric Biggers <ebiggers@google.com>
Link: https://lore.kernel.org/r/20250404231533.174419-2-ebiggers@kernel.org
Acked-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Acked-by: Ulf Hansson <ulf.hansson@linaro.org> # For MMC
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/mmc/host/sdhci-msm.c
drivers/soc/qcom/ice.c
drivers/ufs/host/ufs-qcom.c
include/soc/qcom/ice.h