Re: [PATCH v4 11/16] block: sed-opal: ioctl for writing to shadow mbr

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Jonas,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on block/for-next]
[also build test WARNING on v5.0-rc4 next-20190204]
[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/David-Kozub/block-sed-opal-support-shadow-MBR-done-flag-and-write/20190205-005425
base:   https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git for-next
config: i386-randconfig-x002-201905 (attached as .config)
compiler: gcc-8 (Debian 8.2.0-14) 8.2.0
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

All warnings (new ones prefixed by >>):

   block/sed-opal.c: In function 'write_shadow_mbr':
>> block/sed-opal.c:1520:8: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
     src = (u8 *) shadow->data;
           ^

vim +1520 block/sed-opal.c

  1509	
  1510	static int write_shadow_mbr(struct opal_dev *dev, void *data)
  1511	{
  1512		struct opal_shadow_mbr *shadow = data;
  1513		const u8 __user *src;
  1514		u8 *dst;
  1515		size_t off = 0;
  1516		u64 len;
  1517		int err = 0;
  1518	
  1519		/* do the actual transmission(s) */
> 1520		src = (u8 *) shadow->data;
  1521		while (off < shadow->size) {
  1522			err = cmd_start(dev, opaluid[OPAL_MBR], opalmethod[OPAL_SET]);
  1523			add_token_u8(&err, dev, OPAL_STARTNAME);
  1524			add_token_u8(&err, dev, OPAL_WHERE);
  1525			add_token_u64(&err, dev, shadow->offset + off);
  1526			add_token_u8(&err, dev, OPAL_ENDNAME);
  1527	
  1528			add_token_u8(&err, dev, OPAL_STARTNAME);
  1529			add_token_u8(&err, dev, OPAL_VALUES);
  1530	
  1531			/*
  1532			 * The bytestring header is either 1 or 2 bytes, so assume 2.
  1533			 * There also needs to be enough space to accommodate the
  1534			 * trailing OPAL_ENDNAME (1 byte) and tokens added by
  1535			 * cmd_finalize.
  1536			 */
  1537			len = min(remaining_size(dev) - (2+1+CMD_FINALIZE_BYTES_NEEDED),
  1538				  (size_t)(shadow->size - off));
  1539			pr_debug("MBR: write bytes %zu+%llu/%llu\n",
  1540				 off, len, shadow->size);
  1541	
  1542			dst = add_bytestring_header(&err, dev, len);
  1543			if (!dst)
  1544				break;
  1545			if (copy_from_user(dst, src + off, len))
  1546				err = -EFAULT;
  1547			dev->pos += len;
  1548	
  1549			add_token_u8(&err, dev, OPAL_ENDNAME);
  1550			if (err)
  1551				break;
  1552	
  1553			err = finalize_and_send(dev, parse_and_check_status);
  1554			if (err)
  1555				break;
  1556	
  1557			off += len;
  1558		}
  1559		return err;
  1560	}
  1561	

---
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]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux