lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202101080118.ecgdfxnz-lkp@intel.com>
Date:   Fri, 8 Jan 2021 01:25:25 +0800
From:   kernel test robot <lkp@...el.com>
To:     Tyrel Datwyler <tyreld@...ux.ibm.com>
Cc:     kbuild-all@...ts.01.org, clang-built-linux@...glegroups.com,
        linux-kernel@...r.kernel.org,
        "Martin K. Petersen" <martin.petersen@...cle.com>
Subject: drivers/scsi/ibmvscsi/ibmvfc.c:1696:25: warning: incompatible
 pointer to integer conversion passing 'struct ibmvfc_event to parameter of
 type '__u64' (aka 'unsigned long long')

Hi Tyrel,

FYI, the error/warning still remains.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   e71ba9452f0b5b2e8dc8aa5445198cd9214a6a62
commit: 2aa0102c6688306548d81a958a6293936904ca75 scsi: ibmvfc: Use correlation token to tag commands
date:   7 weeks ago
config: powerpc-randconfig-r001-20210107 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 5c951623bc8965fa1e89660f2f5f4a2944e4981a)
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
        # install powerpc cross compiling tool for clang build
        # apt-get install binutils-powerpc-linux-gnu
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=2aa0102c6688306548d81a958a6293936904ca75
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 2aa0102c6688306548d81a958a6293936904ca75
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=powerpc 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@...el.com>

All warnings (new ones prefixed by >>):

>> drivers/scsi/ibmvscsi/ibmvfc.c:1696:25: warning: incompatible pointer to integer conversion passing 'struct ibmvfc_event *' to parameter of type '__u64' (aka 'unsigned long long') [-Wint-conversion]
           vfc_cmd->correlation = cpu_to_be64(evt);
                                  ^~~~~~~~~~~~~~~~
   include/linux/byteorder/generic.h:92:21: note: expanded from macro 'cpu_to_be64'
   #define cpu_to_be64 __cpu_to_be64
                       ^
   include/uapi/linux/byteorder/little_endian.h:37:52: note: expanded from macro '__cpu_to_be64'
   #define __cpu_to_be64(x) ((__force __be64)__swab64((x)))
                                             ~~~~~~~~~^~~~
   include/uapi/linux/swab.h:133:12: note: expanded from macro '__swab64'
           __fswab64(x))
                     ^
   include/uapi/linux/swab.h:66:57: note: passing argument to parameter 'val' here
   static inline __attribute_const__ __u64 __fswab64(__u64 val)
                                                           ^
   drivers/scsi/ibmvscsi/ibmvfc.c:2375:22: warning: incompatible pointer to integer conversion passing 'struct ibmvfc_event *' to parameter of type '__u64' (aka 'unsigned long long') [-Wint-conversion]
                   tmf->correlation = cpu_to_be64(evt);
                                      ^~~~~~~~~~~~~~~~
   include/linux/byteorder/generic.h:92:21: note: expanded from macro 'cpu_to_be64'
   #define cpu_to_be64 __cpu_to_be64
                       ^
   include/uapi/linux/byteorder/little_endian.h:37:52: note: expanded from macro '__cpu_to_be64'
   #define __cpu_to_be64(x) ((__force __be64)__swab64((x)))
                                             ~~~~~~~~~^~~~
   include/uapi/linux/swab.h:133:12: note: expanded from macro '__swab64'
           __fswab64(x))
                     ^
   include/uapi/linux/swab.h:66:57: note: passing argument to parameter 'val' here
   static inline __attribute_const__ __u64 __fswab64(__u64 val)
                                                           ^
   2 warnings generated.


vim +1696 drivers/scsi/ibmvscsi/ibmvfc.c

  1648	
  1649	/**
  1650	 * ibmvfc_queuecommand - The queuecommand function of the scsi template
  1651	 * @cmnd:	struct scsi_cmnd to be executed
  1652	 * @done:	Callback function to be called when cmnd is completed
  1653	 *
  1654	 * Returns:
  1655	 *	0 on success / other on failure
  1656	 **/
  1657	static int ibmvfc_queuecommand_lck(struct scsi_cmnd *cmnd,
  1658				       void (*done) (struct scsi_cmnd *))
  1659	{
  1660		struct ibmvfc_host *vhost = shost_priv(cmnd->device->host);
  1661		struct fc_rport *rport = starget_to_rport(scsi_target(cmnd->device));
  1662		struct ibmvfc_cmd *vfc_cmd;
  1663		struct ibmvfc_event *evt;
  1664		int rc;
  1665	
  1666		if (unlikely((rc = fc_remote_port_chkready(rport))) ||
  1667		    unlikely((rc = ibmvfc_host_chkready(vhost)))) {
  1668			cmnd->result = rc;
  1669			done(cmnd);
  1670			return 0;
  1671		}
  1672	
  1673		cmnd->result = (DID_OK << 16);
  1674		evt = ibmvfc_get_event(vhost);
  1675		ibmvfc_init_event(evt, ibmvfc_scsi_done, IBMVFC_CMD_FORMAT);
  1676		evt->cmnd = cmnd;
  1677		cmnd->scsi_done = done;
  1678		vfc_cmd = &evt->iu.cmd;
  1679		memset(vfc_cmd, 0, sizeof(*vfc_cmd));
  1680		vfc_cmd->resp.va = cpu_to_be64(be64_to_cpu(evt->crq.ioba) + offsetof(struct ibmvfc_cmd, rsp));
  1681		vfc_cmd->resp.len = cpu_to_be32(sizeof(vfc_cmd->rsp));
  1682		vfc_cmd->frame_type = cpu_to_be32(IBMVFC_SCSI_FCP_TYPE);
  1683		vfc_cmd->payload_len = cpu_to_be32(sizeof(vfc_cmd->iu));
  1684		vfc_cmd->resp_len = cpu_to_be32(sizeof(vfc_cmd->rsp));
  1685		vfc_cmd->cancel_key = cpu_to_be32((unsigned long)cmnd->device->hostdata);
  1686		vfc_cmd->tgt_scsi_id = cpu_to_be64(rport->port_id);
  1687		vfc_cmd->iu.xfer_len = cpu_to_be32(scsi_bufflen(cmnd));
  1688		int_to_scsilun(cmnd->device->lun, &vfc_cmd->iu.lun);
  1689		memcpy(vfc_cmd->iu.cdb, cmnd->cmnd, cmnd->cmd_len);
  1690	
  1691		if (cmnd->flags & SCMD_TAGGED) {
  1692			vfc_cmd->task_tag = cpu_to_be64(cmnd->tag);
  1693			vfc_cmd->iu.pri_task_attr = IBMVFC_SIMPLE_TASK;
  1694		}
  1695	
> 1696		vfc_cmd->correlation = cpu_to_be64(evt);
  1697	
  1698		if (likely(!(rc = ibmvfc_map_sg_data(cmnd, evt, vfc_cmd, vhost->dev))))
  1699			return ibmvfc_send_event(evt, vhost, 0);
  1700	
  1701		ibmvfc_free_event(evt);
  1702		if (rc == -ENOMEM)
  1703			return SCSI_MLQUEUE_HOST_BUSY;
  1704	
  1705		if (vhost->log_level > IBMVFC_DEFAULT_LOG_LEVEL)
  1706			scmd_printk(KERN_ERR, cmnd,
  1707				    "Failed to map DMA buffer for command. rc=%d\n", rc);
  1708	
  1709		cmnd->result = DID_ERROR << 16;
  1710		done(cmnd);
  1711		return 0;
  1712	}
  1713	

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

Download attachment ".config.gz" of type "application/gzip" (42764 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ