Skip to content

Commit 347bce3

Browse files
committed
crypto: ux500 - Fix COMPILE_TEST warnings
This patch fixes a number of warnings encountered when this driver is built on a 64-bit platform with COMPILE_TEST. Signed-off-by: Herbert Xu <[email protected]>
1 parent f6680cb commit 347bce3

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

drivers/crypto/ux500/cryp/cryp_core.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -528,9 +528,9 @@ static int cryp_set_dma_transfer(struct cryp_ctx *ctx,
528528

529529
dev_dbg(ctx->device->dev, "[%s]: ", __func__);
530530

531-
if (unlikely(!IS_ALIGNED((u32)sg, 4))) {
531+
if (unlikely(!IS_ALIGNED((unsigned long)sg, 4))) {
532532
dev_err(ctx->device->dev, "[%s]: Data in sg list isn't "
533-
"aligned! Addr: 0x%08x", __func__, (u32)sg);
533+
"aligned! Addr: 0x%08lx", __func__, (unsigned long)sg);
534534
return -EFAULT;
535535
}
536536

@@ -763,9 +763,9 @@ static int hw_crypt_noxts(struct cryp_ctx *ctx,
763763

764764
ctx->outlen = ctx->datalen;
765765

766-
if (unlikely(!IS_ALIGNED((u32)indata, 4))) {
766+
if (unlikely(!IS_ALIGNED((unsigned long)indata, 4))) {
767767
pr_debug(DEV_DBG_NAME " [%s]: Data isn't aligned! Addr: "
768-
"0x%08x", __func__, (u32)indata);
768+
"0x%08lx", __func__, (unsigned long)indata);
769769
return -EINVAL;
770770
}
771771

drivers/crypto/ux500/hash/hash_core.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -806,7 +806,7 @@ static int hash_process_data(struct hash_device_data *device_data,
806806
* HW peripheral, otherwise we first copy data
807807
* to a local buffer
808808
*/
809-
if ((0 == (((u32)data_buffer) % 4)) &&
809+
if (IS_ALIGNED((unsigned long)data_buffer, 4) &&
810810
(0 == *index))
811811
hash_processblock(device_data,
812812
(const u32 *)data_buffer,
@@ -864,7 +864,8 @@ static int hash_dma_final(struct ahash_request *req)
864864
if (ret)
865865
return ret;
866866

867-
dev_dbg(device_data->dev, "%s: (ctx=0x%x)!\n", __func__, (u32) ctx);
867+
dev_dbg(device_data->dev, "%s: (ctx=0x%lx)!\n", __func__,
868+
(unsigned long)ctx);
868869

869870
if (req_ctx->updated) {
870871
ret = hash_resume_state(device_data, &device_data->state);
@@ -969,7 +970,8 @@ static int hash_hw_final(struct ahash_request *req)
969970
if (ret)
970971
return ret;
971972

972-
dev_dbg(device_data->dev, "%s: (ctx=0x%x)!\n", __func__, (u32) ctx);
973+
dev_dbg(device_data->dev, "%s: (ctx=0x%lx)!\n", __func__,
974+
(unsigned long)ctx);
973975

974976
if (req_ctx->updated) {
975977
ret = hash_resume_state(device_data, &device_data->state);
@@ -1272,8 +1274,8 @@ void hash_get_digest(struct hash_device_data *device_data,
12721274
else
12731275
loop_ctr = SHA256_DIGEST_SIZE / sizeof(u32);
12741276

1275-
dev_dbg(device_data->dev, "%s: digest array:(0x%x)\n",
1276-
__func__, (u32) digest);
1277+
dev_dbg(device_data->dev, "%s: digest array:(0x%lx)\n",
1278+
__func__, (unsigned long)digest);
12771279

12781280
/* Copy result into digest array */
12791281
for (count = 0; count < loop_ctr; count++) {

0 commit comments

Comments
 (0)