From: kernel test robot <lkp@intel.com>
To: Jens Axboe <axboe@kernel.dk>
Cc: oe-kbuild-all@lists.linux.dev
Subject: [axboe-block:rw_iter 205/415] drivers/misc/cxl/file.c:422:9: error: conflicting types for 'afu_read'; have 'ssize_t(struct kiocb *, struct iov_iter *)' {aka 'long int(struct kiocb *, struct iov_iter *)'}
Date: Thu, 11 Apr 2024 20:37:52 +0800 [thread overview]
Message-ID: <202404112036.511LQJSL-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git rw_iter
head: 2cdbd541e4481cb9cbd08913e0586dc8a2570aec
commit: 2ff4bdb9c46f5a8cb1b473cd9fa7ca74a1c675d4 [205/415] misc: cxl: convert to read/write iterators
config: powerpc64-randconfig-002-20240411 (https://download.01.org/0day-ci/archive/20240411/202404112036.511LQJSL-lkp@intel.com/config)
compiler: powerpc64-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240411/202404112036.511LQJSL-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202404112036.511LQJSL-lkp@intel.com/
All errors (new ones prefixed by >>):
>> drivers/misc/cxl/file.c:422:9: error: conflicting types for 'afu_read'; have 'ssize_t(struct kiocb *, struct iov_iter *)' {aka 'long int(struct kiocb *, struct iov_iter *)'}
422 | ssize_t afu_read(struct kiocb *iocb, struct iov_iter *to)
| ^~~~~~~~
In file included from drivers/misc/cxl/file.c:23:
drivers/misc/cxl/cxl.h:1048:9: note: previous declaration of 'afu_read' with type 'ssize_t(struct file *, char *, size_t, loff_t *)' {aka 'long int(struct file *, char *, long unsigned int, long long int *)'}
1048 | ssize_t afu_read(struct file *file, char __user *buf, size_t count, loff_t *off);
| ^~~~~~~~
drivers/misc/cxl/file.c: In function 'afu_read':
>> drivers/misc/cxl/file.c:508:51: error: 'buf' undeclared (first use in this function)
508 | return afu_driver_event_copy(ctx, buf, &event, pl);
| ^~~
drivers/misc/cxl/file.c:508:51: note: each undeclared identifier is reported only once for each function it appears in
vim +422 drivers/misc/cxl/file.c
421
> 422 ssize_t afu_read(struct kiocb *iocb, struct iov_iter *to)
423 {
424 struct cxl_context *ctx = iocb->ki_filp->private_data;
425 struct cxl_event_afu_driver_reserved *pl = NULL;
426 size_t count = iov_iter_count(to);
427 struct cxl_event event;
428 unsigned long flags;
429 int rc;
430 DEFINE_WAIT(wait);
431
432 if (!cxl_ops->link_ok(ctx->afu->adapter, ctx->afu))
433 return -EIO;
434
435 if (count < CXL_READ_MIN_SIZE)
436 return -EINVAL;
437
438 spin_lock_irqsave(&ctx->lock, flags);
439
440 for (;;) {
441 prepare_to_wait(&ctx->wq, &wait, TASK_INTERRUPTIBLE);
442 if (ctx_event_pending(ctx) || (ctx->status == CLOSED))
443 break;
444
445 if (!cxl_ops->link_ok(ctx->afu->adapter, ctx->afu)) {
446 rc = -EIO;
447 goto out;
448 }
449
450 if (iocb->ki_filp->f_flags & O_NONBLOCK) {
451 rc = -EAGAIN;
452 goto out;
453 }
454
455 if (signal_pending(current)) {
456 rc = -ERESTARTSYS;
457 goto out;
458 }
459
460 spin_unlock_irqrestore(&ctx->lock, flags);
461 pr_devel("afu_read going to sleep...\n");
462 schedule();
463 pr_devel("afu_read woken up\n");
464 spin_lock_irqsave(&ctx->lock, flags);
465 }
466
467 finish_wait(&ctx->wq, &wait);
468
469 memset(&event, 0, sizeof(event));
470 event.header.process_element = ctx->pe;
471 event.header.size = sizeof(struct cxl_event_header);
472 if (ctx->afu_driver_ops && atomic_read(&ctx->afu_driver_events)) {
473 pr_devel("afu_read delivering AFU driver specific event\n");
474 pl = ctx->afu_driver_ops->fetch_event(ctx);
475 atomic_dec(&ctx->afu_driver_events);
476 event.header.type = CXL_EVENT_AFU_DRIVER;
477 } else if (ctx->pending_irq) {
478 pr_devel("afu_read delivering AFU interrupt\n");
479 event.header.size += sizeof(struct cxl_event_afu_interrupt);
480 event.header.type = CXL_EVENT_AFU_INTERRUPT;
481 event.irq.irq = find_first_bit(ctx->irq_bitmap, ctx->irq_count) + 1;
482 clear_bit(event.irq.irq - 1, ctx->irq_bitmap);
483 if (bitmap_empty(ctx->irq_bitmap, ctx->irq_count))
484 ctx->pending_irq = false;
485 } else if (ctx->pending_fault) {
486 pr_devel("afu_read delivering data storage fault\n");
487 event.header.size += sizeof(struct cxl_event_data_storage);
488 event.header.type = CXL_EVENT_DATA_STORAGE;
489 event.fault.addr = ctx->fault_addr;
490 event.fault.dsisr = ctx->fault_dsisr;
491 ctx->pending_fault = false;
492 } else if (ctx->pending_afu_err) {
493 pr_devel("afu_read delivering afu error\n");
494 event.header.size += sizeof(struct cxl_event_afu_error);
495 event.header.type = CXL_EVENT_AFU_ERROR;
496 event.afu_error.error = ctx->afu_err;
497 ctx->pending_afu_err = false;
498 } else if (ctx->status == CLOSED) {
499 pr_devel("afu_read fatal error\n");
500 spin_unlock_irqrestore(&ctx->lock, flags);
501 return -EIO;
502 } else
503 WARN(1, "afu_read must be buggy\n");
504
505 spin_unlock_irqrestore(&ctx->lock, flags);
506
507 if (event.header.type == CXL_EVENT_AFU_DRIVER)
> 508 return afu_driver_event_copy(ctx, buf, &event, pl);
509
510 if (!copy_to_iter_full(&event, event.header.size, to))
511 return -EFAULT;
512 return event.header.size;
513
514 out:
515 finish_wait(&ctx->wq, &wait);
516 spin_unlock_irqrestore(&ctx->lock, flags);
517 return rc;
518 }
519
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2024-04-11 12:38 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202404112036.511LQJSL-lkp@intel.com \
--to=lkp@intel.com \
--cc=axboe@kernel.dk \
--cc=oe-kbuild-all@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.