Re: [PATCH 3/5] crypto: tegra: Add Tegra Security Engine driver

From: kernel test robot
Date: Thu Dec 14 2023 - 13:09:55 EST


Hi Akhil,

kernel test robot noticed the following build warnings:

[auto build test WARNING on herbert-cryptodev-2.6/master]
[also build test WARNING on drm/drm-next arm64/for-next/core robh/for-next linus/master v6.7-rc5 next-20231214]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url: https://github.com/intel-lab-lkp/linux/commits/Akhil-R/dt-bindings-crypto-Add-Tegra-SE-DT-binding-doc/20231213-202407
base: https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git master
patch link: https://lore.kernel.org/r/20231213122030.11734-4-akhilrajeev%40nvidia.com
patch subject: [PATCH 3/5] crypto: tegra: Add Tegra Security Engine driver
config: parisc-allmodconfig (https://download.01.org/0day-ci/archive/20231215/202312150118.ydw2nowl-lkp@xxxxxxxxx/config)
compiler: hppa-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231215/202312150118.ydw2nowl-lkp@xxxxxxxxx/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202312150118.ydw2nowl-lkp@xxxxxxxxx/

All warnings (new ones prefixed by >>):

In file included from drivers/crypto/tegra/tegra-se-hash.c:22:
drivers/crypto/tegra/tegra-se-hash.c: In function 'tegra_sha_get_config':
drivers/crypto/tegra/tegra-se.h:55:57: error: implicit declaration of function 'FIELD_PREP' [-Werror=implicit-function-declaration]
55 | #define SE_SHA_CFG_ENC_ALG(x) FIELD_PREP(GENMASK(15, 12), x)
| ^~~~~~~~~~
drivers/crypto/tegra/tegra-se.h:59:57: note: in expansion of macro 'SE_SHA_CFG_ENC_ALG'
59 | #define SE_SHA_ENC_ALG_SHA SE_SHA_CFG_ENC_ALG(3)
| ^~~~~~~~~~~~~~~~~~
drivers/crypto/tegra/tegra-se-hash.c:53:24: note: in expansion of macro 'SE_SHA_ENC_ALG_SHA'
53 | cfg |= SE_SHA_ENC_ALG_SHA;
| ^~~~~~~~~~~~~~~~~~
drivers/crypto/tegra/tegra-se-hash.c: In function 'tegra_sha_init':
>> drivers/crypto/tegra/tegra-se-hash.c:457:21: warning: variable 'algname' set but not used [-Wunused-but-set-variable]
457 | const char *algname;
| ^~~~~~~
cc1: some warnings being treated as errors


vim +/algname +457 drivers/crypto/tegra/tegra-se-hash.c

450
451 static int tegra_sha_init(struct ahash_request *req)
452 {
453 struct tegra_sha_reqctx *rctx = ahash_request_ctx(req);
454 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req);
455 struct tegra_sha_ctx *ctx = crypto_ahash_ctx(tfm);
456 struct tegra_se *se = ctx->se;
> 457 const char *algname;
458
459 if (ctx->fallback)
460 return tegra_sha_fallback_init(req);
461
462 algname = crypto_tfm_alg_name(&tfm->base);
463
464 rctx->total_len = 0;
465 rctx->datbuf.size = 0;
466 rctx->residue.size = 0;
467 rctx->key_id = ctx->key_id;
468 rctx->task = SHA_FIRST;
469 rctx->alg = ctx->alg;
470 rctx->blk_size = crypto_ahash_blocksize(tfm);
471 rctx->digest.size = crypto_ahash_digestsize(tfm);
472
473 rctx->digest.buf = dma_alloc_coherent(se->dev, rctx->digest.size,
474 &rctx->digest.addr, GFP_KERNEL);
475 if (!rctx->digest.buf)
476 goto digbuf_fail;
477
478 rctx->residue.buf = dma_alloc_coherent(se->dev, rctx->blk_size,
479 &rctx->residue.addr, GFP_KERNEL);
480 if (!rctx->residue.buf)
481 goto resbuf_fail;
482
483 rctx->datbuf.buf = dma_alloc_coherent(se->dev, SE_SHA_BUFLEN,
484 &rctx->datbuf.addr, GFP_KERNEL);
485 if (!rctx->datbuf.buf)
486 goto datbuf_fail;
487
488 return 0;
489
490 datbuf_fail:
491 dma_free_coherent(se->dev, rctx->blk_size, rctx->residue.buf,
492 rctx->residue.addr);
493 resbuf_fail:
494 dma_free_coherent(se->dev, SE_SHA_BUFLEN, rctx->datbuf.buf,
495 rctx->datbuf.addr);
496 digbuf_fail:
497 return -ENOMEM;
498 }
499

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki