* [bvanassche:scsi-for-next 41/41] drivers/scsi/ibmvscsi/ibmvfc.c:1956:51: warning: format '%d' expects argument of type 'int', but argument 4 has type 'union scsi_status'
@ 2021-04-14 16:14 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2021-04-14 16:14 UTC (permalink / raw)
To: kbuild-all
[-- Attachment #1: Type: text/plain, Size: 11278 bytes --]
tree: https://github.com/bvanassche/linux scsi-for-next
head: d8044d773ae9d9e70f9c61f98296c6c8391447ad
commit: d8044d773ae9d9e70f9c61f98296c6c8391447ad [41/41] Change the return type of fc_remote_port_chkready() into union scsi_status
config: powerpc-allyesconfig (attached as .config)
compiler: powerpc64-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
# https://github.com/bvanassche/linux/commit/d8044d773ae9d9e70f9c61f98296c6c8391447ad
git remote add bvanassche https://github.com/bvanassche/linux
git fetch --no-tags bvanassche scsi-for-next
git checkout d8044d773ae9d9e70f9c61f98296c6c8391447ad
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross W=1 ARCH=powerpc
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
drivers/scsi/ibmvscsi/ibmvfc.c: In function 'ibmvfc_get_err_result':
drivers/scsi/ibmvscsi/ibmvfc.c:348:52: error: request for member 'combined' in something not a structure or union
348 | return rsp->scsi_status | (cmd_status[err].result.combined << 16);
| ^
In file included from include/linux/kernel.h:10,
from include/linux/list.h:9,
from include/linux/module.h:12,
from drivers/scsi/ibmvscsi/ibmvfc.c:10:
drivers/scsi/ibmvscsi/ibmvfc.c: In function 'ibmvfc_queuecommand':
include/linux/compiler.h:78:40: error: wrong type argument to unary exclamation mark
78 | # define unlikely(x) __builtin_expect(!!(x), 0)
| ^
drivers/scsi/ibmvscsi/ibmvfc.c:1916:6: note: in expansion of macro 'unlikely'
1916 | if (unlikely((rc = fc_remote_port_chkready(rport))) ||
| ^~~~~~~~
include/linux/compiler.h:78:40: error: wrong type argument to unary exclamation mark
78 | # define unlikely(x) __builtin_expect(!!(x), 0)
| ^
drivers/scsi/ibmvscsi/ibmvfc.c:1917:6: note: in expansion of macro 'unlikely'
1917 | unlikely((rc = ibmvfc_host_chkready(vhost)))) {
| ^~~~~~~~
drivers/scsi/ibmvscsi/ibmvfc.c:1947:20: error: incompatible types when assigning to type 'union scsi_status' from type 'int'
1947 | if (likely(!(rc = ibmvfc_map_sg_data(cmnd, evt, vfc_cmd, vhost->dev))))
| ^~~~~~~~~~~~~~~~~~
include/linux/compiler.h:77:40: note: in definition of macro 'likely'
77 | # define likely(x) __builtin_expect(!!(x), 1)
| ^
drivers/scsi/ibmvscsi/ibmvfc.c:1951:9: error: invalid operands to binary == (have 'union scsi_status' and 'int')
1951 | if (rc == -ENOMEM)
| ^~
>> drivers/scsi/ibmvscsi/ibmvfc.c:1956:51: warning: format '%d' expects argument of type 'int', but argument 4 has type 'union scsi_status' [-Wformat=]
1956 | "Failed to map DMA buffer for command. rc=%d\n", rc);
| ~^ ~~
| | |
| int union scsi_status
In file included from include/linux/kernel.h:10,
from include/linux/list.h:9,
from include/linux/module.h:12,
from drivers/scsi/ibmvscsi/ibmvfc.c:10:
drivers/scsi/ibmvscsi/ibmvfc.c: In function 'ibmvfc_bsg_plogi':
drivers/scsi/ibmvscsi/ibmvfc.c:2071:21: error: incompatible types when assigning to type 'int' from type 'union scsi_status'
2071 | if (unlikely((rc = ibmvfc_host_chkready(vhost))))
| ^~~~~~~~~~~~~~~~~~~~
include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
78 | # define unlikely(x) __builtin_expect(!!(x), 0)
| ^
drivers/scsi/ibmvscsi/ibmvfc.c: In function 'ibmvfc_bsg_request':
drivers/scsi/ibmvscsi/ibmvfc.c:2241:29: error: incompatible type for argument 2 of 'bsg_job_done'
2241 | bsg_job_done(job, bsg_reply->result,
| ~~~~~~~~~^~~~~~~~
| |
| union scsi_status
In file included from drivers/scsi/ibmvscsi/ibmvfc.c:21:
include/linux/bsg-lib.h:65:44: note: expected 'int' but argument is of type 'union scsi_status'
65 | void bsg_job_done(struct bsg_job *job, int result,
| ~~~~^~~~~~
drivers/scsi/ibmvscsi/ibmvfc.c: In function 'ibmvfc_slave_alloc':
drivers/scsi/ibmvscsi/ibmvfc.c:3308:13: error: invalid operands to binary || (have 'int' and 'union scsi_status')
3308 | if (!rport || fc_remote_port_chkready(rport))
| ~~~~~~ ^~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| | |
| int union scsi_status
vim +1956 drivers/scsi/ibmvscsi/ibmvfc.c
fad74a1be2dbea Tyrel Datwyler 2020-11-17 1895
072b91f9c6510d Brian King 2008-07-01 1896 /**
072b91f9c6510d Brian King 2008-07-01 1897 * ibmvfc_queuecommand - The queuecommand function of the scsi template
dd9c772971485d Lee Jones 2021-03-17 1898 * @shost: scsi host struct
072b91f9c6510d Brian King 2008-07-01 1899 * @cmnd: struct scsi_cmnd to be executed
072b91f9c6510d Brian King 2008-07-01 1900 *
072b91f9c6510d Brian King 2008-07-01 1901 * Returns:
072b91f9c6510d Brian King 2008-07-01 1902 * 0 on success / other on failure
072b91f9c6510d Brian King 2008-07-01 1903 **/
654080d02edb60 Tyrel Datwyler 2021-01-06 1904 static int ibmvfc_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *cmnd)
072b91f9c6510d Brian King 2008-07-01 1905 {
654080d02edb60 Tyrel Datwyler 2021-01-06 1906 struct ibmvfc_host *vhost = shost_priv(shost);
072b91f9c6510d Brian King 2008-07-01 1907 struct fc_rport *rport = starget_to_rport(scsi_target(cmnd->device));
072b91f9c6510d Brian King 2008-07-01 1908 struct ibmvfc_cmd *vfc_cmd;
5a9d16f71c264a Tyrel Datwyler 2020-11-17 1909 struct ibmvfc_fcp_cmd_iu *iu;
072b91f9c6510d Brian King 2008-07-01 1910 struct ibmvfc_event *evt;
cb72477be7290c Tyrel Datwyler 2021-01-14 1911 u32 tag_and_hwq = blk_mq_unique_tag(cmnd->request);
cb72477be7290c Tyrel Datwyler 2021-01-14 1912 u16 hwq = blk_mq_unique_tag_to_hwq(tag_and_hwq);
31750fbd7b6dec Tyrel Datwyler 2021-01-14 1913 u16 scsi_channel;
d8044d773ae9d9 Bart Van Assche 2021-04-13 1914 union scsi_status rc;
072b91f9c6510d Brian King 2008-07-01 1915
072b91f9c6510d Brian King 2008-07-01 1916 if (unlikely((rc = fc_remote_port_chkready(rport))) ||
072b91f9c6510d Brian King 2008-07-01 1917 unlikely((rc = ibmvfc_host_chkready(vhost)))) {
d8044d773ae9d9 Bart Van Assche 2021-04-13 1918 cmnd->result = rc;
654080d02edb60 Tyrel Datwyler 2021-01-06 1919 cmnd->scsi_done(cmnd);
072b91f9c6510d Brian King 2008-07-01 1920 return 0;
072b91f9c6510d Brian King 2008-07-01 1921 }
072b91f9c6510d Brian King 2008-07-01 1922
fd78f07ace9e37 Bart Van Assche 2021-04-09 1923 cmnd->result.combined = (DID_OK << 16);
31750fbd7b6dec Tyrel Datwyler 2021-01-14 1924 if (vhost->using_channels) {
31750fbd7b6dec Tyrel Datwyler 2021-01-14 1925 scsi_channel = hwq % vhost->scsi_scrqs.active_queues;
31750fbd7b6dec Tyrel Datwyler 2021-01-14 1926 evt = ibmvfc_get_event(&vhost->scsi_scrqs.scrqs[scsi_channel]);
31750fbd7b6dec Tyrel Datwyler 2021-01-14 1927 evt->hwq = hwq % vhost->scsi_scrqs.active_queues;
31750fbd7b6dec Tyrel Datwyler 2021-01-14 1928 } else
e4b26f3db86498 Tyrel Datwyler 2021-01-06 1929 evt = ibmvfc_get_event(&vhost->crq);
31750fbd7b6dec Tyrel Datwyler 2021-01-14 1930
072b91f9c6510d Brian King 2008-07-01 1931 ibmvfc_init_event(evt, ibmvfc_scsi_done, IBMVFC_CMD_FORMAT);
072b91f9c6510d Brian King 2008-07-01 1932 evt->cmnd = cmnd;
fad74a1be2dbea Tyrel Datwyler 2020-11-17 1933
fad74a1be2dbea Tyrel Datwyler 2020-11-17 1934 vfc_cmd = ibmvfc_init_vfc_cmd(evt, cmnd->device);
5a9d16f71c264a Tyrel Datwyler 2020-11-17 1935 iu = ibmvfc_get_fcp_iu(vhost, vfc_cmd);
fad74a1be2dbea Tyrel Datwyler 2020-11-17 1936
5a9d16f71c264a Tyrel Datwyler 2020-11-17 1937 iu->xfer_len = cpu_to_be32(scsi_bufflen(cmnd));
5a9d16f71c264a Tyrel Datwyler 2020-11-17 1938 memcpy(iu->cdb, cmnd->cmnd, cmnd->cmd_len);
072b91f9c6510d Brian King 2008-07-01 1939
5066863337afdb Christoph Hellwig 2014-10-30 1940 if (cmnd->flags & SCMD_TAGGED) {
5066863337afdb Christoph Hellwig 2014-10-30 1941 vfc_cmd->task_tag = cpu_to_be64(cmnd->tag);
5a9d16f71c264a Tyrel Datwyler 2020-11-17 1942 iu->pri_task_attr = IBMVFC_SIMPLE_TASK;
072b91f9c6510d Brian King 2008-07-01 1943 }
072b91f9c6510d Brian King 2008-07-01 1944
901d01c8e50c35 Tyrel Datwyler 2021-01-06 1945 vfc_cmd->correlation = cpu_to_be64((u64)evt);
2aa0102c668830 Tyrel Datwyler 2020-11-17 1946
072b91f9c6510d Brian King 2008-07-01 1947 if (likely(!(rc = ibmvfc_map_sg_data(cmnd, evt, vfc_cmd, vhost->dev))))
072b91f9c6510d Brian King 2008-07-01 1948 return ibmvfc_send_event(evt, vhost, 0);
072b91f9c6510d Brian King 2008-07-01 1949
072b91f9c6510d Brian King 2008-07-01 1950 ibmvfc_free_event(evt);
072b91f9c6510d Brian King 2008-07-01 1951 if (rc == -ENOMEM)
072b91f9c6510d Brian King 2008-07-01 1952 return SCSI_MLQUEUE_HOST_BUSY;
072b91f9c6510d Brian King 2008-07-01 1953
072b91f9c6510d Brian King 2008-07-01 1954 if (vhost->log_level > IBMVFC_DEFAULT_LOG_LEVEL)
072b91f9c6510d Brian King 2008-07-01 1955 scmd_printk(KERN_ERR, cmnd,
072b91f9c6510d Brian King 2008-07-01 @1956 "Failed to map DMA buffer for command. rc=%d\n", rc);
072b91f9c6510d Brian King 2008-07-01 1957
fd78f07ace9e37 Bart Van Assche 2021-04-09 1958 cmnd->result.combined = DID_ERROR << 16;
654080d02edb60 Tyrel Datwyler 2021-01-06 1959 cmnd->scsi_done(cmnd);
072b91f9c6510d Brian King 2008-07-01 1960 return 0;
072b91f9c6510d Brian King 2008-07-01 1961 }
072b91f9c6510d Brian King 2008-07-01 1962
:::::: The code at line 1956 was first introduced by commit
:::::: 072b91f9c6510d0ec4a49d07dbc318760c7da7b3 [SCSI] ibmvfc: IBM Power Virtual Fibre Channel Adapter Client Driver
:::::: TO: Brian King <brking@linux.vnet.ibm.com>
:::::: CC: James Bottomley <James.Bottomley@HansenPartnership.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 72726 bytes --]
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-04-14 16:14 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-14 16:14 [bvanassche:scsi-for-next 41/41] drivers/scsi/ibmvscsi/ibmvfc.c:1956:51: warning: format '%d' expects argument of type 'int', but argument 4 has type 'union scsi_status' kernel test robot
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.