tree:
https://git.kernel.org/pub/scm/linux/kernel/git/hare/scsi-devel.git virtio-vfc.v6
head: 7e3ab9aac391a4fb2aef468332128900bdef8df6
commit: 65a1d16588d3c3cb7b09f0f162c571be3533afc4 [3/5] virtio-scsi: Add FC transport
class
config: riscv-randconfig-r036-20210314 (attached as .config)
compiler: clang version 13.0.0 (
https://github.com/llvm/llvm-project
7ee96429a0b057bcc97331a6a762fc3cd00aed61)
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 riscv cross compiling tool for clang build
# apt-get install binutils-riscv64-linux-gnu
#
https://git.kernel.org/pub/scm/linux/kernel/git/hare/scsi-devel.git/commi...
git remote add hare-scsi-devel
https://git.kernel.org/pub/scm/linux/kernel/git/hare/scsi-devel.git
git fetch --no-tags hare-scsi-devel virtio-vfc.v6
git checkout 65a1d16588d3c3cb7b09f0f162c571be3533afc4
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=riscv
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All error/warnings (new ones prefixed by >>):
> drivers/scsi/virtio_scsi.c:178:3: error: use of undeclared
identifier 'tgt'
tgt = rport->dd_data;
^
> drivers/scsi/virtio_scsi.c:840:22: error: expected ')'
struct Scsi_Host *sh;
^
drivers/scsi/virtio_scsi.c:839:33: note: to match this '('
static int virtscsi_target_alloc(
^
> drivers/scsi/virtio_scsi.c:848:2: warning: declaration specifier
missing, defaulting to 'int'
rport = starget_to_rport(starget);
^
int
> drivers/scsi/virtio_scsi.c:848:2: error: redefinition of
'rport' with a different type: 'int' vs 'struct fc_rport *'
drivers/scsi/virtio_scsi.c:843:19: note: previous definition is here
struct fc_rport *rport;
^
> drivers/scsi/virtio_scsi.c:848:10: error: statement expression
not allowed at file scope
rport = starget_to_rport(starget);
^
include/scsi/scsi_transport_fc.h:428:36: note: expanded from macro
'starget_to_rport'
scsi_is_fc_rport(s->dev.parent) ? dev_to_rport(s->dev.parent) : NULL
^
include/scsi/scsi_transport_fc.h:395:2: note: expanded from macro
'dev_to_rport'
container_of(d, struct fc_rport, dev)
^
include/linux/kernel.h:692:41: note: expanded from macro 'container_of'
#define container_of(ptr, type, member) ({ \
^
> drivers/scsi/virtio_scsi.c:848:27: error: use of undeclared
identifier 'starget'
rport = starget_to_rport(starget);
^
> drivers/scsi/virtio_scsi.c:849:2: error: expected identifier or
'('
if (rport) {
^
drivers/scsi/virtio_scsi.c:853:4: error: expected identifier or '('
} else {
^
drivers/scsi/virtio_scsi.c:874:2: error: expected identifier or '('
seqcount_init(&tgt->tgt_seq);
^
include/linux/seqlock.h:92:2: note: expanded from macro 'seqcount_init'
do { \
^
drivers/scsi/virtio_scsi.c:874:2: error: expected identifier or '('
include/linux/seqlock.h:95:4: note: expanded from macro 'seqcount_init'
} while (0)
^
> drivers/scsi/virtio_scsi.c:875:13: error: expected parameter
declarator
atomic_set(&tgt->reqs, 0);
^
drivers/scsi/virtio_scsi.c:875:13: error: expected ')'
drivers/scsi/virtio_scsi.c:875:12: note: to match this '('
atomic_set(&tgt->reqs, 0);
^
drivers/scsi/virtio_scsi.c:875:2: warning: declaration specifier missing, defaulting to
'int'
atomic_set(&tgt->reqs, 0);
^
int
> drivers/scsi/virtio_scsi.c:875:12: error: this function
declaration is not a prototype [-Werror,-Wstrict-prototypes]
atomic_set(&tgt->reqs, 0);
^
void
> drivers/scsi/virtio_scsi.c:875:2: error: conflicting types for
'atomic_set'
atomic_set(&tgt->reqs, 0);
^
arch/riscv/include/asm/atomic.h:32:29: note: previous definition is here
static __always_inline void atomic_set(atomic_t *v, int i)
^
> drivers/scsi/virtio_scsi.c:876:2: error: unknown type name
'tgt'
tgt->req_vq = &vscsi->req_vqs[0];
^
drivers/scsi/virtio_scsi.c:876:5: error: expected identifier or '('
tgt->req_vq = &vscsi->req_vqs[0];
^
drivers/scsi/virtio_scsi.c:877:2: error: unknown type name 'tgt'
tgt->vscsi = vscsi;
^
drivers/scsi/virtio_scsi.c:877:5: error: expected identifier or '('
tgt->vscsi = vscsi;
^
drivers/scsi/virtio_scsi.c:878:2: error: expected identifier or '('
return 0;
^
> drivers/scsi/virtio_scsi.c:879:1: error: extraneous closing brace
('}')
}
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
2 warnings and 20 errors generated.
vim +/tgt +178 drivers/scsi/virtio_scsi.c
156
157 /*
158 * virtscsi_complete_cmd - finish a scsi_cmd and invoke scsi_done
159 *
160 * Called with vq_lock held.
161 */
162 static void virtscsi_complete_cmd(struct virtio_scsi *vscsi, void *buf)
163 {
164 struct virtio_scsi_cmd *cmd = buf;
165 #if IS_ENABLED(CONFIG_SCSI_FC_ATTRS)
166 struct fc_rport *rport;
167 #endif
168 struct scsi_cmnd *sc = cmd->sc;
169 struct virtio_scsi_cmd_resp *resp = &cmd->resp.cmd;
170
171 dev_dbg(&sc->device->sdev_gendev,
172 "cmd %p response %u status %#02x sense_len %u\n",
173 sc, resp->response, resp->status, resp->sense_len);
174
175 #if IS_ENABLED(CONFIG_SCSI_FC_ATTRS)
176 rport = starget_to_rport(scsi_target(sc->device));
177 if (rport)
178 tgt = rport->dd_data;
179 #endif
180 sc->result = resp->status;
181 virtscsi_compute_resid(sc, virtio32_to_cpu(vscsi->vdev, resp->resid));
182 switch (resp->response) {
183 case VIRTIO_SCSI_S_OK:
184 set_host_byte(sc, DID_OK);
185 break;
186 case VIRTIO_SCSI_S_OVERRUN:
187 set_host_byte(sc, DID_ERROR);
188 break;
189 case VIRTIO_SCSI_S_ABORTED:
190 set_host_byte(sc, DID_ABORT);
191 break;
192 case VIRTIO_SCSI_S_BAD_TARGET:
193 set_host_byte(sc, DID_BAD_TARGET);
194 break;
195 case VIRTIO_SCSI_S_RESET:
196 set_host_byte(sc, DID_RESET);
197 break;
198 case VIRTIO_SCSI_S_BUSY:
199 set_host_byte(sc, DID_BUS_BUSY);
200 break;
201 case VIRTIO_SCSI_S_TRANSPORT_FAILURE:
202 set_host_byte(sc, DID_TRANSPORT_DISRUPTED);
203 break;
204 case VIRTIO_SCSI_S_TARGET_FAILURE:
205 set_host_byte(sc, DID_TARGET_FAILURE);
206 break;
207 case VIRTIO_SCSI_S_NEXUS_FAILURE:
208 set_host_byte(sc, DID_NEXUS_FAILURE);
209 break;
210 default:
211 scmd_printk(KERN_WARNING, sc, "Unknown response %d",
212 resp->response);
213 fallthrough;
214 case VIRTIO_SCSI_S_FAILURE:
215 set_host_byte(sc, DID_ERROR);
216 break;
217 }
218
219 WARN_ON(virtio32_to_cpu(vscsi->vdev, resp->sense_len) >
220 VIRTIO_SCSI_SENSE_SIZE);
221 if (sc->sense_buffer) {
222 memcpy(sc->sense_buffer, resp->sense,
223 min_t(u32,
224 virtio32_to_cpu(vscsi->vdev, resp->sense_len),
225 VIRTIO_SCSI_SENSE_SIZE));
226 if (resp->sense_len)
227 set_driver_byte(sc, DRIVER_SENSE);
228 }
229
230 sc->scsi_done(sc);
231 }
232
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org