drivers/mtd/nand/raw/cadence-nand-controller.c:1283:12: warning: cast to pointer from integer of different size

From: kbuild test robot
Date: Fri Nov 29 2019 - 00:24:35 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 81b6b96475ac7a4ebfceae9f16fb3758327adbfe
commit: ec4ba01e894d3165e4d1ccbef782ef5593b708b4 mtd: rawnand: Add new Cadence NAND driver to MTD subsystem
date: 8 weeks ago
config: i386-randconfig-f002-20191129 (attached as .config)
compiler: gcc-7 (Debian 7.5.0-1) 7.5.0
reproduce:
git checkout ec4ba01e894d3165e4d1ccbef782ef5593b708b4
# save the attached .config to linux build tree
make ARCH=i386

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

All warnings (new ones prefixed by >>):

drivers/mtd/nand/raw/cadence-nand-controller.c: In function 'cadence_nand_cdma_transfer':
>> drivers/mtd/nand/raw/cadence-nand-controller.c:1283:12: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
(void *)dma_buf, (void *)dma_ctrl_dat,
^
drivers/mtd/nand/raw/cadence-nand-controller.c:1283:29: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
(void *)dma_buf, (void *)dma_ctrl_dat,
^

vim +1283 drivers/mtd/nand/raw/cadence-nand-controller.c

1246
1247 static int
1248 cadence_nand_cdma_transfer(struct cdns_nand_ctrl *cdns_ctrl, u8 chip_nr,
1249 int page, void *buf, void *ctrl_dat, u32 buf_size,
1250 u32 ctrl_dat_size, enum dma_data_direction dir,
1251 bool with_ecc)
1252 {
1253 dma_addr_t dma_buf, dma_ctrl_dat = 0;
1254 u8 thread_nr = chip_nr;
1255 int status;
1256 u16 ctype;
1257
1258 if (dir == DMA_FROM_DEVICE)
1259 ctype = CDMA_CT_RD;
1260 else
1261 ctype = CDMA_CT_WR;
1262
1263 cadence_nand_set_ecc_enable(cdns_ctrl, with_ecc);
1264
1265 dma_buf = dma_map_single(cdns_ctrl->dev, buf, buf_size, dir);
1266 if (dma_mapping_error(cdns_ctrl->dev, dma_buf)) {
1267 dev_err(cdns_ctrl->dev, "Failed to map DMA buffer\n");
1268 return -EIO;
1269 }
1270
1271 if (ctrl_dat && ctrl_dat_size) {
1272 dma_ctrl_dat = dma_map_single(cdns_ctrl->dev, ctrl_dat,
1273 ctrl_dat_size, dir);
1274 if (dma_mapping_error(cdns_ctrl->dev, dma_ctrl_dat)) {
1275 dma_unmap_single(cdns_ctrl->dev, dma_buf,
1276 buf_size, dir);
1277 dev_err(cdns_ctrl->dev, "Failed to map DMA buffer\n");
1278 return -EIO;
1279 }
1280 }
1281
1282 cadence_nand_cdma_desc_prepare(cdns_ctrl, chip_nr, page,
> 1283 (void *)dma_buf, (void *)dma_ctrl_dat,
1284 ctype);
1285
1286 status = cadence_nand_cdma_send_and_wait(cdns_ctrl, thread_nr);
1287
1288 dma_unmap_single(cdns_ctrl->dev, dma_buf,
1289 buf_size, dir);
1290
1291 if (ctrl_dat && ctrl_dat_size)
1292 dma_unmap_single(cdns_ctrl->dev, dma_ctrl_dat,
1293 ctrl_dat_size, dir);
1294 if (status)
1295 return status;
1296
1297 return cadence_nand_cdma_finish(cdns_ctrl);
1298 }
1299

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

Attachment: .config.gz
Description: application/gzip