From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============2209362743367726503==" MIME-Version: 1.0 From: kernel test robot To: kbuild-all@lists.01.org Subject: [android-common:upstream-f2fs-stable-linux-4.14.y 1255/1431] drivers/md/bitmap.c:382:32: warning: passing argument 2 of 'bmap' makes pointer from integer without a cast Date: Thu, 20 Jan 2022 12:08:35 +0800 Message-ID: <202201201153.CiFuSOUM-lkp@intel.com> List-Id: --===============2209362743367726503== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Hi Carlos, FYI, the error/warning still remains. tree: https://android.googlesource.com/kernel/common upstream-f2fs-stable= -linux-4.14.y head: a1f8c5458f03b609b124191a55118e9c11109442 commit: ea4899e2410d1394cc4857298ecf8cc511d5afd4 [1255/1431] fs: Enable bma= p() function to properly return errors config: i386-randconfig-a003-20220117 (https://download.01.org/0day-ci/arch= ive/20220120/202201201153.CiFuSOUM-lkp(a)intel.com/config) compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0 reproduce (this is a W=3D1 build): git remote add android-common https://android.googlesource.com/kern= el/common git fetch --no-tags android-common upstream-f2fs-stable-linux-4.14.y git checkout ea4899e2410d1394cc4857298ecf8cc511d5afd4 # save the config file to linux build tree mkdir build_dir make W=3D1 O=3Dbuild_dir ARCH=3Di386 SHELL=3D/bin/bash drivers/md/ If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot All warnings (new ones prefixed by >>): drivers/md/bitmap.c: In function 'read_page': >> drivers/md/bitmap.c:382:32: warning: passing argument 2 of 'bmap' makes = pointer from integer without a cast [-Wint-conversion] bh->b_blocknr =3D bmap(inode, block); ^~~~~ In file included from include/linux/genhd.h:68:0, from include/linux/blkdev.h:11, from drivers/md/bitmap.c:18: include/linux/fs.h:2729:12: note: expected 'sector_t * {aka long long un= signed int *}' but argument is of type 'sector_t {aka long long unsigned in= t}' extern int bmap(struct inode *inode, sector_t *block); ^~~~ arch/x86/include/asm/bitops.h: Assembler messages: arch/x86/include/asm/bitops.h:225: Warning: no instruction mnemonic suff= ix given and no register operands; using default for `bts' arch/x86/include/asm/bitops.h:271: Warning: no instruction mnemonic suff= ix given and no register operands; using default for `btr' vim +/bmap +382 drivers/md/bitmap.c 32a7627cf3a353 NeilBrown 2005-06-21 350 = d785a06a0b9d0c NeilBrown 2006-06-26 351 /* read a page from a file. d785a06a0b9d0c NeilBrown 2006-06-26 352 * We both read the page, and= attach buffers to the page to record the d785a06a0b9d0c NeilBrown 2006-06-26 353 * address of each block (usi= ng bmap). These addresses will be used d785a06a0b9d0c NeilBrown 2006-06-26 354 * to write the block later, = completely bypassing the filesystem. d785a06a0b9d0c NeilBrown 2006-06-26 355 * This usage is similar to h= ow swap files are handled, and allows us d785a06a0b9d0c NeilBrown 2006-06-26 356 * to write to a file with no= concerns of memory allocation failing. d785a06a0b9d0c NeilBrown 2006-06-26 357 */ 27581e5ae01f77 NeilBrown 2012-05-22 358 static int read_page(struct f= ile *file, unsigned long index, d785a06a0b9d0c NeilBrown 2006-06-26 359 struct bitmap *bitmap, 27581e5ae01f77 NeilBrown 2012-05-22 360 unsigned long count, 27581e5ae01f77 NeilBrown 2012-05-22 361 struct page *page) 32a7627cf3a353 NeilBrown 2005-06-21 362 { 27581e5ae01f77 NeilBrown 2012-05-22 363 int ret =3D 0; 496ad9aa8ef448 Al Viro 2013-01-23 364 struct inode *inode =3D file= _inode(file); d785a06a0b9d0c NeilBrown 2006-06-26 365 struct buffer_head *bh; d785a06a0b9d0c NeilBrown 2006-06-26 366 sector_t block; 32a7627cf3a353 NeilBrown 2005-06-21 367 = 36a4e1fe0f4541 NeilBrown 2011-10-07 368 pr_debug("read bitmap file (= %dB @ %llu)\n", (int)PAGE_SIZE, 2d1f3b5d1b2cd1 NeilBrown 2006-01-06 369 (unsigned long long)index = << PAGE_SHIFT); 32a7627cf3a353 NeilBrown 2005-06-21 370 = d785a06a0b9d0c NeilBrown 2006-06-26 371 bh =3D alloc_page_buffers(pa= ge, 1<i_blkbits, 0); d785a06a0b9d0c NeilBrown 2006-06-26 372 if (!bh) { 27581e5ae01f77 NeilBrown 2012-05-22 373 ret =3D -ENOMEM; d785a06a0b9d0c NeilBrown 2006-06-26 374 goto out; d785a06a0b9d0c NeilBrown 2006-06-26 375 } d785a06a0b9d0c NeilBrown 2006-06-26 376 attach_page_buffers(page, bh= ); d785a06a0b9d0c NeilBrown 2006-06-26 377 block =3D index << (PAGE_SHI= FT - inode->i_blkbits); d785a06a0b9d0c NeilBrown 2006-06-26 378 while (bh) { d785a06a0b9d0c NeilBrown 2006-06-26 379 if (count =3D=3D 0) d785a06a0b9d0c NeilBrown 2006-06-26 380 bh->b_blocknr =3D 0; d785a06a0b9d0c NeilBrown 2006-06-26 381 else { d785a06a0b9d0c NeilBrown 2006-06-26 @382 bh->b_blocknr =3D bmap(ino= de, block); d785a06a0b9d0c NeilBrown 2006-06-26 383 if (bh->b_blocknr =3D=3D 0= ) { d785a06a0b9d0c NeilBrown 2006-06-26 384 /* Cannot use this file! = */ 27581e5ae01f77 NeilBrown 2012-05-22 385 ret =3D -EINVAL; d785a06a0b9d0c NeilBrown 2006-06-26 386 goto out; d785a06a0b9d0c NeilBrown 2006-06-26 387 } d785a06a0b9d0c NeilBrown 2006-06-26 388 bh->b_bdev =3D inode->i_sb= ->s_bdev; d785a06a0b9d0c NeilBrown 2006-06-26 389 if (count < (1<i_b= lkbits)) d785a06a0b9d0c NeilBrown 2006-06-26 390 count =3D 0; 32a7627cf3a353 NeilBrown 2005-06-21 391 else d785a06a0b9d0c NeilBrown 2006-06-26 392 count -=3D (1<i_b= lkbits); d785a06a0b9d0c NeilBrown 2006-06-26 393 = d785a06a0b9d0c NeilBrown 2006-06-26 394 bh->b_end_io =3D end_bitma= p_write; d785a06a0b9d0c NeilBrown 2006-06-26 395 bh->b_private =3D bitmap; ce25c31bdd3b39 NeilBrown 2006-06-26 396 atomic_inc(&bitmap->pendin= g_writes); ce25c31bdd3b39 NeilBrown 2006-06-26 397 set_buffer_locked(bh); ce25c31bdd3b39 NeilBrown 2006-06-26 398 set_buffer_mapped(bh); 2a222ca992c35a Mike Christie 2016-06-05 399 submit_bh(REQ_OP_READ, 0, = bh); d785a06a0b9d0c NeilBrown 2006-06-26 400 } d785a06a0b9d0c NeilBrown 2006-06-26 401 block++; d785a06a0b9d0c NeilBrown 2006-06-26 402 bh =3D bh->b_this_page; d785a06a0b9d0c NeilBrown 2006-06-26 403 } d785a06a0b9d0c NeilBrown 2006-06-26 404 page->index =3D index; ce25c31bdd3b39 NeilBrown 2006-06-26 405 = ce25c31bdd3b39 NeilBrown 2006-06-26 406 wait_event(bitmap->write_wai= t, ce25c31bdd3b39 NeilBrown 2006-06-26 407 atomic_read(&bitmap->pen= ding_writes)=3D=3D0); b405fe91e50c60 NeilBrown 2012-05-22 408 if (test_bit(BITMAP_WRITE_ER= ROR, &bitmap->flags)) 27581e5ae01f77 NeilBrown 2012-05-22 409 ret =3D -EIO; 32a7627cf3a353 NeilBrown 2005-06-21 410 out: 27581e5ae01f77 NeilBrown 2012-05-22 411 if (ret) ec0cc226854a79 NeilBrown 2016-11-02 412 pr_err("md: bitmap read err= or: (%dB @ %llu): %d\n", 2d1f3b5d1b2cd1 NeilBrown 2006-01-06 413 (int)PAGE_SIZE, 2d1f3b5d1b2cd1 NeilBrown 2006-01-06 414 (unsigned long long)= index << PAGE_SHIFT, 27581e5ae01f77 NeilBrown 2012-05-22 415 ret); 27581e5ae01f77 NeilBrown 2012-05-22 416 return ret; 32a7627cf3a353 NeilBrown 2005-06-21 417 } 32a7627cf3a353 NeilBrown 2005-06-21 418 = :::::: The code@line 382 was first introduced by commit :::::: d785a06a0b9d0cd86b3cc1bf8e236e62af7b47ed [PATCH] md/bitmap: change m= d/bitmap file handling to use bmap to file blocks :::::: TO: NeilBrown :::::: CC: Linus Torvalds --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org --===============2209362743367726503==--