Re: [PATCH] crypto: algapi - Remove skbuff.h inclusion

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

 



Hi Herbert,

I love your patch! Yet something to improve:

[auto build test ERROR on cryptodev/master]
[also build test ERROR on crypto/master rockchip/for-next v5.7 next-20200611]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Herbert-Xu/crypto-algapi-Remove-skbuff-h-inclusion/20200611-222332
base:   https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git master
config: m68k-allmodconfig (attached as .config)
compiler: m68k-linux-gcc (GCC) 9.3.0
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
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=m68k 

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

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

drivers/crypto/qcom-rng.c: In function 'qcom_rng_read':
>> drivers/crypto/qcom-rng.c:48:9: error: implicit declaration of function 'readl_relaxed' [-Werror=implicit-function-declaration]
48 |   val = readl_relaxed(rng->base + PRNG_STATUS);
|         ^~~~~~~~~~~~~
drivers/crypto/qcom-rng.c: In function 'qcom_rng_enable':
>> drivers/crypto/qcom-rng.c:115:2: error: implicit declaration of function 'writel' [-Werror=implicit-function-declaration]
115 |  writel(val, rng->base + PRNG_LFSR_CFG);
|  ^~~~~~
cc1: some warnings being treated as errors

vim +/readl_relaxed +48 drivers/crypto/qcom-rng.c

ceec5f5b59882b Vinod Koul 2018-07-16   40  
ceec5f5b59882b Vinod Koul 2018-07-16   41  static int qcom_rng_read(struct qcom_rng *rng, u8 *data, unsigned int max)
ceec5f5b59882b Vinod Koul 2018-07-16   42  {
ceec5f5b59882b Vinod Koul 2018-07-16   43  	unsigned int currsize = 0;
ceec5f5b59882b Vinod Koul 2018-07-16   44  	u32 val;
ceec5f5b59882b Vinod Koul 2018-07-16   45  
ceec5f5b59882b Vinod Koul 2018-07-16   46  	/* read random data from hardware */
ceec5f5b59882b Vinod Koul 2018-07-16   47  	do {
ceec5f5b59882b Vinod Koul 2018-07-16  @48  		val = readl_relaxed(rng->base + PRNG_STATUS);
ceec5f5b59882b Vinod Koul 2018-07-16   49  		if (!(val & PRNG_STATUS_DATA_AVAIL))
ceec5f5b59882b Vinod Koul 2018-07-16   50  			break;
ceec5f5b59882b Vinod Koul 2018-07-16   51  
ceec5f5b59882b Vinod Koul 2018-07-16   52  		val = readl_relaxed(rng->base + PRNG_DATA_OUT);
ceec5f5b59882b Vinod Koul 2018-07-16   53  		if (!val)
ceec5f5b59882b Vinod Koul 2018-07-16   54  			break;
ceec5f5b59882b Vinod Koul 2018-07-16   55  
ceec5f5b59882b Vinod Koul 2018-07-16   56  		if ((max - currsize) >= WORD_SZ) {
ceec5f5b59882b Vinod Koul 2018-07-16   57  			memcpy(data, &val, WORD_SZ);
ceec5f5b59882b Vinod Koul 2018-07-16   58  			data += WORD_SZ;
ceec5f5b59882b Vinod Koul 2018-07-16   59  			currsize += WORD_SZ;
ceec5f5b59882b Vinod Koul 2018-07-16   60  		} else {
ceec5f5b59882b Vinod Koul 2018-07-16   61  			/* copy only remaining bytes */
ceec5f5b59882b Vinod Koul 2018-07-16   62  			memcpy(data, &val, max - currsize);
ceec5f5b59882b Vinod Koul 2018-07-16   63  			break;
ceec5f5b59882b Vinod Koul 2018-07-16   64  		}
ceec5f5b59882b Vinod Koul 2018-07-16   65  	} while (currsize < max);
ceec5f5b59882b Vinod Koul 2018-07-16   66  
ceec5f5b59882b Vinod Koul 2018-07-16   67  	return currsize;
ceec5f5b59882b Vinod Koul 2018-07-16   68  }
ceec5f5b59882b Vinod Koul 2018-07-16   69  
ceec5f5b59882b Vinod Koul 2018-07-16   70  static int qcom_rng_generate(struct crypto_rng *tfm,
ceec5f5b59882b Vinod Koul 2018-07-16   71  			     const u8 *src, unsigned int slen,
ceec5f5b59882b Vinod Koul 2018-07-16   72  			     u8 *dstn, unsigned int dlen)
ceec5f5b59882b Vinod Koul 2018-07-16   73  {
ceec5f5b59882b Vinod Koul 2018-07-16   74  	struct qcom_rng_ctx *ctx = crypto_rng_ctx(tfm);
ceec5f5b59882b Vinod Koul 2018-07-16   75  	struct qcom_rng *rng = ctx->rng;
ceec5f5b59882b Vinod Koul 2018-07-16   76  	int ret;
ceec5f5b59882b Vinod Koul 2018-07-16   77  
ceec5f5b59882b Vinod Koul 2018-07-16   78  	ret = clk_prepare_enable(rng->clk);
ceec5f5b59882b Vinod Koul 2018-07-16   79  	if (ret)
ceec5f5b59882b Vinod Koul 2018-07-16   80  		return ret;
ceec5f5b59882b Vinod Koul 2018-07-16   81  
ceec5f5b59882b Vinod Koul 2018-07-16   82  	mutex_lock(&rng->lock);
ceec5f5b59882b Vinod Koul 2018-07-16   83  
ceec5f5b59882b Vinod Koul 2018-07-16   84  	ret = qcom_rng_read(rng, dstn, dlen);
ceec5f5b59882b Vinod Koul 2018-07-16   85  
ceec5f5b59882b Vinod Koul 2018-07-16   86  	mutex_unlock(&rng->lock);
ceec5f5b59882b Vinod Koul 2018-07-16   87  	clk_disable_unprepare(rng->clk);
ceec5f5b59882b Vinod Koul 2018-07-16   88  
ceec5f5b59882b Vinod Koul 2018-07-16   89  	return 0;
ceec5f5b59882b Vinod Koul 2018-07-16   90  }
ceec5f5b59882b Vinod Koul 2018-07-16   91  
ceec5f5b59882b Vinod Koul 2018-07-16   92  static int qcom_rng_seed(struct crypto_rng *tfm, const u8 *seed,
ceec5f5b59882b Vinod Koul 2018-07-16   93  			 unsigned int slen)
ceec5f5b59882b Vinod Koul 2018-07-16   94  {
ceec5f5b59882b Vinod Koul 2018-07-16   95  	return 0;
ceec5f5b59882b Vinod Koul 2018-07-16   96  }
ceec5f5b59882b Vinod Koul 2018-07-16   97  
ceec5f5b59882b Vinod Koul 2018-07-16   98  static int qcom_rng_enable(struct qcom_rng *rng)
ceec5f5b59882b Vinod Koul 2018-07-16   99  {
ceec5f5b59882b Vinod Koul 2018-07-16  100  	u32 val;
ceec5f5b59882b Vinod Koul 2018-07-16  101  	int ret;
ceec5f5b59882b Vinod Koul 2018-07-16  102  
ceec5f5b59882b Vinod Koul 2018-07-16  103  	ret = clk_prepare_enable(rng->clk);
ceec5f5b59882b Vinod Koul 2018-07-16  104  	if (ret)
ceec5f5b59882b Vinod Koul 2018-07-16  105  		return ret;
ceec5f5b59882b Vinod Koul 2018-07-16  106  
ceec5f5b59882b Vinod Koul 2018-07-16  107  	/* Enable PRNG only if it is not already enabled */
ceec5f5b59882b Vinod Koul 2018-07-16  108  	val = readl_relaxed(rng->base + PRNG_CONFIG);
ceec5f5b59882b Vinod Koul 2018-07-16  109  	if (val & PRNG_CONFIG_HW_ENABLE)
ceec5f5b59882b Vinod Koul 2018-07-16  110  		goto already_enabled;
ceec5f5b59882b Vinod Koul 2018-07-16  111  
ceec5f5b59882b Vinod Koul 2018-07-16  112  	val = readl_relaxed(rng->base + PRNG_LFSR_CFG);
ceec5f5b59882b Vinod Koul 2018-07-16  113  	val &= ~PRNG_LFSR_CFG_MASK;
ceec5f5b59882b Vinod Koul 2018-07-16  114  	val |= PRNG_LFSR_CFG_CLOCKS;
ceec5f5b59882b Vinod Koul 2018-07-16 @115  	writel(val, rng->base + PRNG_LFSR_CFG);
ceec5f5b59882b Vinod Koul 2018-07-16  116  
ceec5f5b59882b Vinod Koul 2018-07-16  117  	val = readl_relaxed(rng->base + PRNG_CONFIG);
ceec5f5b59882b Vinod Koul 2018-07-16  118  	val |= PRNG_CONFIG_HW_ENABLE;
ceec5f5b59882b Vinod Koul 2018-07-16  119  	writel(val, rng->base + PRNG_CONFIG);
ceec5f5b59882b Vinod Koul 2018-07-16  120  
ceec5f5b59882b Vinod Koul 2018-07-16  121  already_enabled:
ceec5f5b59882b Vinod Koul 2018-07-16  122  	clk_disable_unprepare(rng->clk);
ceec5f5b59882b Vinod Koul 2018-07-16  123  
ceec5f5b59882b Vinod Koul 2018-07-16  124  	return 0;
ceec5f5b59882b Vinod Koul 2018-07-16  125  }
ceec5f5b59882b Vinod Koul 2018-07-16  126  

:::::: The code at line 48 was first introduced by commit
:::::: ceec5f5b59882b871a722ca4d49b767a09a4bde9 crypto: qcom-rng - Add Qcom prng driver

:::::: TO: Vinod Koul <vkoul@xxxxxxxxxx>
:::::: CC: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>

---
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