[cryptodev:master 132/132] drivers/crypto/caam/caamalg.c:140:9: note: in expansion of macro 'min'

[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:   5ecf8ef9103cb018cbd82b6eace529ff4c5b5c66
commit: 5ecf8ef9103cb018cbd82b6eace529ff4c5b5c66 [132/132] crypto: caam - fix sg dump
config: arm64-allmodconfig (attached as .config)
compiler: aarch64-linux-gnu-gcc (Debian 6.1.1-9) 6.1.1 20160705
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
        git checkout 5ecf8ef9103cb018cbd82b6eace529ff4c5b5c66
        # save the attached .config to linux build tree
        make.cross ARCH=arm64 

All warnings (new ones prefixed by >>):

   In file included from drivers/crypto/caam/compat.h:8:0,
                    from drivers/crypto/caam/caamalg.c:47:
   drivers/crypto/caam/caamalg.c: In function 'dbg_dump_sg':
   include/linux/kernel.h:742:17: warning: comparison of distinct pointer types lacks a cast
     (void) (&_min1 == &_min2);  \
                    ^
>> drivers/crypto/caam/caamalg.c:140:9: note: in expansion of macro 'min'
      len = min(tlen, it->length);
            ^~~

vim +/min +140 drivers/crypto/caam/caamalg.c

    41	 * | SEQ_IN_PTR        |
    42	 * | (input buffer)    |
    43	 * | (input length)    |
    44	 * ---------------------
    45	 */
    46	
  > 47	#include "compat.h"
    48	
    49	#include "regs.h"
    50	#include "intern.h"
    51	#include "desc_constr.h"
    52	#include "jr.h"
    53	#include "error.h"
    54	#include "sg_sw_sec4.h"
    55	#include "key_gen.h"
    56	
    57	/*
    58	 * crypto alg
    59	 */
    60	#define CAAM_CRA_PRIORITY		3000
    61	/* max key is sum of AES_MAX_KEY_SIZE, max split key size */
    62	#define CAAM_MAX_KEY_SIZE		(AES_MAX_KEY_SIZE + \
    63						 CTR_RFC3686_NONCE_SIZE + \
    64						 SHA512_DIGEST_SIZE * 2)
    65	/* max IV is max of AES_BLOCK_SIZE, DES3_EDE_BLOCK_SIZE */
    66	#define CAAM_MAX_IV_LENGTH		16
    67	
    68	#define AEAD_DESC_JOB_IO_LEN		(DESC_JOB_IO_LEN + CAAM_CMD_SZ * 2)
    69	#define GCM_DESC_JOB_IO_LEN		(AEAD_DESC_JOB_IO_LEN + \
    70						 CAAM_CMD_SZ * 4)
    71	#define AUTHENC_DESC_JOB_IO_LEN		(AEAD_DESC_JOB_IO_LEN + \
    72						 CAAM_CMD_SZ * 5)
    73	
    74	/* length of descriptors text */
    75	#define DESC_AEAD_BASE			(4 * CAAM_CMD_SZ)
    76	#define DESC_AEAD_ENC_LEN		(DESC_AEAD_BASE + 11 * CAAM_CMD_SZ)
    77	#define DESC_AEAD_DEC_LEN		(DESC_AEAD_BASE + 15 * CAAM_CMD_SZ)
    78	#define DESC_AEAD_GIVENC_LEN		(DESC_AEAD_ENC_LEN + 9 * CAAM_CMD_SZ)
    79	
    80	/* Note: Nonce is counted in enckeylen */
    81	#define DESC_AEAD_CTR_RFC3686_LEN	(4 * CAAM_CMD_SZ)
    82	
    83	#define DESC_AEAD_NULL_BASE		(3 * CAAM_CMD_SZ)
    84	#define DESC_AEAD_NULL_ENC_LEN		(DESC_AEAD_NULL_BASE + 11 * CAAM_CMD_SZ)
    85	#define DESC_AEAD_NULL_DEC_LEN		(DESC_AEAD_NULL_BASE + 13 * CAAM_CMD_SZ)
    86	
    87	#define DESC_GCM_BASE			(3 * CAAM_CMD_SZ)
    88	#define DESC_GCM_ENC_LEN		(DESC_GCM_BASE + 16 * CAAM_CMD_SZ)
    89	#define DESC_GCM_DEC_LEN		(DESC_GCM_BASE + 12 * CAAM_CMD_SZ)
    90	
    91	#define DESC_RFC4106_BASE		(3 * CAAM_CMD_SZ)
    92	#define DESC_RFC4106_ENC_LEN		(DESC_RFC4106_BASE + 13 * CAAM_CMD_SZ)
    93	#define DESC_RFC4106_DEC_LEN		(DESC_RFC4106_BASE + 13 * CAAM_CMD_SZ)
    94	
    95	#define DESC_RFC4543_BASE		(3 * CAAM_CMD_SZ)
    96	#define DESC_RFC4543_ENC_LEN		(DESC_RFC4543_BASE + 11 * CAAM_CMD_SZ)
    97	#define DESC_RFC4543_DEC_LEN		(DESC_RFC4543_BASE + 12 * CAAM_CMD_SZ)
    98	
    99	#define DESC_ABLKCIPHER_BASE		(3 * CAAM_CMD_SZ)
   100	#define DESC_ABLKCIPHER_ENC_LEN		(DESC_ABLKCIPHER_BASE + \
   101						 20 * CAAM_CMD_SZ)
   102	#define DESC_ABLKCIPHER_DEC_LEN		(DESC_ABLKCIPHER_BASE + \
   103						 15 * CAAM_CMD_SZ)
   104	
   105	#define DESC_MAX_USED_BYTES		(CAAM_DESC_BYTES_MAX - DESC_JOB_IO_LEN)
   106	#define DESC_MAX_USED_LEN		(DESC_MAX_USED_BYTES / CAAM_CMD_SZ)
   107	
   108	#ifdef DEBUG
   109	/* for print_hex_dumps with line references */
   110	#define debug(format, arg...) printk(format, arg)
   111	#else
   112	#define debug(format, arg...)
   113	#endif
   114	
   115	#ifdef DEBUG
   116	#include <linux/highmem.h>
   117	
   118	static void dbg_dump_sg(const char *level, const char *prefix_str,
   119				int prefix_type, int rowsize, int groupsize,
   120				struct scatterlist *sg, size_t tlen, bool ascii,
   121				bool may_sleep)
   122	{
   123		struct scatterlist *it;
   124		void *it_page;
   125		size_t len;
   126		void *buf;
   127	
   128		for (it = sg; it != NULL && tlen > 0 ; it = sg_next(sg)) {
   129			/*
   130			 * make sure the scatterlist's page
   131			 * has a valid virtual memory mapping
   132			 */
   133			it_page = kmap_atomic(sg_page(it));
   134			if (unlikely(!it_page)) {
   135				printk(KERN_ERR "dbg_dump_sg: kmap failed\n");
   136				return;
   137			}
   138	
   139			buf = it_page + it->offset;
 > 140			len = min(tlen, it->length);
   141			print_hex_dump(level, prefix_str, prefix_type, rowsize,
   142				       groupsize, buf, len, ascii);
   143			tlen -= len;

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

Attachment: .config.gz
Description: application/gzip


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

  Powered by Linux