drivers/crypto/sa2ul.c:1349:33: warning: cast from pointer to integer of different size

From: kernel test robot
Date: Sat Aug 08 2020 - 20:47:47 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 06a81c1c7db9bd5de0bd38cd5acc44bb22b99150
commit: 2dc53d0047458e28ed05b4548844ba78199857bf crypto: sa2ul - add sha1/sha256/sha512 support
date: 2 weeks ago
config: m68k-randconfig-r002-20200809 (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
git checkout 2dc53d0047458e28ed05b4548844ba78199857bf
# 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 warnings (new ones prefixed by >>):

In file included from include/linux/err.h:5,
from include/linux/clk.h:12,
from drivers/crypto/sa2ul.c:11:
include/linux/scatterlist.h: In function 'sg_set_buf':
arch/m68k/include/asm/page_no.h:33:50: warning: ordered comparison of pointer with null pointer [-Wextra]
33 | #define virt_addr_valid(kaddr) (((void *)(kaddr) >= (void *)PAGE_OFFSET) && \
| ^~
include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
78 | # define unlikely(x) __builtin_expect(!!(x), 0)
| ^
include/linux/scatterlist.h:143:2: note: in expansion of macro 'BUG_ON'
143 | BUG_ON(!virt_addr_valid(buf));
| ^~~~~~
include/linux/scatterlist.h:143:10: note: in expansion of macro 'virt_addr_valid'
143 | BUG_ON(!virt_addr_valid(buf));
| ^~~~~~~~~~~~~~~
In file included from include/linux/device.h:15,
from include/linux/dmaengine.h:8,
from drivers/crypto/sa2ul.c:12:
drivers/crypto/sa2ul.c: In function 'sa_sha_init':
>> drivers/crypto/sa2ul.c:1349:33: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
1349 | crypto_ahash_digestsize(tfm), (u64)rctx);
| ^
include/linux/dev_printk.h:123:47: note: in definition of macro 'dev_dbg'
123 | dev_printk(KERN_DEBUG, dev, dev_fmt(fmt), ##__VA_ARGS__); \
| ^~~~~~~~~~~

vim +1349 drivers/crypto/sa2ul.c

1341
1342 static int sa_sha_init(struct ahash_request *req)
1343 {
1344 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req);
1345 struct sa_sha_req_ctx *rctx = ahash_request_ctx(req);
1346 struct sa_tfm_ctx *ctx = crypto_ahash_ctx(tfm);
1347
1348 dev_dbg(sa_k3_dev, "init: digest size: %d, rctx=%llx\n",
> 1349 crypto_ahash_digestsize(tfm), (u64)rctx);
1350
1351 ahash_request_set_tfm(&rctx->fallback_req, ctx->fallback.ahash);
1352 rctx->fallback_req.base.flags =
1353 req->base.flags & CRYPTO_TFM_REQ_MAY_SLEEP;
1354
1355 return crypto_ahash_init(&rctx->fallback_req);
1356 }
1357

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

Attachment: .config.gz
Description: application/gzip