Re: [PATCH v3 13/14] crypto: sun8i-ce: Add support for the PRNG

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Corentin,

I love your patch! Perhaps something to improve:

[auto build test WARNING on sunxi/sunxi/for-next]
[also build test WARNING on cryptodev/master crypto/master v5.8-rc2]
[cannot apply to next-20200621]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use  as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Corentin-Labbe/crypto-allwinner-add-xRNG-and-hashes/20200622-033401
base:   https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux.git sunxi/for-next
config: x86_64-allyesconfig (attached as .config)
compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project ef455a55bcf2cfea04a99c361b182ad18b7f03f1)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install x86_64 cross compiling tool for clang build
        # apt-get install binutils-x86-64-linux-gnu
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All warnings (new ones prefixed by >>, old ones prefixed by <<):

>> drivers/crypto/allwinner/sun8i-ce/sun8i-ce-core.c:818:26: warning: result of comparison of constant 255 with expression of type 'const char' is always false [-Wtautological-constant-out-of-range-compare]
if (ce->variant->prng == CE_ID_NOTSUPP) {
~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~
1 warning generated.

vim +818 drivers/crypto/allwinner/sun8i-ce/sun8i-ce-core.c

   761	
   762	static int sun8i_ce_register_algs(struct sun8i_ce_dev *ce)
   763	{
   764		int ce_method, err, id, i;
   765	
   766		for (i = 0; i < ARRAY_SIZE(ce_algs); i++) {
   767			ce_algs[i].ce = ce;
   768			switch (ce_algs[i].type) {
   769			case CRYPTO_ALG_TYPE_SKCIPHER:
   770				id = ce_algs[i].ce_algo_id;
   771				ce_method = ce->variant->alg_cipher[id];
   772				if (ce_method == CE_ID_NOTSUPP) {
   773					dev_dbg(ce->dev,
   774						"DEBUG: Algo of %s not supported\n",
   775						ce_algs[i].alg.skcipher.base.cra_name);
   776					ce_algs[i].ce = NULL;
   777					break;
   778				}
   779				id = ce_algs[i].ce_blockmode;
   780				ce_method = ce->variant->op_mode[id];
   781				if (ce_method == CE_ID_NOTSUPP) {
   782					dev_dbg(ce->dev, "DEBUG: Blockmode of %s not supported\n",
   783						ce_algs[i].alg.skcipher.base.cra_name);
   784					ce_algs[i].ce = NULL;
   785					break;
   786				}
   787				dev_info(ce->dev, "Register %s\n",
   788					 ce_algs[i].alg.skcipher.base.cra_name);
   789				err = crypto_register_skcipher(&ce_algs[i].alg.skcipher);
   790				if (err) {
   791					dev_err(ce->dev, "ERROR: Fail to register %s\n",
   792						ce_algs[i].alg.skcipher.base.cra_name);
   793					ce_algs[i].ce = NULL;
   794					return err;
   795				}
   796				break;
   797			case CRYPTO_ALG_TYPE_AHASH:
   798				id = ce_algs[i].ce_algo_id;
   799				ce_method = ce->variant->alg_hash[id];
   800				if (ce_method == CE_ID_NOTSUPP) {
   801					dev_info(ce->dev,
   802						 "DEBUG: Algo of %s not supported\n",
   803						 ce_algs[i].alg.hash.halg.base.cra_name);
   804					ce_algs[i].ce = NULL;
   805					break;
   806				}
   807				dev_info(ce->dev, "Register %s\n",
   808					 ce_algs[i].alg.hash.halg.base.cra_name);
   809				err = crypto_register_ahash(&ce_algs[i].alg.hash);
   810				if (err) {
   811					dev_err(ce->dev, "ERROR: Fail to register %s\n",
   812						ce_algs[i].alg.hash.halg.base.cra_name);
   813					ce_algs[i].ce = NULL;
   814					return err;
   815				}
   816				break;
   817			case CRYPTO_ALG_TYPE_RNG:
 > 818				if (ce->variant->prng == CE_ID_NOTSUPP) {
   819					dev_info(ce->dev,
   820						 "DEBUG: Algo of %s not supported\n",
   821						 ce_algs[i].alg.rng.base.cra_name);
   822					ce_algs[i].ce = NULL;
   823					break;
   824				}
   825				dev_info(ce->dev, "Register %s\n",
   826					 ce_algs[i].alg.rng.base.cra_name);
   827				err = crypto_register_rng(&ce_algs[i].alg.rng);
   828				if (err) {
   829					dev_err(ce->dev, "Fail to register %s\n",
   830						ce_algs[i].alg.rng.base.cra_name);
   831					ce_algs[i].ce = NULL;
   832				}
   833				break;
   834			default:
   835				ce_algs[i].ce = NULL;
   836				dev_err(ce->dev, "ERROR: tried to register an unknown algo\n");
   837			}
   838		}
   839		return 0;
   840	}
   841	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]

  Powered by Linux