linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: linux-next: build warnings after merge of the crypto tree
       [not found] <20170206122837.0226fb89@canb.auug.org.au>
@ 2017-02-06  9:03 ` Herbert Xu
  2017-02-06 12:54   ` crypto: atmel - Fix authenc compile test warnings kbuild test robot
                     ` (3 more replies)
  0 siblings, 4 replies; 15+ messages in thread
From: Herbert Xu @ 2017-02-06  9:03 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: linux-next, linux-kernel, Cyrille Pitchen, Linux Crypto Mailing List

Hi Stephen:

On Mon, Feb 06, 2017 at 12:28:37PM +1100, Stephen Rothwell wrote:
> 
> After merging the crypto tree, today's linux-next build (x86_64
> allmodconfig) produced these warnings:
> 
> warning: (CRYPTO_DEV_ATMEL_AUTHENC) selects CRYPTO_DEV_ATMEL_SHA which has unmet direct dependencies (CRYPTO && CRYPTO_HW && ARCH_AT91)
> warning: (CRYPTO_DEV_ATMEL_AUTHENC) selects CRYPTO_DEV_ATMEL_SHA which has unmet direct dependencies (CRYPTO && CRYPTO_HW && ARCH_AT91)
> 
> Introduced by commit
> 
>   89a82ef87e01 ("crypto: atmel-authenc - add support to authenc(hmac(shaX), Y(aes)) modes")
> 
> In file included from include/linux/printk.h:329:0,
>                  from include/linux/kernel.h:13,
>                  from drivers/crypto/atmel-sha.c:17:

This patch should fix both issues.  Thanks,

---8<---
Subject: crypto: atmel - Fix authenc compile test warnings

The authenc code depends on the sha code so in order to allow
compile testing on the former we must allow it on sha as well.

This patch enables compile testing on sha as well as tdes and
fixes the few x86-64 warnings that arise in the sha code.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

diff --git a/drivers/crypto/Kconfig b/drivers/crypto/Kconfig
index 7482461..9b7e19e 100644
--- a/drivers/crypto/Kconfig
+++ b/drivers/crypto/Kconfig
@@ -444,7 +444,7 @@ config CRYPTO_DEV_ATMEL_AES
 
 config CRYPTO_DEV_ATMEL_TDES
 	tristate "Support for Atmel DES/TDES hw accelerator"
-	depends on ARCH_AT91
+	depends on ARCH_AT91 || COMPILE_TEST
 	select CRYPTO_DES
 	select CRYPTO_BLKCIPHER
 	help
@@ -457,7 +457,7 @@ config CRYPTO_DEV_ATMEL_TDES
 
 config CRYPTO_DEV_ATMEL_SHA
 	tristate "Support for Atmel SHA hw accelerator"
-	depends on ARCH_AT91
+	depends on ARCH_AT91 || COMPILE_TEST
 	select CRYPTO_HASH
 	help
 	  Some Atmel processors have SHA1/SHA224/SHA256/SHA384/SHA512
diff --git a/drivers/crypto/atmel-sha.c b/drivers/crypto/atmel-sha.c
index 22d0c0c..b081e78 100644
--- a/drivers/crypto/atmel-sha.c
+++ b/drivers/crypto/atmel-sha.c
@@ -568,7 +568,7 @@ static int atmel_sha_xmit_cpu(struct atmel_sha_dev *dd, const u8 *buf,
 	int count, len32;
 	const u32 *buffer = (const u32 *)buf;
 
-	dev_dbg(dd->dev, "xmit_cpu: digcnt: 0x%llx 0x%llx, length: %d, final: %d\n",
+	dev_dbg(dd->dev, "xmit_cpu: digcnt: 0x%llx 0x%llx, length: %zu, final: %d\n",
 		ctx->digcnt[1], ctx->digcnt[0], length, final);
 
 	atmel_sha_write_ctrl(dd, 0);
@@ -597,7 +597,7 @@ static int atmel_sha_xmit_pdc(struct atmel_sha_dev *dd, dma_addr_t dma_addr1,
 	struct atmel_sha_reqctx *ctx = ahash_request_ctx(dd->req);
 	int len32;
 
-	dev_dbg(dd->dev, "xmit_pdc: digcnt: 0x%llx 0x%llx, length: %d, final: %d\n",
+	dev_dbg(dd->dev, "xmit_pdc: digcnt: 0x%llx 0x%llx, length: %zu, final: %d\n",
 		ctx->digcnt[1], ctx->digcnt[0], length1, final);
 
 	len32 = DIV_ROUND_UP(length1, sizeof(u32));
@@ -644,7 +644,7 @@ static int atmel_sha_xmit_dma(struct atmel_sha_dev *dd, dma_addr_t dma_addr1,
 	struct dma_async_tx_descriptor	*in_desc;
 	struct scatterlist sg[2];
 
-	dev_dbg(dd->dev, "xmit_dma: digcnt: 0x%llx 0x%llx, length: %d, final: %d\n",
+	dev_dbg(dd->dev, "xmit_dma: digcnt: 0x%llx 0x%llx, length: %zu, final: %d\n",
 		ctx->digcnt[1], ctx->digcnt[0], length1, final);
 
 	dd->dma_lch_in.dma_conf.src_maxburst = 16;
@@ -723,7 +723,7 @@ static int atmel_sha_xmit_dma_map(struct atmel_sha_dev *dd,
 	ctx->dma_addr = dma_map_single(dd->dev, ctx->buffer,
 				ctx->buflen + ctx->block_size, DMA_TO_DEVICE);
 	if (dma_mapping_error(dd->dev, ctx->dma_addr)) {
-		dev_err(dd->dev, "dma %u bytes error\n", ctx->buflen +
+		dev_err(dd->dev, "dma %zu bytes error\n", ctx->buflen +
 				ctx->block_size);
 		atmel_sha_complete(dd, -EINVAL);
 	}
@@ -744,7 +744,7 @@ static int atmel_sha_update_dma_slow(struct atmel_sha_dev *dd)
 
 	final = (ctx->flags & SHA_FLAGS_FINUP) && !ctx->total;
 
-	dev_dbg(dd->dev, "slow: bufcnt: %u, digcnt: 0x%llx 0x%llx, final: %d\n",
+	dev_dbg(dd->dev, "slow: bufcnt: %zu, digcnt: 0x%llx 0x%llx, final: %d\n",
 		 ctx->bufcnt, ctx->digcnt[1], ctx->digcnt[0], final);
 
 	if (final)
@@ -772,7 +772,7 @@ static int atmel_sha_update_dma_start(struct atmel_sha_dev *dd)
 	if (ctx->bufcnt || ctx->offset)
 		return atmel_sha_update_dma_slow(dd);
 
-	dev_dbg(dd->dev, "fast: digcnt: 0x%llx 0x%llx, bufcnt: %u, total: %u\n",
+	dev_dbg(dd->dev, "fast: digcnt: 0x%llx 0x%llx, bufcnt: %zu, total: %u\n",
 		ctx->digcnt[1], ctx->digcnt[0], ctx->bufcnt, ctx->total);
 
 	sg = ctx->sg;
@@ -814,7 +814,7 @@ static int atmel_sha_update_dma_start(struct atmel_sha_dev *dd)
 		ctx->dma_addr = dma_map_single(dd->dev, ctx->buffer,
 			ctx->buflen + ctx->block_size, DMA_TO_DEVICE);
 		if (dma_mapping_error(dd->dev, ctx->dma_addr)) {
-			dev_err(dd->dev, "dma %u bytes error\n",
+			dev_err(dd->dev, "dma %zu bytes error\n",
 				ctx->buflen + ctx->block_size);
 			atmel_sha_complete(dd, -EINVAL);
 		}
@@ -994,7 +994,7 @@ static int atmel_sha_finish(struct ahash_request *req)
 	if (ctx->digcnt[0] || ctx->digcnt[1])
 		atmel_sha_copy_ready_hash(req);
 
-	dev_dbg(dd->dev, "digcnt: 0x%llx 0x%llx, bufcnt: %d\n", ctx->digcnt[1],
+	dev_dbg(dd->dev, "digcnt: 0x%llx 0x%llx, bufcnt: %zu\n", ctx->digcnt[1],
 		ctx->digcnt[0], ctx->bufcnt);
 
 	return 0;
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: crypto: atmel - Fix authenc compile test warnings
  2017-02-06  9:03 ` linux-next: build warnings after merge of the crypto tree Herbert Xu
@ 2017-02-06 12:54   ` kbuild test robot
  2017-02-06 16:58   ` kbuild test robot
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 15+ messages in thread
From: kbuild test robot @ 2017-02-06 12:54 UTC (permalink / raw)
  To: Herbert Xu
  Cc: kbuild-all, Stephen Rothwell, linux-next, linux-kernel,
	Cyrille Pitchen, Linux Crypto Mailing List

[-- Attachment #1: Type: text/plain, Size: 25982 bytes --]

Hi Herbert,

[auto build test WARNING on cryptodev/master]
[also build test WARNING on v4.10-rc7 next-20170206]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Herbert-Xu/crypto-atmel-Fix-authenc-compile-test-warnings/20170206-171201
base:   https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git master
config: ia64-allmodconfig (attached as .config)
compiler: ia64-linux-gcc (GCC) 6.2.0
reproduce:
        wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        make.cross ARCH=ia64 

All warnings (new ones prefixed by >>):

   In file included from drivers/crypto/atmel-tdes.c:17:0:
   drivers/crypto/atmel-tdes.c: In function 'atmel_tdes_sg_copy':
   include/linux/kernel.h:753:16: warning: comparison of distinct pointer types lacks a cast
     (void) (&min1 == &min2);   \
                   ^
   include/linux/kernel.h:756:2: note: in expansion of macro '__min'
     __min(typeof(x), typeof(y),   \
     ^~~~~
>> drivers/crypto/atmel-tdes.c:157:11: note: in expansion of macro 'min'
      count = min(count, buflen);
              ^~~
   In file included from include/linux/printk.h:6:0,
                    from include/linux/kernel.h:13,
                    from drivers/crypto/atmel-tdes.c:17:
   drivers/crypto/atmel-tdes.c: In function 'atmel_tdes_crypt_pdc_stop':
>> include/linux/kern_levels.h:4:18: warning: format '%u' expects argument of type 'unsigned int', but argument 2 has type 'size_t {aka long unsigned int}' [-Wformat=]
    #define KERN_SOH "\001"  /* ASCII Start Of Header */
                     ^
   include/linux/kern_levels.h:10:18: note: in expansion of macro 'KERN_SOH'
    #define KERN_ERR KERN_SOH "3" /* error conditions */
                     ^~~~~~~~
   include/linux/printk.h:292:9: note: in expansion of macro 'KERN_ERR'
     printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
            ^~~~~~~~
>> drivers/crypto/atmel-tdes.c:339:4: note: in expansion of macro 'pr_err'
       pr_err("not all data converted: %u\n", count);
       ^~~~~~
   drivers/crypto/atmel-tdes.c: In function 'atmel_tdes_buff_init':
>> drivers/crypto/atmel-tdes.c:364:26: warning: format '%d' expects argument of type 'int', but argument 3 has type 'size_t {aka long unsigned int}' [-Wformat=]
      dev_err(dd->dev, "dma %d bytes error\n", dd->buflen);
                             ^
   drivers/crypto/atmel-tdes.c:372:26: warning: format '%d' expects argument of type 'int', but argument 3 has type 'size_t {aka long unsigned int}' [-Wformat=]
      dev_err(dd->dev, "dma %d bytes error\n", dd->buflen);
                             ^
   In file included from drivers/crypto/atmel-tdes.c:17:0:
   drivers/crypto/atmel-tdes.c: In function 'atmel_tdes_crypt_start':
   include/linux/kernel.h:753:16: warning: comparison of distinct pointer types lacks a cast
     (void) (&min1 == &min2);   \
                   ^
   include/linux/kernel.h:756:2: note: in expansion of macro '__min'
     __min(typeof(x), typeof(y),   \
     ^~~~~
   drivers/crypto/atmel-tdes.c:528:11: note: in expansion of macro 'min'
      count = min(dd->total, sg_dma_len(dd->in_sg));
              ^~~
   include/linux/kernel.h:753:16: warning: comparison of distinct pointer types lacks a cast
     (void) (&min1 == &min2);   \
                   ^
   include/linux/kernel.h:756:2: note: in expansion of macro '__min'
     __min(typeof(x), typeof(y),   \
     ^~~~~
   drivers/crypto/atmel-tdes.c:529:11: note: in expansion of macro 'min'
      count = min(count, sg_dma_len(dd->out_sg));
              ^~~
   In file included from include/linux/printk.h:6:0,
                    from include/linux/kernel.h:13,
                    from drivers/crypto/atmel-tdes.c:17:
   drivers/crypto/atmel-tdes.c: In function 'atmel_tdes_crypt_dma_stop':
>> include/linux/kern_levels.h:4:18: warning: format '%u' expects argument of type 'unsigned int', but argument 2 has type 'size_t {aka long unsigned int}' [-Wformat=]
    #define KERN_SOH "\001"  /* ASCII Start Of Header */
                     ^
   include/linux/kern_levels.h:10:18: note: in expansion of macro 'KERN_SOH'
    #define KERN_ERR KERN_SOH "3" /* error conditions */
                     ^~~~~~~~
   include/linux/printk.h:292:9: note: in expansion of macro 'KERN_ERR'
     printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
            ^~~~~~~~
   drivers/crypto/atmel-tdes.c:664:5: note: in expansion of macro 'pr_err'
        pr_err("not all data converted: %u\n", count);
        ^~~~~~

vim +/min +157 drivers/crypto/atmel-tdes.c

13802005 Nicolas Royer  2012-07-01   11   * by the Free Software Foundation.
13802005 Nicolas Royer  2012-07-01   12   *
13802005 Nicolas Royer  2012-07-01   13   * Some ideas are from omap-aes.c drivers.
13802005 Nicolas Royer  2012-07-01   14   */
13802005 Nicolas Royer  2012-07-01   15  
13802005 Nicolas Royer  2012-07-01   16  
13802005 Nicolas Royer  2012-07-01  @17  #include <linux/kernel.h>
13802005 Nicolas Royer  2012-07-01   18  #include <linux/module.h>
13802005 Nicolas Royer  2012-07-01   19  #include <linux/slab.h>
13802005 Nicolas Royer  2012-07-01   20  #include <linux/err.h>
13802005 Nicolas Royer  2012-07-01   21  #include <linux/clk.h>
13802005 Nicolas Royer  2012-07-01   22  #include <linux/io.h>
13802005 Nicolas Royer  2012-07-01   23  #include <linux/hw_random.h>
13802005 Nicolas Royer  2012-07-01   24  #include <linux/platform_device.h>
13802005 Nicolas Royer  2012-07-01   25  
13802005 Nicolas Royer  2012-07-01   26  #include <linux/device.h>
13802005 Nicolas Royer  2012-07-01   27  #include <linux/init.h>
13802005 Nicolas Royer  2012-07-01   28  #include <linux/errno.h>
13802005 Nicolas Royer  2012-07-01   29  #include <linux/interrupt.h>
13802005 Nicolas Royer  2012-07-01   30  #include <linux/irq.h>
13802005 Nicolas Royer  2012-07-01   31  #include <linux/scatterlist.h>
13802005 Nicolas Royer  2012-07-01   32  #include <linux/dma-mapping.h>
84c8976b Nicolas Ferre  2013-10-15   33  #include <linux/of_device.h>
13802005 Nicolas Royer  2012-07-01   34  #include <linux/delay.h>
13802005 Nicolas Royer  2012-07-01   35  #include <linux/crypto.h>
13802005 Nicolas Royer  2012-07-01   36  #include <linux/cryptohash.h>
13802005 Nicolas Royer  2012-07-01   37  #include <crypto/scatterwalk.h>
13802005 Nicolas Royer  2012-07-01   38  #include <crypto/algapi.h>
13802005 Nicolas Royer  2012-07-01   39  #include <crypto/des.h>
13802005 Nicolas Royer  2012-07-01   40  #include <crypto/hash.h>
13802005 Nicolas Royer  2012-07-01   41  #include <crypto/internal/hash.h>
1f858040 Nicolas Royer  2013-02-20   42  #include <linux/platform_data/crypto-atmel.h>
13802005 Nicolas Royer  2012-07-01   43  #include "atmel-tdes-regs.h"
13802005 Nicolas Royer  2012-07-01   44  
13802005 Nicolas Royer  2012-07-01   45  /* TDES flags  */
1f858040 Nicolas Royer  2013-02-20   46  #define TDES_FLAGS_MODE_MASK		0x00ff
13802005 Nicolas Royer  2012-07-01   47  #define TDES_FLAGS_ENCRYPT	BIT(0)
13802005 Nicolas Royer  2012-07-01   48  #define TDES_FLAGS_CBC		BIT(1)
13802005 Nicolas Royer  2012-07-01   49  #define TDES_FLAGS_CFB		BIT(2)
13802005 Nicolas Royer  2012-07-01   50  #define TDES_FLAGS_CFB8		BIT(3)
13802005 Nicolas Royer  2012-07-01   51  #define TDES_FLAGS_CFB16	BIT(4)
13802005 Nicolas Royer  2012-07-01   52  #define TDES_FLAGS_CFB32	BIT(5)
1f858040 Nicolas Royer  2013-02-20   53  #define TDES_FLAGS_CFB64	BIT(6)
1f858040 Nicolas Royer  2013-02-20   54  #define TDES_FLAGS_OFB		BIT(7)
13802005 Nicolas Royer  2012-07-01   55  
13802005 Nicolas Royer  2012-07-01   56  #define TDES_FLAGS_INIT		BIT(16)
13802005 Nicolas Royer  2012-07-01   57  #define TDES_FLAGS_FAST		BIT(17)
13802005 Nicolas Royer  2012-07-01   58  #define TDES_FLAGS_BUSY		BIT(18)
1f858040 Nicolas Royer  2013-02-20   59  #define TDES_FLAGS_DMA		BIT(19)
13802005 Nicolas Royer  2012-07-01   60  
1f858040 Nicolas Royer  2013-02-20   61  #define ATMEL_TDES_QUEUE_LENGTH	50
13802005 Nicolas Royer  2012-07-01   62  
13802005 Nicolas Royer  2012-07-01   63  #define CFB8_BLOCK_SIZE		1
13802005 Nicolas Royer  2012-07-01   64  #define CFB16_BLOCK_SIZE	2
13802005 Nicolas Royer  2012-07-01   65  #define CFB32_BLOCK_SIZE	4
13802005 Nicolas Royer  2012-07-01   66  
1f858040 Nicolas Royer  2013-02-20   67  struct atmel_tdes_caps {
1f858040 Nicolas Royer  2013-02-20   68  	bool	has_dma;
1f858040 Nicolas Royer  2013-02-20   69  	u32		has_cfb_3keys;
1f858040 Nicolas Royer  2013-02-20   70  };
13802005 Nicolas Royer  2012-07-01   71  
13802005 Nicolas Royer  2012-07-01   72  struct atmel_tdes_dev;
13802005 Nicolas Royer  2012-07-01   73  
13802005 Nicolas Royer  2012-07-01   74  struct atmel_tdes_ctx {
13802005 Nicolas Royer  2012-07-01   75  	struct atmel_tdes_dev *dd;
13802005 Nicolas Royer  2012-07-01   76  
13802005 Nicolas Royer  2012-07-01   77  	int		keylen;
13802005 Nicolas Royer  2012-07-01   78  	u32		key[3*DES_KEY_SIZE / sizeof(u32)];
13802005 Nicolas Royer  2012-07-01   79  	unsigned long	flags;
1f858040 Nicolas Royer  2013-02-20   80  
1f858040 Nicolas Royer  2013-02-20   81  	u16		block_size;
13802005 Nicolas Royer  2012-07-01   82  };
13802005 Nicolas Royer  2012-07-01   83  
13802005 Nicolas Royer  2012-07-01   84  struct atmel_tdes_reqctx {
13802005 Nicolas Royer  2012-07-01   85  	unsigned long mode;
13802005 Nicolas Royer  2012-07-01   86  };
13802005 Nicolas Royer  2012-07-01   87  
1f858040 Nicolas Royer  2013-02-20   88  struct atmel_tdes_dma {
1f858040 Nicolas Royer  2013-02-20   89  	struct dma_chan			*chan;
1f858040 Nicolas Royer  2013-02-20   90  	struct dma_slave_config dma_conf;
1f858040 Nicolas Royer  2013-02-20   91  };
1f858040 Nicolas Royer  2013-02-20   92  
13802005 Nicolas Royer  2012-07-01   93  struct atmel_tdes_dev {
13802005 Nicolas Royer  2012-07-01   94  	struct list_head	list;
13802005 Nicolas Royer  2012-07-01   95  	unsigned long		phys_base;
13802005 Nicolas Royer  2012-07-01   96  	void __iomem		*io_base;
13802005 Nicolas Royer  2012-07-01   97  
13802005 Nicolas Royer  2012-07-01   98  	struct atmel_tdes_ctx	*ctx;
13802005 Nicolas Royer  2012-07-01   99  	struct device		*dev;
13802005 Nicolas Royer  2012-07-01  100  	struct clk			*iclk;
13802005 Nicolas Royer  2012-07-01  101  	int					irq;
13802005 Nicolas Royer  2012-07-01  102  
13802005 Nicolas Royer  2012-07-01  103  	unsigned long		flags;
13802005 Nicolas Royer  2012-07-01  104  	int			err;
13802005 Nicolas Royer  2012-07-01  105  
13802005 Nicolas Royer  2012-07-01  106  	spinlock_t		lock;
13802005 Nicolas Royer  2012-07-01  107  	struct crypto_queue	queue;
13802005 Nicolas Royer  2012-07-01  108  
13802005 Nicolas Royer  2012-07-01  109  	struct tasklet_struct	done_task;
13802005 Nicolas Royer  2012-07-01  110  	struct tasklet_struct	queue_task;
13802005 Nicolas Royer  2012-07-01  111  
13802005 Nicolas Royer  2012-07-01  112  	struct ablkcipher_request	*req;
13802005 Nicolas Royer  2012-07-01  113  	size_t				total;
13802005 Nicolas Royer  2012-07-01  114  
13802005 Nicolas Royer  2012-07-01  115  	struct scatterlist	*in_sg;
1f858040 Nicolas Royer  2013-02-20  116  	unsigned int		nb_in_sg;
13802005 Nicolas Royer  2012-07-01  117  	size_t				in_offset;
13802005 Nicolas Royer  2012-07-01  118  	struct scatterlist	*out_sg;
1f858040 Nicolas Royer  2013-02-20  119  	unsigned int		nb_out_sg;
13802005 Nicolas Royer  2012-07-01  120  	size_t				out_offset;
13802005 Nicolas Royer  2012-07-01  121  
13802005 Nicolas Royer  2012-07-01  122  	size_t	buflen;
13802005 Nicolas Royer  2012-07-01  123  	size_t	dma_size;
13802005 Nicolas Royer  2012-07-01  124  
13802005 Nicolas Royer  2012-07-01  125  	void	*buf_in;
13802005 Nicolas Royer  2012-07-01  126  	int		dma_in;
13802005 Nicolas Royer  2012-07-01  127  	dma_addr_t	dma_addr_in;
1f858040 Nicolas Royer  2013-02-20  128  	struct atmel_tdes_dma	dma_lch_in;
13802005 Nicolas Royer  2012-07-01  129  
13802005 Nicolas Royer  2012-07-01  130  	void	*buf_out;
13802005 Nicolas Royer  2012-07-01  131  	int		dma_out;
13802005 Nicolas Royer  2012-07-01  132  	dma_addr_t	dma_addr_out;
1f858040 Nicolas Royer  2013-02-20  133  	struct atmel_tdes_dma	dma_lch_out;
1f858040 Nicolas Royer  2013-02-20  134  
1f858040 Nicolas Royer  2013-02-20  135  	struct atmel_tdes_caps	caps;
1f858040 Nicolas Royer  2013-02-20  136  
1f858040 Nicolas Royer  2013-02-20  137  	u32	hw_version;
13802005 Nicolas Royer  2012-07-01  138  };
13802005 Nicolas Royer  2012-07-01  139  
13802005 Nicolas Royer  2012-07-01  140  struct atmel_tdes_drv {
13802005 Nicolas Royer  2012-07-01  141  	struct list_head	dev_list;
13802005 Nicolas Royer  2012-07-01  142  	spinlock_t		lock;
13802005 Nicolas Royer  2012-07-01  143  };
13802005 Nicolas Royer  2012-07-01  144  
13802005 Nicolas Royer  2012-07-01  145  static struct atmel_tdes_drv atmel_tdes = {
13802005 Nicolas Royer  2012-07-01  146  	.dev_list = LIST_HEAD_INIT(atmel_tdes.dev_list),
13802005 Nicolas Royer  2012-07-01  147  	.lock = __SPIN_LOCK_UNLOCKED(atmel_tdes.lock),
13802005 Nicolas Royer  2012-07-01  148  };
13802005 Nicolas Royer  2012-07-01  149  
13802005 Nicolas Royer  2012-07-01  150  static int atmel_tdes_sg_copy(struct scatterlist **sg, size_t *offset,
13802005 Nicolas Royer  2012-07-01  151  			void *buf, size_t buflen, size_t total, int out)
13802005 Nicolas Royer  2012-07-01  152  {
13802005 Nicolas Royer  2012-07-01  153  	unsigned int count, off = 0;
13802005 Nicolas Royer  2012-07-01  154  
13802005 Nicolas Royer  2012-07-01  155  	while (buflen && total) {
13802005 Nicolas Royer  2012-07-01  156  		count = min((*sg)->length - *offset, total);
13802005 Nicolas Royer  2012-07-01 @157  		count = min(count, buflen);
13802005 Nicolas Royer  2012-07-01  158  
13802005 Nicolas Royer  2012-07-01  159  		if (!count)
13802005 Nicolas Royer  2012-07-01  160  			return off;
13802005 Nicolas Royer  2012-07-01  161  
13802005 Nicolas Royer  2012-07-01  162  		scatterwalk_map_and_copy(buf + off, *sg, *offset, count, out);
13802005 Nicolas Royer  2012-07-01  163  
13802005 Nicolas Royer  2012-07-01  164  		off += count;
13802005 Nicolas Royer  2012-07-01  165  		buflen -= count;
13802005 Nicolas Royer  2012-07-01  166  		*offset += count;
13802005 Nicolas Royer  2012-07-01  167  		total -= count;
13802005 Nicolas Royer  2012-07-01  168  
13802005 Nicolas Royer  2012-07-01  169  		if (*offset == (*sg)->length) {
13802005 Nicolas Royer  2012-07-01  170  			*sg = sg_next(*sg);
13802005 Nicolas Royer  2012-07-01  171  			if (*sg)
13802005 Nicolas Royer  2012-07-01  172  				*offset = 0;
13802005 Nicolas Royer  2012-07-01  173  			else
13802005 Nicolas Royer  2012-07-01  174  				total = 0;
13802005 Nicolas Royer  2012-07-01  175  		}
13802005 Nicolas Royer  2012-07-01  176  	}
13802005 Nicolas Royer  2012-07-01  177  
13802005 Nicolas Royer  2012-07-01  178  	return off;
13802005 Nicolas Royer  2012-07-01  179  }
13802005 Nicolas Royer  2012-07-01  180  
13802005 Nicolas Royer  2012-07-01  181  static inline u32 atmel_tdes_read(struct atmel_tdes_dev *dd, u32 offset)
13802005 Nicolas Royer  2012-07-01  182  {
13802005 Nicolas Royer  2012-07-01  183  	return readl_relaxed(dd->io_base + offset);
13802005 Nicolas Royer  2012-07-01  184  }
13802005 Nicolas Royer  2012-07-01  185  
13802005 Nicolas Royer  2012-07-01  186  static inline void atmel_tdes_write(struct atmel_tdes_dev *dd,
13802005 Nicolas Royer  2012-07-01  187  					u32 offset, u32 value)
13802005 Nicolas Royer  2012-07-01  188  {
13802005 Nicolas Royer  2012-07-01  189  	writel_relaxed(value, dd->io_base + offset);
13802005 Nicolas Royer  2012-07-01  190  }
13802005 Nicolas Royer  2012-07-01  191  
13802005 Nicolas Royer  2012-07-01  192  static void atmel_tdes_write_n(struct atmel_tdes_dev *dd, u32 offset,
13802005 Nicolas Royer  2012-07-01  193  					u32 *value, int count)
13802005 Nicolas Royer  2012-07-01  194  {
13802005 Nicolas Royer  2012-07-01  195  	for (; count--; value++, offset += 4)
13802005 Nicolas Royer  2012-07-01  196  		atmel_tdes_write(dd, offset, *value);
13802005 Nicolas Royer  2012-07-01  197  }
13802005 Nicolas Royer  2012-07-01  198  
13802005 Nicolas Royer  2012-07-01  199  static struct atmel_tdes_dev *atmel_tdes_find_dev(struct atmel_tdes_ctx *ctx)
13802005 Nicolas Royer  2012-07-01  200  {
13802005 Nicolas Royer  2012-07-01  201  	struct atmel_tdes_dev *tdes_dd = NULL;
13802005 Nicolas Royer  2012-07-01  202  	struct atmel_tdes_dev *tmp;
13802005 Nicolas Royer  2012-07-01  203  
13802005 Nicolas Royer  2012-07-01  204  	spin_lock_bh(&atmel_tdes.lock);
13802005 Nicolas Royer  2012-07-01  205  	if (!ctx->dd) {
13802005 Nicolas Royer  2012-07-01  206  		list_for_each_entry(tmp, &atmel_tdes.dev_list, list) {
13802005 Nicolas Royer  2012-07-01  207  			tdes_dd = tmp;
13802005 Nicolas Royer  2012-07-01  208  			break;
13802005 Nicolas Royer  2012-07-01  209  		}
13802005 Nicolas Royer  2012-07-01  210  		ctx->dd = tdes_dd;
13802005 Nicolas Royer  2012-07-01  211  	} else {
13802005 Nicolas Royer  2012-07-01  212  		tdes_dd = ctx->dd;
13802005 Nicolas Royer  2012-07-01  213  	}
13802005 Nicolas Royer  2012-07-01  214  	spin_unlock_bh(&atmel_tdes.lock);
13802005 Nicolas Royer  2012-07-01  215  
13802005 Nicolas Royer  2012-07-01  216  	return tdes_dd;
13802005 Nicolas Royer  2012-07-01  217  }
13802005 Nicolas Royer  2012-07-01  218  
13802005 Nicolas Royer  2012-07-01  219  static int atmel_tdes_hw_init(struct atmel_tdes_dev *dd)
13802005 Nicolas Royer  2012-07-01  220  {
9d83d299 LABBE Corentin 2015-10-02  221  	int err;
9d83d299 LABBE Corentin 2015-10-02  222  
9d83d299 LABBE Corentin 2015-10-02  223  	err = clk_prepare_enable(dd->iclk);
9d83d299 LABBE Corentin 2015-10-02  224  	if (err)
9d83d299 LABBE Corentin 2015-10-02  225  		return err;
13802005 Nicolas Royer  2012-07-01  226  
13802005 Nicolas Royer  2012-07-01  227  	if (!(dd->flags & TDES_FLAGS_INIT)) {
13802005 Nicolas Royer  2012-07-01  228  		atmel_tdes_write(dd, TDES_CR, TDES_CR_SWRST);
13802005 Nicolas Royer  2012-07-01  229  		dd->flags |= TDES_FLAGS_INIT;
13802005 Nicolas Royer  2012-07-01  230  		dd->err = 0;
13802005 Nicolas Royer  2012-07-01  231  	}
13802005 Nicolas Royer  2012-07-01  232  
13802005 Nicolas Royer  2012-07-01  233  	return 0;
13802005 Nicolas Royer  2012-07-01  234  }
13802005 Nicolas Royer  2012-07-01  235  
1f858040 Nicolas Royer  2013-02-20  236  static inline unsigned int atmel_tdes_get_version(struct atmel_tdes_dev *dd)
1f858040 Nicolas Royer  2013-02-20  237  {
1f858040 Nicolas Royer  2013-02-20  238  	return atmel_tdes_read(dd, TDES_HW_VERSION) & 0x00000fff;
1f858040 Nicolas Royer  2013-02-20  239  }
1f858040 Nicolas Royer  2013-02-20  240  
1f858040 Nicolas Royer  2013-02-20  241  static void atmel_tdes_hw_version_init(struct atmel_tdes_dev *dd)
1f858040 Nicolas Royer  2013-02-20  242  {
1f858040 Nicolas Royer  2013-02-20  243  	atmel_tdes_hw_init(dd);
1f858040 Nicolas Royer  2013-02-20  244  
1f858040 Nicolas Royer  2013-02-20  245  	dd->hw_version = atmel_tdes_get_version(dd);
1f858040 Nicolas Royer  2013-02-20  246  
1f858040 Nicolas Royer  2013-02-20  247  	dev_info(dd->dev,
1f858040 Nicolas Royer  2013-02-20  248  			"version: 0x%x\n", dd->hw_version);
1f858040 Nicolas Royer  2013-02-20  249  
1f858040 Nicolas Royer  2013-02-20  250  	clk_disable_unprepare(dd->iclk);
1f858040 Nicolas Royer  2013-02-20  251  }
1f858040 Nicolas Royer  2013-02-20  252  
1f858040 Nicolas Royer  2013-02-20  253  static void atmel_tdes_dma_callback(void *data)
1f858040 Nicolas Royer  2013-02-20  254  {
1f858040 Nicolas Royer  2013-02-20  255  	struct atmel_tdes_dev *dd = data;
1f858040 Nicolas Royer  2013-02-20  256  
1f858040 Nicolas Royer  2013-02-20  257  	/* dma_lch_out - completed */
1f858040 Nicolas Royer  2013-02-20  258  	tasklet_schedule(&dd->done_task);
1f858040 Nicolas Royer  2013-02-20  259  }
1f858040 Nicolas Royer  2013-02-20  260  
13802005 Nicolas Royer  2012-07-01  261  static int atmel_tdes_write_ctrl(struct atmel_tdes_dev *dd)
13802005 Nicolas Royer  2012-07-01  262  {
13802005 Nicolas Royer  2012-07-01  263  	int err;
13802005 Nicolas Royer  2012-07-01  264  	u32 valcr = 0, valmr = TDES_MR_SMOD_PDC;
13802005 Nicolas Royer  2012-07-01  265  
13802005 Nicolas Royer  2012-07-01  266  	err = atmel_tdes_hw_init(dd);
13802005 Nicolas Royer  2012-07-01  267  
13802005 Nicolas Royer  2012-07-01  268  	if (err)
13802005 Nicolas Royer  2012-07-01  269  		return err;
13802005 Nicolas Royer  2012-07-01  270  
1f858040 Nicolas Royer  2013-02-20  271  	if (!dd->caps.has_dma)
1f858040 Nicolas Royer  2013-02-20  272  		atmel_tdes_write(dd, TDES_PTCR,
1f858040 Nicolas Royer  2013-02-20  273  			TDES_PTCR_TXTDIS | TDES_PTCR_RXTDIS);
13802005 Nicolas Royer  2012-07-01  274  
13802005 Nicolas Royer  2012-07-01  275  	/* MR register must be set before IV registers */
13802005 Nicolas Royer  2012-07-01  276  	if (dd->ctx->keylen > (DES_KEY_SIZE << 1)) {
13802005 Nicolas Royer  2012-07-01  277  		valmr |= TDES_MR_KEYMOD_3KEY;
13802005 Nicolas Royer  2012-07-01  278  		valmr |= TDES_MR_TDESMOD_TDES;
13802005 Nicolas Royer  2012-07-01  279  	} else if (dd->ctx->keylen > DES_KEY_SIZE) {
13802005 Nicolas Royer  2012-07-01  280  		valmr |= TDES_MR_KEYMOD_2KEY;
13802005 Nicolas Royer  2012-07-01  281  		valmr |= TDES_MR_TDESMOD_TDES;
13802005 Nicolas Royer  2012-07-01  282  	} else {
13802005 Nicolas Royer  2012-07-01  283  		valmr |= TDES_MR_TDESMOD_DES;
13802005 Nicolas Royer  2012-07-01  284  	}
13802005 Nicolas Royer  2012-07-01  285  
13802005 Nicolas Royer  2012-07-01  286  	if (dd->flags & TDES_FLAGS_CBC) {
13802005 Nicolas Royer  2012-07-01  287  		valmr |= TDES_MR_OPMOD_CBC;
13802005 Nicolas Royer  2012-07-01  288  	} else if (dd->flags & TDES_FLAGS_CFB) {
13802005 Nicolas Royer  2012-07-01  289  		valmr |= TDES_MR_OPMOD_CFB;
13802005 Nicolas Royer  2012-07-01  290  
13802005 Nicolas Royer  2012-07-01  291  		if (dd->flags & TDES_FLAGS_CFB8)
13802005 Nicolas Royer  2012-07-01  292  			valmr |= TDES_MR_CFBS_8b;
13802005 Nicolas Royer  2012-07-01  293  		else if (dd->flags & TDES_FLAGS_CFB16)
13802005 Nicolas Royer  2012-07-01  294  			valmr |= TDES_MR_CFBS_16b;
13802005 Nicolas Royer  2012-07-01  295  		else if (dd->flags & TDES_FLAGS_CFB32)
13802005 Nicolas Royer  2012-07-01  296  			valmr |= TDES_MR_CFBS_32b;
1f858040 Nicolas Royer  2013-02-20  297  		else if (dd->flags & TDES_FLAGS_CFB64)
1f858040 Nicolas Royer  2013-02-20  298  			valmr |= TDES_MR_CFBS_64b;
13802005 Nicolas Royer  2012-07-01  299  	} else if (dd->flags & TDES_FLAGS_OFB) {
13802005 Nicolas Royer  2012-07-01  300  		valmr |= TDES_MR_OPMOD_OFB;
13802005 Nicolas Royer  2012-07-01  301  	}
13802005 Nicolas Royer  2012-07-01  302  
13802005 Nicolas Royer  2012-07-01  303  	if ((dd->flags & TDES_FLAGS_ENCRYPT) || (dd->flags & TDES_FLAGS_OFB))
13802005 Nicolas Royer  2012-07-01  304  		valmr |= TDES_MR_CYPHER_ENC;
13802005 Nicolas Royer  2012-07-01  305  
13802005 Nicolas Royer  2012-07-01  306  	atmel_tdes_write(dd, TDES_CR, valcr);
13802005 Nicolas Royer  2012-07-01  307  	atmel_tdes_write(dd, TDES_MR, valmr);
13802005 Nicolas Royer  2012-07-01  308  
13802005 Nicolas Royer  2012-07-01  309  	atmel_tdes_write_n(dd, TDES_KEY1W1R, dd->ctx->key,
13802005 Nicolas Royer  2012-07-01  310  						dd->ctx->keylen >> 2);
13802005 Nicolas Royer  2012-07-01  311  
13802005 Nicolas Royer  2012-07-01  312  	if (((dd->flags & TDES_FLAGS_CBC) || (dd->flags & TDES_FLAGS_CFB) ||
13802005 Nicolas Royer  2012-07-01  313  		(dd->flags & TDES_FLAGS_OFB)) && dd->req->info) {
13802005 Nicolas Royer  2012-07-01  314  		atmel_tdes_write_n(dd, TDES_IV1R, dd->req->info, 2);
13802005 Nicolas Royer  2012-07-01  315  	}
13802005 Nicolas Royer  2012-07-01  316  
13802005 Nicolas Royer  2012-07-01  317  	return 0;
13802005 Nicolas Royer  2012-07-01  318  }
13802005 Nicolas Royer  2012-07-01  319  
1f858040 Nicolas Royer  2013-02-20  320  static int atmel_tdes_crypt_pdc_stop(struct atmel_tdes_dev *dd)
13802005 Nicolas Royer  2012-07-01  321  {
13802005 Nicolas Royer  2012-07-01  322  	int err = 0;
13802005 Nicolas Royer  2012-07-01  323  	size_t count;
13802005 Nicolas Royer  2012-07-01  324  
13802005 Nicolas Royer  2012-07-01  325  	atmel_tdes_write(dd, TDES_PTCR, TDES_PTCR_TXTDIS|TDES_PTCR_RXTDIS);
13802005 Nicolas Royer  2012-07-01  326  
13802005 Nicolas Royer  2012-07-01  327  	if (dd->flags & TDES_FLAGS_FAST) {
13802005 Nicolas Royer  2012-07-01  328  		dma_unmap_sg(dd->dev, dd->out_sg, 1, DMA_FROM_DEVICE);
13802005 Nicolas Royer  2012-07-01  329  		dma_unmap_sg(dd->dev, dd->in_sg, 1, DMA_TO_DEVICE);
13802005 Nicolas Royer  2012-07-01  330  	} else {
13802005 Nicolas Royer  2012-07-01  331  		dma_sync_single_for_device(dd->dev, dd->dma_addr_out,
13802005 Nicolas Royer  2012-07-01  332  					   dd->dma_size, DMA_FROM_DEVICE);
13802005 Nicolas Royer  2012-07-01  333  
13802005 Nicolas Royer  2012-07-01  334  		/* copy data */
13802005 Nicolas Royer  2012-07-01  335  		count = atmel_tdes_sg_copy(&dd->out_sg, &dd->out_offset,
13802005 Nicolas Royer  2012-07-01  336  				dd->buf_out, dd->buflen, dd->dma_size, 1);
13802005 Nicolas Royer  2012-07-01  337  		if (count != dd->dma_size) {
13802005 Nicolas Royer  2012-07-01  338  			err = -EINVAL;
13802005 Nicolas Royer  2012-07-01 @339  			pr_err("not all data converted: %u\n", count);
13802005 Nicolas Royer  2012-07-01  340  		}
13802005 Nicolas Royer  2012-07-01  341  	}
13802005 Nicolas Royer  2012-07-01  342  

:::::: The code at line 157 was first introduced by commit
:::::: 13802005d8f2db244ec1f5d7f6923de8f7a463db crypto: atmel - add Atmel DES/TDES driver

:::::: TO: Nicolas Royer <nicolas@eukrea.com>
:::::: CC: Herbert Xu <herbert@gondor.apana.org.au>

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

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 45911 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: crypto: atmel - Fix authenc compile test warnings
  2017-02-06  9:03 ` linux-next: build warnings after merge of the crypto tree Herbert Xu
  2017-02-06 12:54   ` crypto: atmel - Fix authenc compile test warnings kbuild test robot
@ 2017-02-06 16:58   ` kbuild test robot
  2017-02-06 19:02   ` kbuild test robot
  2017-02-10  3:12   ` linux-next: build warnings after merge of the crypto tree Stephen Rothwell
  3 siblings, 0 replies; 15+ messages in thread
From: kbuild test robot @ 2017-02-06 16:58 UTC (permalink / raw)
  To: Herbert Xu
  Cc: kbuild-all, Stephen Rothwell, linux-next, linux-kernel,
	Cyrille Pitchen, Linux Crypto Mailing List

Hi Herbert,

[auto build test WARNING on cryptodev/master]
[also build test WARNING on v4.10-rc7 next-20170206]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Herbert-Xu/crypto-atmel-Fix-authenc-compile-test-warnings/20170206-171201
base:   https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git master
reproduce:
        # apt-get install sparse
        make ARCH=x86_64 allmodconfig
        make C=1 CF=-D__CHECK_ENDIAN__


sparse warnings: (new ones prefixed by >>)

   include/linux/compiler.h:253:8: sparse: attribute 'no_sanitize_address': unknown attribute
>> drivers/crypto/atmel-tdes.c:157:25: sparse: incompatible types in comparison expression (different type sizes)
   drivers/crypto/atmel-tdes.c:528:25: sparse: incompatible types in comparison expression (different type sizes)
   drivers/crypto/atmel-tdes.c:529:25: sparse: incompatible types in comparison expression (different type sizes)
   In file included from drivers/crypto/atmel-tdes.c:17:0:
   drivers/crypto/atmel-tdes.c: In function 'atmel_tdes_sg_copy':
   include/linux/kernel.h:753:16: warning: comparison of distinct pointer types lacks a cast
     (void) (&min1 == &min2);   \
                   ^
   include/linux/kernel.h:756:2: note: in expansion of macro '__min'
     __min(typeof(x), typeof(y),   \
     ^~~~~
   drivers/crypto/atmel-tdes.c:157:11: note: in expansion of macro 'min'
      count = min(count, buflen);
              ^~~
   In file included from include/linux/printk.h:6:0,
                    from include/linux/kernel.h:13,
                    from drivers/crypto/atmel-tdes.c:17:
   drivers/crypto/atmel-tdes.c: In function 'atmel_tdes_crypt_pdc_stop':
   include/linux/kern_levels.h:4:18: warning: format '%u' expects argument of type 'unsigned int', but argument 2 has type 'size_t {aka long unsigned int}' [-Wformat=]
    #define KERN_SOH "\001"  /* ASCII Start Of Header */
                     ^
   include/linux/kern_levels.h:10:18: note: in expansion of macro 'KERN_SOH'
    #define KERN_ERR KERN_SOH "3" /* error conditions */
                     ^~~~~~~~
   include/linux/printk.h:292:9: note: in expansion of macro 'KERN_ERR'
     printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
            ^~~~~~~~
   drivers/crypto/atmel-tdes.c:339:4: note: in expansion of macro 'pr_err'
       pr_err("not all data converted: %u\n", count);
       ^~~~~~
   drivers/crypto/atmel-tdes.c: In function 'atmel_tdes_buff_init':
   drivers/crypto/atmel-tdes.c:364:26: warning: format '%d' expects argument of type 'int', but argument 3 has type 'size_t {aka long unsigned int}' [-Wformat=]
      dev_err(dd->dev, "dma %d bytes error\n", dd->buflen);
                             ^
   drivers/crypto/atmel-tdes.c:372:26: warning: format '%d' expects argument of type 'int', but argument 3 has type 'size_t {aka long unsigned int}' [-Wformat=]
      dev_err(dd->dev, "dma %d bytes error\n", dd->buflen);
                             ^
   In file included from drivers/crypto/atmel-tdes.c:17:0:
   drivers/crypto/atmel-tdes.c: In function 'atmel_tdes_crypt_start':
   include/linux/kernel.h:753:16: warning: comparison of distinct pointer types lacks a cast
     (void) (&min1 == &min2);   \
                   ^
   include/linux/kernel.h:756:2: note: in expansion of macro '__min'
     __min(typeof(x), typeof(y),   \
     ^~~~~
   drivers/crypto/atmel-tdes.c:528:11: note: in expansion of macro 'min'
      count = min(dd->total, sg_dma_len(dd->in_sg));
              ^~~
   include/linux/kernel.h:753:16: warning: comparison of distinct pointer types lacks a cast
     (void) (&min1 == &min2);   \
                   ^
   include/linux/kernel.h:756:2: note: in expansion of macro '__min'
     __min(typeof(x), typeof(y),   \
     ^~~~~
   drivers/crypto/atmel-tdes.c:529:11: note: in expansion of macro 'min'
      count = min(count, sg_dma_len(dd->out_sg));
              ^~~
   In file included from include/linux/printk.h:6:0,
                    from include/linux/kernel.h:13,
                    from drivers/crypto/atmel-tdes.c:17:
   drivers/crypto/atmel-tdes.c: In function 'atmel_tdes_crypt_dma_stop':
   include/linux/kern_levels.h:4:18: warning: format '%u' expects argument of type 'unsigned int', but argument 2 has type 'size_t {aka long unsigned int}' [-Wformat=]
    #define KERN_SOH "\001"  /* ASCII Start Of Header */
                     ^
   include/linux/kern_levels.h:10:18: note: in expansion of macro 'KERN_SOH'
    #define KERN_ERR KERN_SOH "3" /* error conditions */
                     ^~~~~~~~
   include/linux/printk.h:292:9: note: in expansion of macro 'KERN_ERR'
     printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
            ^~~~~~~~
   drivers/crypto/atmel-tdes.c:664:5: note: in expansion of macro 'pr_err'
        pr_err("not all data converted: %u\n", count);
        ^~~~~~

vim +157 drivers/crypto/atmel-tdes.c

13802005 Nicolas Royer 2012-07-01  141  	struct list_head	dev_list;
13802005 Nicolas Royer 2012-07-01  142  	spinlock_t		lock;
13802005 Nicolas Royer 2012-07-01  143  };
13802005 Nicolas Royer 2012-07-01  144  
13802005 Nicolas Royer 2012-07-01  145  static struct atmel_tdes_drv atmel_tdes = {
13802005 Nicolas Royer 2012-07-01  146  	.dev_list = LIST_HEAD_INIT(atmel_tdes.dev_list),
13802005 Nicolas Royer 2012-07-01  147  	.lock = __SPIN_LOCK_UNLOCKED(atmel_tdes.lock),
13802005 Nicolas Royer 2012-07-01  148  };
13802005 Nicolas Royer 2012-07-01  149  
13802005 Nicolas Royer 2012-07-01  150  static int atmel_tdes_sg_copy(struct scatterlist **sg, size_t *offset,
13802005 Nicolas Royer 2012-07-01  151  			void *buf, size_t buflen, size_t total, int out)
13802005 Nicolas Royer 2012-07-01  152  {
13802005 Nicolas Royer 2012-07-01  153  	unsigned int count, off = 0;
13802005 Nicolas Royer 2012-07-01  154  
13802005 Nicolas Royer 2012-07-01  155  	while (buflen && total) {
13802005 Nicolas Royer 2012-07-01  156  		count = min((*sg)->length - *offset, total);
13802005 Nicolas Royer 2012-07-01 @157  		count = min(count, buflen);
13802005 Nicolas Royer 2012-07-01  158  
13802005 Nicolas Royer 2012-07-01  159  		if (!count)
13802005 Nicolas Royer 2012-07-01  160  			return off;
13802005 Nicolas Royer 2012-07-01  161  
13802005 Nicolas Royer 2012-07-01  162  		scatterwalk_map_and_copy(buf + off, *sg, *offset, count, out);
13802005 Nicolas Royer 2012-07-01  163  
13802005 Nicolas Royer 2012-07-01  164  		off += count;
13802005 Nicolas Royer 2012-07-01  165  		buflen -= count;

:::::: The code at line 157 was first introduced by commit
:::::: 13802005d8f2db244ec1f5d7f6923de8f7a463db crypto: atmel - add Atmel DES/TDES driver

:::::: TO: Nicolas Royer <nicolas@eukrea.com>
:::::: CC: Herbert Xu <herbert@gondor.apana.org.au>

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

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: crypto: atmel - Fix authenc compile test warnings
  2017-02-06  9:03 ` linux-next: build warnings after merge of the crypto tree Herbert Xu
  2017-02-06 12:54   ` crypto: atmel - Fix authenc compile test warnings kbuild test robot
  2017-02-06 16:58   ` kbuild test robot
@ 2017-02-06 19:02   ` kbuild test robot
  2017-02-10  3:12   ` linux-next: build warnings after merge of the crypto tree Stephen Rothwell
  3 siblings, 0 replies; 15+ messages in thread
From: kbuild test robot @ 2017-02-06 19:02 UTC (permalink / raw)
  To: Herbert Xu
  Cc: kbuild-all, Stephen Rothwell, linux-next, linux-kernel,
	Cyrille Pitchen, Linux Crypto Mailing List

[-- Attachment #1: Type: text/plain, Size: 14723 bytes --]

Hi Herbert,

[auto build test WARNING on cryptodev/master]
[also build test WARNING on v4.10-rc7]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Herbert-Xu/crypto-atmel-Fix-authenc-compile-test-warnings/20170206-171201
base:   https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git master
config: tile-allmodconfig (attached as .config)
compiler: tilegx-linux-gcc (GCC) 4.6.2
reproduce:
        wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        make.cross ARCH=tile 

All warnings (new ones prefixed by >>):

   drivers/crypto/atmel-tdes.c: In function 'atmel_tdes_sg_copy':
>> drivers/crypto/atmel-tdes.c:157:11: warning: comparison of distinct pointer types lacks a cast [enabled by default]
   drivers/crypto/atmel-tdes.c: In function 'atmel_tdes_crypt_pdc_stop':
>> drivers/crypto/atmel-tdes.c:339:4: warning: format '%u' expects argument of type 'unsigned int', but argument 2 has type 'size_t' [-Wformat]
   drivers/crypto/atmel-tdes.c: In function 'atmel_tdes_buff_init':
>> drivers/crypto/atmel-tdes.c:364:3: warning: format '%d' expects argument of type 'int', but argument 3 has type 'size_t' [-Wformat]
   drivers/crypto/atmel-tdes.c:372:3: warning: format '%d' expects argument of type 'int', but argument 3 has type 'size_t' [-Wformat]
   drivers/crypto/atmel-tdes.c: In function 'atmel_tdes_crypt_start':
   drivers/crypto/atmel-tdes.c:528:11: warning: comparison of distinct pointer types lacks a cast [enabled by default]
   drivers/crypto/atmel-tdes.c:529:11: warning: comparison of distinct pointer types lacks a cast [enabled by default]
   drivers/crypto/atmel-tdes.c: In function 'atmel_tdes_crypt_dma_stop':
   drivers/crypto/atmel-tdes.c:664:5: warning: format '%u' expects argument of type 'unsigned int', but argument 2 has type 'size_t' [-Wformat]

vim +157 drivers/crypto/atmel-tdes.c

13802005 Nicolas Royer  2012-07-01  151  			void *buf, size_t buflen, size_t total, int out)
13802005 Nicolas Royer  2012-07-01  152  {
13802005 Nicolas Royer  2012-07-01  153  	unsigned int count, off = 0;
13802005 Nicolas Royer  2012-07-01  154  
13802005 Nicolas Royer  2012-07-01  155  	while (buflen && total) {
13802005 Nicolas Royer  2012-07-01  156  		count = min((*sg)->length - *offset, total);
13802005 Nicolas Royer  2012-07-01 @157  		count = min(count, buflen);
13802005 Nicolas Royer  2012-07-01  158  
13802005 Nicolas Royer  2012-07-01  159  		if (!count)
13802005 Nicolas Royer  2012-07-01  160  			return off;
13802005 Nicolas Royer  2012-07-01  161  
13802005 Nicolas Royer  2012-07-01  162  		scatterwalk_map_and_copy(buf + off, *sg, *offset, count, out);
13802005 Nicolas Royer  2012-07-01  163  
13802005 Nicolas Royer  2012-07-01  164  		off += count;
13802005 Nicolas Royer  2012-07-01  165  		buflen -= count;
13802005 Nicolas Royer  2012-07-01  166  		*offset += count;
13802005 Nicolas Royer  2012-07-01  167  		total -= count;
13802005 Nicolas Royer  2012-07-01  168  
13802005 Nicolas Royer  2012-07-01  169  		if (*offset == (*sg)->length) {
13802005 Nicolas Royer  2012-07-01  170  			*sg = sg_next(*sg);
13802005 Nicolas Royer  2012-07-01  171  			if (*sg)
13802005 Nicolas Royer  2012-07-01  172  				*offset = 0;
13802005 Nicolas Royer  2012-07-01  173  			else
13802005 Nicolas Royer  2012-07-01  174  				total = 0;
13802005 Nicolas Royer  2012-07-01  175  		}
13802005 Nicolas Royer  2012-07-01  176  	}
13802005 Nicolas Royer  2012-07-01  177  
13802005 Nicolas Royer  2012-07-01  178  	return off;
13802005 Nicolas Royer  2012-07-01  179  }
13802005 Nicolas Royer  2012-07-01  180  
13802005 Nicolas Royer  2012-07-01  181  static inline u32 atmel_tdes_read(struct atmel_tdes_dev *dd, u32 offset)
13802005 Nicolas Royer  2012-07-01  182  {
13802005 Nicolas Royer  2012-07-01  183  	return readl_relaxed(dd->io_base + offset);
13802005 Nicolas Royer  2012-07-01  184  }
13802005 Nicolas Royer  2012-07-01  185  
13802005 Nicolas Royer  2012-07-01  186  static inline void atmel_tdes_write(struct atmel_tdes_dev *dd,
13802005 Nicolas Royer  2012-07-01  187  					u32 offset, u32 value)
13802005 Nicolas Royer  2012-07-01  188  {
13802005 Nicolas Royer  2012-07-01  189  	writel_relaxed(value, dd->io_base + offset);
13802005 Nicolas Royer  2012-07-01  190  }
13802005 Nicolas Royer  2012-07-01  191  
13802005 Nicolas Royer  2012-07-01  192  static void atmel_tdes_write_n(struct atmel_tdes_dev *dd, u32 offset,
13802005 Nicolas Royer  2012-07-01  193  					u32 *value, int count)
13802005 Nicolas Royer  2012-07-01  194  {
13802005 Nicolas Royer  2012-07-01  195  	for (; count--; value++, offset += 4)
13802005 Nicolas Royer  2012-07-01  196  		atmel_tdes_write(dd, offset, *value);
13802005 Nicolas Royer  2012-07-01  197  }
13802005 Nicolas Royer  2012-07-01  198  
13802005 Nicolas Royer  2012-07-01  199  static struct atmel_tdes_dev *atmel_tdes_find_dev(struct atmel_tdes_ctx *ctx)
13802005 Nicolas Royer  2012-07-01  200  {
13802005 Nicolas Royer  2012-07-01  201  	struct atmel_tdes_dev *tdes_dd = NULL;
13802005 Nicolas Royer  2012-07-01  202  	struct atmel_tdes_dev *tmp;
13802005 Nicolas Royer  2012-07-01  203  
13802005 Nicolas Royer  2012-07-01  204  	spin_lock_bh(&atmel_tdes.lock);
13802005 Nicolas Royer  2012-07-01  205  	if (!ctx->dd) {
13802005 Nicolas Royer  2012-07-01  206  		list_for_each_entry(tmp, &atmel_tdes.dev_list, list) {
13802005 Nicolas Royer  2012-07-01  207  			tdes_dd = tmp;
13802005 Nicolas Royer  2012-07-01  208  			break;
13802005 Nicolas Royer  2012-07-01  209  		}
13802005 Nicolas Royer  2012-07-01  210  		ctx->dd = tdes_dd;
13802005 Nicolas Royer  2012-07-01  211  	} else {
13802005 Nicolas Royer  2012-07-01  212  		tdes_dd = ctx->dd;
13802005 Nicolas Royer  2012-07-01  213  	}
13802005 Nicolas Royer  2012-07-01  214  	spin_unlock_bh(&atmel_tdes.lock);
13802005 Nicolas Royer  2012-07-01  215  
13802005 Nicolas Royer  2012-07-01  216  	return tdes_dd;
13802005 Nicolas Royer  2012-07-01  217  }
13802005 Nicolas Royer  2012-07-01  218  
13802005 Nicolas Royer  2012-07-01  219  static int atmel_tdes_hw_init(struct atmel_tdes_dev *dd)
13802005 Nicolas Royer  2012-07-01  220  {
9d83d299 LABBE Corentin 2015-10-02  221  	int err;
9d83d299 LABBE Corentin 2015-10-02  222  
9d83d299 LABBE Corentin 2015-10-02  223  	err = clk_prepare_enable(dd->iclk);
9d83d299 LABBE Corentin 2015-10-02  224  	if (err)
9d83d299 LABBE Corentin 2015-10-02  225  		return err;
13802005 Nicolas Royer  2012-07-01  226  
13802005 Nicolas Royer  2012-07-01  227  	if (!(dd->flags & TDES_FLAGS_INIT)) {
13802005 Nicolas Royer  2012-07-01  228  		atmel_tdes_write(dd, TDES_CR, TDES_CR_SWRST);
13802005 Nicolas Royer  2012-07-01  229  		dd->flags |= TDES_FLAGS_INIT;
13802005 Nicolas Royer  2012-07-01  230  		dd->err = 0;
13802005 Nicolas Royer  2012-07-01  231  	}
13802005 Nicolas Royer  2012-07-01  232  
13802005 Nicolas Royer  2012-07-01  233  	return 0;
13802005 Nicolas Royer  2012-07-01  234  }
13802005 Nicolas Royer  2012-07-01  235  
1f858040 Nicolas Royer  2013-02-20  236  static inline unsigned int atmel_tdes_get_version(struct atmel_tdes_dev *dd)
1f858040 Nicolas Royer  2013-02-20  237  {
1f858040 Nicolas Royer  2013-02-20  238  	return atmel_tdes_read(dd, TDES_HW_VERSION) & 0x00000fff;
1f858040 Nicolas Royer  2013-02-20  239  }
1f858040 Nicolas Royer  2013-02-20  240  
1f858040 Nicolas Royer  2013-02-20  241  static void atmel_tdes_hw_version_init(struct atmel_tdes_dev *dd)
1f858040 Nicolas Royer  2013-02-20  242  {
1f858040 Nicolas Royer  2013-02-20  243  	atmel_tdes_hw_init(dd);
1f858040 Nicolas Royer  2013-02-20  244  
1f858040 Nicolas Royer  2013-02-20  245  	dd->hw_version = atmel_tdes_get_version(dd);
1f858040 Nicolas Royer  2013-02-20  246  
1f858040 Nicolas Royer  2013-02-20  247  	dev_info(dd->dev,
1f858040 Nicolas Royer  2013-02-20  248  			"version: 0x%x\n", dd->hw_version);
1f858040 Nicolas Royer  2013-02-20  249  
1f858040 Nicolas Royer  2013-02-20  250  	clk_disable_unprepare(dd->iclk);
1f858040 Nicolas Royer  2013-02-20  251  }
1f858040 Nicolas Royer  2013-02-20  252  
1f858040 Nicolas Royer  2013-02-20  253  static void atmel_tdes_dma_callback(void *data)
1f858040 Nicolas Royer  2013-02-20  254  {
1f858040 Nicolas Royer  2013-02-20  255  	struct atmel_tdes_dev *dd = data;
1f858040 Nicolas Royer  2013-02-20  256  
1f858040 Nicolas Royer  2013-02-20  257  	/* dma_lch_out - completed */
1f858040 Nicolas Royer  2013-02-20  258  	tasklet_schedule(&dd->done_task);
1f858040 Nicolas Royer  2013-02-20  259  }
1f858040 Nicolas Royer  2013-02-20  260  
13802005 Nicolas Royer  2012-07-01  261  static int atmel_tdes_write_ctrl(struct atmel_tdes_dev *dd)
13802005 Nicolas Royer  2012-07-01  262  {
13802005 Nicolas Royer  2012-07-01  263  	int err;
13802005 Nicolas Royer  2012-07-01  264  	u32 valcr = 0, valmr = TDES_MR_SMOD_PDC;
13802005 Nicolas Royer  2012-07-01  265  
13802005 Nicolas Royer  2012-07-01  266  	err = atmel_tdes_hw_init(dd);
13802005 Nicolas Royer  2012-07-01  267  
13802005 Nicolas Royer  2012-07-01  268  	if (err)
13802005 Nicolas Royer  2012-07-01  269  		return err;
13802005 Nicolas Royer  2012-07-01  270  
1f858040 Nicolas Royer  2013-02-20  271  	if (!dd->caps.has_dma)
1f858040 Nicolas Royer  2013-02-20  272  		atmel_tdes_write(dd, TDES_PTCR,
1f858040 Nicolas Royer  2013-02-20  273  			TDES_PTCR_TXTDIS | TDES_PTCR_RXTDIS);
13802005 Nicolas Royer  2012-07-01  274  
13802005 Nicolas Royer  2012-07-01  275  	/* MR register must be set before IV registers */
13802005 Nicolas Royer  2012-07-01  276  	if (dd->ctx->keylen > (DES_KEY_SIZE << 1)) {
13802005 Nicolas Royer  2012-07-01  277  		valmr |= TDES_MR_KEYMOD_3KEY;
13802005 Nicolas Royer  2012-07-01  278  		valmr |= TDES_MR_TDESMOD_TDES;
13802005 Nicolas Royer  2012-07-01  279  	} else if (dd->ctx->keylen > DES_KEY_SIZE) {
13802005 Nicolas Royer  2012-07-01  280  		valmr |= TDES_MR_KEYMOD_2KEY;
13802005 Nicolas Royer  2012-07-01  281  		valmr |= TDES_MR_TDESMOD_TDES;
13802005 Nicolas Royer  2012-07-01  282  	} else {
13802005 Nicolas Royer  2012-07-01  283  		valmr |= TDES_MR_TDESMOD_DES;
13802005 Nicolas Royer  2012-07-01  284  	}
13802005 Nicolas Royer  2012-07-01  285  
13802005 Nicolas Royer  2012-07-01  286  	if (dd->flags & TDES_FLAGS_CBC) {
13802005 Nicolas Royer  2012-07-01  287  		valmr |= TDES_MR_OPMOD_CBC;
13802005 Nicolas Royer  2012-07-01  288  	} else if (dd->flags & TDES_FLAGS_CFB) {
13802005 Nicolas Royer  2012-07-01  289  		valmr |= TDES_MR_OPMOD_CFB;
13802005 Nicolas Royer  2012-07-01  290  
13802005 Nicolas Royer  2012-07-01  291  		if (dd->flags & TDES_FLAGS_CFB8)
13802005 Nicolas Royer  2012-07-01  292  			valmr |= TDES_MR_CFBS_8b;
13802005 Nicolas Royer  2012-07-01  293  		else if (dd->flags & TDES_FLAGS_CFB16)
13802005 Nicolas Royer  2012-07-01  294  			valmr |= TDES_MR_CFBS_16b;
13802005 Nicolas Royer  2012-07-01  295  		else if (dd->flags & TDES_FLAGS_CFB32)
13802005 Nicolas Royer  2012-07-01  296  			valmr |= TDES_MR_CFBS_32b;
1f858040 Nicolas Royer  2013-02-20  297  		else if (dd->flags & TDES_FLAGS_CFB64)
1f858040 Nicolas Royer  2013-02-20  298  			valmr |= TDES_MR_CFBS_64b;
13802005 Nicolas Royer  2012-07-01  299  	} else if (dd->flags & TDES_FLAGS_OFB) {
13802005 Nicolas Royer  2012-07-01  300  		valmr |= TDES_MR_OPMOD_OFB;
13802005 Nicolas Royer  2012-07-01  301  	}
13802005 Nicolas Royer  2012-07-01  302  
13802005 Nicolas Royer  2012-07-01  303  	if ((dd->flags & TDES_FLAGS_ENCRYPT) || (dd->flags & TDES_FLAGS_OFB))
13802005 Nicolas Royer  2012-07-01  304  		valmr |= TDES_MR_CYPHER_ENC;
13802005 Nicolas Royer  2012-07-01  305  
13802005 Nicolas Royer  2012-07-01  306  	atmel_tdes_write(dd, TDES_CR, valcr);
13802005 Nicolas Royer  2012-07-01  307  	atmel_tdes_write(dd, TDES_MR, valmr);
13802005 Nicolas Royer  2012-07-01  308  
13802005 Nicolas Royer  2012-07-01  309  	atmel_tdes_write_n(dd, TDES_KEY1W1R, dd->ctx->key,
13802005 Nicolas Royer  2012-07-01  310  						dd->ctx->keylen >> 2);
13802005 Nicolas Royer  2012-07-01  311  
13802005 Nicolas Royer  2012-07-01  312  	if (((dd->flags & TDES_FLAGS_CBC) || (dd->flags & TDES_FLAGS_CFB) ||
13802005 Nicolas Royer  2012-07-01  313  		(dd->flags & TDES_FLAGS_OFB)) && dd->req->info) {
13802005 Nicolas Royer  2012-07-01  314  		atmel_tdes_write_n(dd, TDES_IV1R, dd->req->info, 2);
13802005 Nicolas Royer  2012-07-01  315  	}
13802005 Nicolas Royer  2012-07-01  316  
13802005 Nicolas Royer  2012-07-01  317  	return 0;
13802005 Nicolas Royer  2012-07-01  318  }
13802005 Nicolas Royer  2012-07-01  319  
1f858040 Nicolas Royer  2013-02-20  320  static int atmel_tdes_crypt_pdc_stop(struct atmel_tdes_dev *dd)
13802005 Nicolas Royer  2012-07-01  321  {
13802005 Nicolas Royer  2012-07-01  322  	int err = 0;
13802005 Nicolas Royer  2012-07-01  323  	size_t count;
13802005 Nicolas Royer  2012-07-01  324  
13802005 Nicolas Royer  2012-07-01  325  	atmel_tdes_write(dd, TDES_PTCR, TDES_PTCR_TXTDIS|TDES_PTCR_RXTDIS);
13802005 Nicolas Royer  2012-07-01  326  
13802005 Nicolas Royer  2012-07-01  327  	if (dd->flags & TDES_FLAGS_FAST) {
13802005 Nicolas Royer  2012-07-01  328  		dma_unmap_sg(dd->dev, dd->out_sg, 1, DMA_FROM_DEVICE);
13802005 Nicolas Royer  2012-07-01  329  		dma_unmap_sg(dd->dev, dd->in_sg, 1, DMA_TO_DEVICE);
13802005 Nicolas Royer  2012-07-01  330  	} else {
13802005 Nicolas Royer  2012-07-01  331  		dma_sync_single_for_device(dd->dev, dd->dma_addr_out,
13802005 Nicolas Royer  2012-07-01  332  					   dd->dma_size, DMA_FROM_DEVICE);
13802005 Nicolas Royer  2012-07-01  333  
13802005 Nicolas Royer  2012-07-01  334  		/* copy data */
13802005 Nicolas Royer  2012-07-01  335  		count = atmel_tdes_sg_copy(&dd->out_sg, &dd->out_offset,
13802005 Nicolas Royer  2012-07-01  336  				dd->buf_out, dd->buflen, dd->dma_size, 1);
13802005 Nicolas Royer  2012-07-01  337  		if (count != dd->dma_size) {
13802005 Nicolas Royer  2012-07-01  338  			err = -EINVAL;
13802005 Nicolas Royer  2012-07-01 @339  			pr_err("not all data converted: %u\n", count);
13802005 Nicolas Royer  2012-07-01  340  		}
13802005 Nicolas Royer  2012-07-01  341  	}
13802005 Nicolas Royer  2012-07-01  342  

:::::: The code at line 157 was first introduced by commit
:::::: 13802005d8f2db244ec1f5d7f6923de8f7a463db crypto: atmel - add Atmel DES/TDES driver

:::::: TO: Nicolas Royer <nicolas@eukrea.com>
:::::: CC: Herbert Xu <herbert@gondor.apana.org.au>

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

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 47135 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: linux-next: build warnings after merge of the crypto tree
  2017-02-06  9:03 ` linux-next: build warnings after merge of the crypto tree Herbert Xu
                     ` (2 preceding siblings ...)
  2017-02-06 19:02   ` kbuild test robot
@ 2017-02-10  3:12   ` Stephen Rothwell
  2017-02-11 10:56     ` Herbert Xu
  3 siblings, 1 reply; 15+ messages in thread
From: Stephen Rothwell @ 2017-02-10  3:12 UTC (permalink / raw)
  To: Herbert Xu
  Cc: linux-next, linux-kernel, Cyrille Pitchen, Linux Crypto Mailing List

Hi Herbert,

On Mon, 6 Feb 2017 17:03:40 +0800 Herbert Xu <herbert@gondor.apana.org.au> wrote:
>
> On Mon, Feb 06, 2017 at 12:28:37PM +1100, Stephen Rothwell wrote:
> > 
> > After merging the crypto tree, today's linux-next build (x86_64
> > allmodconfig) produced these warnings:
> > 
> > warning: (CRYPTO_DEV_ATMEL_AUTHENC) selects CRYPTO_DEV_ATMEL_SHA which has unmet direct dependencies (CRYPTO && CRYPTO_HW && ARCH_AT91)
> > warning: (CRYPTO_DEV_ATMEL_AUTHENC) selects CRYPTO_DEV_ATMEL_SHA which has unmet direct dependencies (CRYPTO && CRYPTO_HW && ARCH_AT91)
> > 
> > Introduced by commit
> > 
> >   89a82ef87e01 ("crypto: atmel-authenc - add support to authenc(hmac(shaX), Y(aes)) modes")
> > 
> > In file included from include/linux/printk.h:329:0,
> >                  from include/linux/kernel.h:13,
> >                  from drivers/crypto/atmel-sha.c:17:  
> 
> This patch should fix both issues.  Thanks,

I am still getting these warnings ... I have seen no updates to the
crypot tree since Feb 2.

-- 
Cheers,
Stephen Rothwell

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: linux-next: build warnings after merge of the crypto tree
  2017-02-10  3:12   ` linux-next: build warnings after merge of the crypto tree Stephen Rothwell
@ 2017-02-11 10:56     ` Herbert Xu
  2017-02-12 23:42       ` Stephen Rothwell
  0 siblings, 1 reply; 15+ messages in thread
From: Herbert Xu @ 2017-02-11 10:56 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: linux-next, linux-kernel, Cyrille Pitchen, Linux Crypto Mailing List

On Fri, Feb 10, 2017 at 02:12:51PM +1100, Stephen Rothwell wrote:
>
> I am still getting these warnings ... I have seen no updates to the
> crypot tree since Feb 2.

Sorry Stephen.  I have now applied Arnd's fixes for this problem
and it should be pushed out.

Cheers,
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: linux-next: build warnings after merge of the crypto tree
  2017-02-11 10:56     ` Herbert Xu
@ 2017-02-12 23:42       ` Stephen Rothwell
  0 siblings, 0 replies; 15+ messages in thread
From: Stephen Rothwell @ 2017-02-12 23:42 UTC (permalink / raw)
  To: Herbert Xu
  Cc: linux-next, linux-kernel, Cyrille Pitchen, Linux Crypto Mailing List

Hi Herbert,

On Sat, 11 Feb 2017 18:56:21 +0800 Herbert Xu <herbert@gondor.apana.org.au> wrote:
>
> On Fri, Feb 10, 2017 at 02:12:51PM +1100, Stephen Rothwell wrote:
> >
> > I am still getting these warnings ... I have seen no updates to the
> > crypot tree since Feb 2.  
> 
> Sorry Stephen.  I have now applied Arnd's fixes for this problem
> and it should be pushed out.

Thanks, its much cleaner now. :-)

-- 
Cheers,
Stephen Rothwell

^ permalink raw reply	[flat|nested] 15+ messages in thread

* linux-next: build warnings after merge of the crypto tree
@ 2023-03-14  3:19 Stephen Rothwell
  0 siblings, 0 replies; 15+ messages in thread
From: Stephen Rothwell @ 2023-03-14  3:19 UTC (permalink / raw)
  To: Herbert Xu
  Cc: Linux Crypto List, Linux Kernel Mailing List, Linux Next Mailing List

[-- Attachment #1: Type: text/plain, Size: 857 bytes --]

Hi all,

After merging the crypto tree, today's linux-next build (htmldocs)
produced these warnings:

include/crypto/hash.h:69: error: Cannot parse struct or union!
include/crypto/hash.h:69: error: Cannot parse struct or union!
include/crypto/hash.h:245: warning: Function parameter or member 'HASH_ALG_COMMON' not described in 'shash_alg'
include/crypto/hash.h:69: error: Cannot parse struct or union!
include/crypto/hash.h:69: error: Cannot parse struct or union!
include/crypto/hash.h:69: error: Cannot parse struct or union!
include/crypto/hash.h:69: error: Cannot parse struct or union!
include/crypto/hash.h:69: error: Cannot parse struct or union!
include/crypto/hash.h:69: error: Cannot parse struct or union!

Introduced by commit

  0e4e6d7094df ("crypto: hash - Count error stats differently")

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: linux-next: build warnings after merge of the crypto tree
  2015-03-11  2:00   ` Tadeusz Struk
@ 2015-03-11  2:05     ` Herbert Xu
  0 siblings, 0 replies; 15+ messages in thread
From: Herbert Xu @ 2015-03-11  2:05 UTC (permalink / raw)
  To: Tadeusz Struk
  Cc: Stephen Rothwell, linux-next, linux-kernel, Stephan Mueller,
	David S. Miller, Linux Crypto Mailing List, netdev

On Tue, Mar 10, 2015 at 07:00:26PM -0700, Tadeusz Struk wrote:
> On 03/09/2015 11:03 PM, Herbert Xu wrote:
> > This is a bit of a bummer.  What happened is that net-next has
> > killed the kiocb argument to sendmsg/recvmsg.  However, this
> > change is obviously not part of the crypto tree and algif_aead
> > only exists in the crypto tree.
> > 
> > So Stephen could you fix this by hand until one of them is merged
> > upstream (just kill the first argument in aead_sendmsg/aead_recvmsg)?
> 
> So does it mean that aio operations will not be supported on sockets?

Indeed.  If you want to have this ability you'll need to take
the discussion over to netdev.

Cheers,
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: linux-next: build warnings after merge of the crypto tree
  2015-03-10  6:03 ` Herbert Xu
  2015-03-10  6:44   ` Stephen Rothwell
@ 2015-03-11  2:00   ` Tadeusz Struk
  2015-03-11  2:05     ` Herbert Xu
  1 sibling, 1 reply; 15+ messages in thread
From: Tadeusz Struk @ 2015-03-11  2:00 UTC (permalink / raw)
  To: Herbert Xu, Stephen Rothwell
  Cc: linux-next, linux-kernel, Stephan Mueller, David S. Miller,
	Linux Crypto Mailing List, netdev

On 03/09/2015 11:03 PM, Herbert Xu wrote:
> This is a bit of a bummer.  What happened is that net-next has
> killed the kiocb argument to sendmsg/recvmsg.  However, this
> change is obviously not part of the crypto tree and algif_aead
> only exists in the crypto tree.
> 
> So Stephen could you fix this by hand until one of them is merged
> upstream (just kill the first argument in aead_sendmsg/aead_recvmsg)?

So does it mean that aio operations will not be supported on sockets?

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: linux-next: build warnings after merge of the crypto tree
  2015-03-11  0:56     ` Stephen Rothwell
@ 2015-03-11  0:57       ` Herbert Xu
  0 siblings, 0 replies; 15+ messages in thread
From: Herbert Xu @ 2015-03-11  0:57 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: linux-next, linux-kernel, Stephan Mueller, David S. Miller,
	Linux Crypto Mailing List, netdev

On Wed, Mar 11, 2015 at 11:56:37AM +1100, Stephen Rothwell wrote:
> 
> This is what I applied:
> 
> From: Stephen Rothwell <sfr@canb.auug.org.au>
> Date: Wed, 11 Mar 2015 11:51:30 +1100
> Subject: [PATCH] crypto: fix for sendmsg/recvmsg API change
> 
> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>

Looks good to me.  Thanks Stephen!
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: linux-next: build warnings after merge of the crypto tree
  2015-03-10  6:44   ` Stephen Rothwell
  2015-03-10  7:02     ` Stephan Mueller
@ 2015-03-11  0:56     ` Stephen Rothwell
  2015-03-11  0:57       ` Herbert Xu
  1 sibling, 1 reply; 15+ messages in thread
From: Stephen Rothwell @ 2015-03-11  0:56 UTC (permalink / raw)
  To: Herbert Xu
  Cc: linux-next, linux-kernel, Stephan Mueller, David S. Miller,
	Linux Crypto Mailing List, netdev

[-- Attachment #1: Type: text/plain, Size: 2569 bytes --]

Hi all,

On Tue, 10 Mar 2015 17:44:54 +1100 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
> On Tue, 10 Mar 2015 17:03:28 +1100 Herbert Xu <herbert@gondor.apana.org.au> wrote:
> >
> > On Tue, Mar 10, 2015 at 04:44:17PM +1100, Stephen Rothwell wrote:
> > > 
> > > After merging the crypto tree, today's (and the past few days)
> > > linux-next build (powerpc allyesconfig) produced these warnings:
> > > 
> > > crypto/algif_aead.c:561:2: warning: initialization from incompatible pointer type
> > >   .sendmsg = aead_sendmsg,
> > >   ^
> > > crypto/algif_aead.c:561:2: warning: (near initialization for 'algif_aead_ops.sendmsg')
> > > crypto/algif_aead.c:563:2: warning: initialization from incompatible pointer type
> > >   .recvmsg = aead_recvmsg,
> > >   ^
> > > crypto/algif_aead.c:563:2: warning: (near initialization for 'algif_aead_ops.recvmsg')
> > > 
> > > Introduced by commit 400c40cf78da ("crypto: algif - add AEAD support").
> > 
> > This is a bit of a bummer.  What happened is that net-next has
> > killed the kiocb argument to sendmsg/recvmsg.  However, this
> > change is obviously not part of the crypto tree and algif_aead
> > only exists in the crypto tree.
> > 
> > So Stephen could you fix this by hand until one of them is merged
> > upstream (just kill the first argument in aead_sendmsg/aead_recvmsg)?
> 
> No worries, I will put a merge fix patch in from tomorrow (and send you
> a copy just in case).

This is what I applied:

From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Wed, 11 Mar 2015 11:51:30 +1100
Subject: [PATCH] crypto: fix for sendmsg/recvmsg API change

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
 crypto/algif_aead.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/crypto/algif_aead.c b/crypto/algif_aead.c
index 527d27b023ab..001d8b5ad056 100644
--- a/crypto/algif_aead.c
+++ b/crypto/algif_aead.c
@@ -163,7 +163,7 @@ static void aead_data_wakeup(struct sock *sk)
 	rcu_read_unlock();
 }
 
-static int aead_sendmsg(struct kiocb *unused, struct socket *sock,
+static int aead_sendmsg(struct socket *sock,
 			struct msghdr *msg, size_t size)
 {
 	struct sock *sk = sock->sk;
@@ -348,7 +348,7 @@ unlock:
 	return err ?: size;
 }
 
-static int aead_recvmsg(struct kiocb *unused, struct socket *sock,
+static int aead_recvmsg(struct socket *sock,
 			struct msghdr *msg, size_t ignored, int flags)
 {
 	struct sock *sk = sock->sk;
-- 
2.1.4


-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: linux-next: build warnings after merge of the crypto tree
  2015-03-10  6:44   ` Stephen Rothwell
@ 2015-03-10  7:02     ` Stephan Mueller
  2015-03-11  0:56     ` Stephen Rothwell
  1 sibling, 0 replies; 15+ messages in thread
From: Stephan Mueller @ 2015-03-10  7:02 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Herbert Xu, linux-next, linux-kernel, David S. Miller,
	Linux Crypto Mailing List, netdev

Am Dienstag, 10. März 2015, 17:44:54 schrieb Stephen Rothwell:

Hi Stephen,

>Hi Herbert,
>
>On Tue, 10 Mar 2015 17:03:28 +1100 Herbert Xu 
<herbert@gondor.apana.org.au> wrote:
>> On Tue, Mar 10, 2015 at 04:44:17PM +1100, Stephen Rothwell wrote:
>> > After merging the crypto tree, today's (and the past few days)
>> > linux-next build (powerpc allyesconfig) produced these warnings:
>> > 
>> > crypto/algif_aead.c:561:2: warning: initialization from
>> > incompatible pointer type> > 
>> >   .sendmsg = aead_sendmsg,
>> >   ^
>> > 
>> > crypto/algif_aead.c:561:2: warning: (near initialization for
>> > 'algif_aead_ops.sendmsg') crypto/algif_aead.c:563:2: warning:
>> > initialization from incompatible pointer type> > 
>> >   .recvmsg = aead_recvmsg,
>> >   ^
>> > 
>> > crypto/algif_aead.c:563:2: warning: (near initialization for
>> > 'algif_aead_ops.recvmsg')
>> > 
>> > Introduced by commit 400c40cf78da ("crypto: algif - add AEAD
>> > support").> 
>> This is a bit of a bummer.  What happened is that net-next has
>> killed the kiocb argument to sendmsg/recvmsg.  However, this
>> change is obviously not part of the crypto tree and algif_aead
>> only exists in the crypto tree.
>> 
>> So Stephen could you fix this by hand until one of them is merged
>> upstream (just kill the first argument in aead_sendmsg/aead_recvmsg)?
>
>No worries, I will put a merge fix patch in from tomorrow (and send you
>a copy just in case).

Thank you. Let me know if I should help.


Ciao
Stephan

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: linux-next: build warnings after merge of the crypto tree
  2015-03-10  6:03 ` Herbert Xu
@ 2015-03-10  6:44   ` Stephen Rothwell
  2015-03-10  7:02     ` Stephan Mueller
  2015-03-11  0:56     ` Stephen Rothwell
  2015-03-11  2:00   ` Tadeusz Struk
  1 sibling, 2 replies; 15+ messages in thread
From: Stephen Rothwell @ 2015-03-10  6:44 UTC (permalink / raw)
  To: Herbert Xu
  Cc: linux-next, linux-kernel, Stephan Mueller, David S. Miller,
	Linux Crypto Mailing List, netdev

[-- Attachment #1: Type: text/plain, Size: 1397 bytes --]

Hi Herbert,

On Tue, 10 Mar 2015 17:03:28 +1100 Herbert Xu <herbert@gondor.apana.org.au> wrote:
>
> On Tue, Mar 10, 2015 at 04:44:17PM +1100, Stephen Rothwell wrote:
> > 
> > After merging the crypto tree, today's (and the past few days)
> > linux-next build (powerpc allyesconfig) produced these warnings:
> > 
> > crypto/algif_aead.c:561:2: warning: initialization from incompatible pointer type
> >   .sendmsg = aead_sendmsg,
> >   ^
> > crypto/algif_aead.c:561:2: warning: (near initialization for 'algif_aead_ops.sendmsg')
> > crypto/algif_aead.c:563:2: warning: initialization from incompatible pointer type
> >   .recvmsg = aead_recvmsg,
> >   ^
> > crypto/algif_aead.c:563:2: warning: (near initialization for 'algif_aead_ops.recvmsg')
> > 
> > Introduced by commit 400c40cf78da ("crypto: algif - add AEAD support").
> 
> This is a bit of a bummer.  What happened is that net-next has
> killed the kiocb argument to sendmsg/recvmsg.  However, this
> change is obviously not part of the crypto tree and algif_aead
> only exists in the crypto tree.
> 
> So Stephen could you fix this by hand until one of them is merged
> upstream (just kill the first argument in aead_sendmsg/aead_recvmsg)?

No worries, I will put a merge fix patch in from tomorrow (and send you
a copy just in case).

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: linux-next: build warnings after merge of the crypto tree
       [not found] <20150310164417.540c18a4@canb.auug.org.au>
@ 2015-03-10  6:03 ` Herbert Xu
  2015-03-10  6:44   ` Stephen Rothwell
  2015-03-11  2:00   ` Tadeusz Struk
  0 siblings, 2 replies; 15+ messages in thread
From: Herbert Xu @ 2015-03-10  6:03 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: linux-next, linux-kernel, Stephan Mueller, David S. Miller,
	Linux Crypto Mailing List, netdev

On Tue, Mar 10, 2015 at 04:44:17PM +1100, Stephen Rothwell wrote:
> Hi Herbert,
> 
> After merging the crypto tree, today's (and the past few days)
> linux-next build (powerpc allyesconfig) produced these warnings:
> 
> crypto/algif_aead.c:561:2: warning: initialization from incompatible pointer type
>   .sendmsg = aead_sendmsg,
>   ^
> crypto/algif_aead.c:561:2: warning: (near initialization for 'algif_aead_ops.sendmsg')
> crypto/algif_aead.c:563:2: warning: initialization from incompatible pointer type
>   .recvmsg = aead_recvmsg,
>   ^
> crypto/algif_aead.c:563:2: warning: (near initialization for 'algif_aead_ops.recvmsg')
> 
> Introduced by commit 400c40cf78da ("crypto: algif - add AEAD support").

This is a bit of a bummer.  What happened is that net-next has
killed the kiocb argument to sendmsg/recvmsg.  However, this
change is obviously not part of the crypto tree and algif_aead
only exists in the crypto tree.

So Stephen could you fix this by hand until one of them is merged
upstream (just kill the first argument in aead_sendmsg/aead_recvmsg)?

Thanks!
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2023-03-14  3:19 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20170206122837.0226fb89@canb.auug.org.au>
2017-02-06  9:03 ` linux-next: build warnings after merge of the crypto tree Herbert Xu
2017-02-06 12:54   ` crypto: atmel - Fix authenc compile test warnings kbuild test robot
2017-02-06 16:58   ` kbuild test robot
2017-02-06 19:02   ` kbuild test robot
2017-02-10  3:12   ` linux-next: build warnings after merge of the crypto tree Stephen Rothwell
2017-02-11 10:56     ` Herbert Xu
2017-02-12 23:42       ` Stephen Rothwell
2023-03-14  3:19 Stephen Rothwell
     [not found] <20150310164417.540c18a4@canb.auug.org.au>
2015-03-10  6:03 ` Herbert Xu
2015-03-10  6:44   ` Stephen Rothwell
2015-03-10  7:02     ` Stephan Mueller
2015-03-11  0:56     ` Stephen Rothwell
2015-03-11  0:57       ` Herbert Xu
2015-03-11  2:00   ` Tadeusz Struk
2015-03-11  2:05     ` Herbert Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).