[cryptodev:master 11/53] drivers/crypto/inside-secure/safexcel_cipher.c:2337:37: sparse: sparse: restricted __le32 degrades to integer

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

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git master
head:   4fd7d7befdb531920cae8f78afd4938e4a25e421
commit: 4a593fb35d5ccf3ddd41c68ac1cc88d06ec74341 [11/53] crypto: inside-secure - Added support for the CHACHA20 skcipher
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.1-rc1-42-g38eda53-dirty
        git checkout 4a593fb35d5ccf3ddd41c68ac1cc88d06ec74341
        make ARCH=x86_64 allmodconfig
        make C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'

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


sparse warnings: (new ones prefixed by >>)

   drivers/crypto/inside-secure/safexcel_cipher.c:83:46: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned int @@    got restricted __be32unsigned int @@
   drivers/crypto/inside-secure/safexcel_cipher.c:83:46: sparse:    expected unsigned int
   drivers/crypto/inside-secure/safexcel_cipher.c:83:46: sparse:    got restricted __be32 [usertype]
   drivers/crypto/inside-secure/safexcel_cipher.c:101:46: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned int @@    got restricted __be32unsigned int @@
   drivers/crypto/inside-secure/safexcel_cipher.c:101:46: sparse:    expected unsigned int
   drivers/crypto/inside-secure/safexcel_cipher.c:101:46: sparse:    got restricted __be32 [usertype]
   drivers/crypto/inside-secure/safexcel_cipher.c:253:35: sparse: sparse: cast from restricted __be16
   drivers/crypto/inside-secure/safexcel_cipher.c:253:33: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned int [usertype] @@    got restrunsigned int [usertype] @@
   drivers/crypto/inside-secure/safexcel_cipher.c:253:33: sparse:    expected unsigned int [usertype]
   drivers/crypto/inside-secure/safexcel_cipher.c:253:33: sparse:    got restricted __le32 [usertype]
   drivers/crypto/inside-secure/safexcel_cipher.c:2128:45: sparse: sparse: restricted __be32 degrades to integer
   drivers/crypto/inside-secure/safexcel_cipher.c:2136:30: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned int @@    got restricted __be32unsigned int @@
   drivers/crypto/inside-secure/safexcel_cipher.c:2136:30: sparse:    expected unsigned int
   drivers/crypto/inside-secure/safexcel_cipher.c:2136:30: sparse:    got restricted __be32 [usertype]
   drivers/crypto/inside-secure/safexcel_cipher.c:2227:65: sparse: sparse: incorrect type in assignment (different base types) @@    expected unsigned int @@    got restricted __be32unsigned int @@
   drivers/crypto/inside-secure/safexcel_cipher.c:2227:65: sparse:    expected unsigned int
   drivers/crypto/inside-secure/safexcel_cipher.c:2227:65: sparse:    got restricted __be32 [usertype]
>> drivers/crypto/inside-secure/safexcel_cipher.c:2337:37: sparse: sparse: restricted __le32 degrades to integer
>> drivers/crypto/inside-secure/safexcel_cipher.c:2346:29: sparse: sparse: incorrect type in assignment (different base types) @@    expected restricted __le32 @@    got icted __le32 @@
>> drivers/crypto/inside-secure/safexcel_cipher.c:2346:29: sparse:    expected restricted __le32
>> drivers/crypto/inside-secure/safexcel_cipher.c:2346:29: sparse:    got unsigned int

vim +2337 drivers/crypto/inside-secure/safexcel_cipher.c

  2322	
  2323	static int safexcel_skcipher_chacha20_setkey(struct crypto_skcipher *ctfm,
  2324						     const u8 *key, unsigned int len)
  2325	{
  2326		struct safexcel_cipher_ctx *ctx = crypto_skcipher_ctx(ctfm);
  2327		struct safexcel_crypto_priv *priv = ctx->priv;
  2328		int i;
  2329	
  2330		if (len != CHACHA_KEY_SIZE) {
  2331			crypto_skcipher_set_flags(ctfm, CRYPTO_TFM_RES_BAD_KEY_LEN);
  2332			return -EINVAL;
  2333		}
  2334	
  2335		if (priv->flags & EIP197_TRC_CACHE && ctx->base.ctxr_dma) {
  2336			for (i = 0; i < CHACHA_KEY_SIZE / sizeof(u32); i++) {
> 2337				if (ctx->key[i] !=
  2338				    get_unaligned_le32(key + i * sizeof(u32))) {
  2339					ctx->base.needs_inv = true;
  2340					break;
  2341				}
  2342			}
  2343		}
  2344	
  2345		for (i = 0; i < CHACHA_KEY_SIZE / sizeof(u32); i++)
> 2346			ctx->key[i] = get_unaligned_le32(key + i * sizeof(u32));
  2347		ctx->key_len = CHACHA_KEY_SIZE;
  2348	
  2349		return 0;
  2350	}
  2351	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation



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

  Powered by Linux