* [android-common:android-mainline 2/2] drivers/md/dm-user.c:525:6: warning: no previous prototype for function 'message_kill'
@ 2020-12-11 2:07 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2020-12-11 2:07 UTC (permalink / raw)
To: kbuild-all
[-- Attachment #1: Type: text/plain, Size: 7629 bytes --]
tree: https://android.googlesource.com/kernel/common android-mainline
head: 83bf345abc0bc06b98e906bfbb120a52446e1c43
commit: 83bf345abc0bc06b98e906bfbb120a52446e1c43 [2/2] ANDROID: dm: dm-user: New target that proxies BIOs to userspace
config: arm-randconfig-r025-20201209 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 5ff35356f1af2bb92785b38c657463924d9ec386)
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 arm cross compiling tool for clang build
# apt-get install binutils-arm-linux-gnueabi
git remote add android-common https://android.googlesource.com/kernel/common
git fetch --no-tags android-common android-mainline
git checkout 83bf345abc0bc06b98e906bfbb120a52446e1c43
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm
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/md/dm-user.c:525:6: warning: no previous prototype for function 'message_kill' [-Wmissing-prototypes]
void message_kill(struct message *m, mempool_t *pool)
^
drivers/md/dm-user.c:525:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
void message_kill(struct message *m, mempool_t *pool)
^
static
>> drivers/md/dm-user.c:539:5: warning: no previous prototype for function 'target_poll' [-Wmissing-prototypes]
int target_poll(struct target *t)
^
drivers/md/dm-user.c:539:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int target_poll(struct target *t)
^
static
>> drivers/md/dm-user.c:544:6: warning: no previous prototype for function 'target_release' [-Wmissing-prototypes]
void target_release(struct kref *ref)
^
drivers/md/dm-user.c:544:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
void target_release(struct kref *ref)
^
static
>> drivers/md/dm-user.c:565:6: warning: no previous prototype for function 'target_put' [-Wmissing-prototypes]
void target_put(struct target *t)
^
drivers/md/dm-user.c:565:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
void target_put(struct target *t)
^
static
>> drivers/md/dm-user.c:578:17: warning: no previous prototype for function 'channel_alloc' [-Wmissing-prototypes]
struct channel *channel_alloc(struct target *t)
^
drivers/md/dm-user.c:578:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
struct channel *channel_alloc(struct target *t)
^
static
>> drivers/md/dm-user.c:596:6: warning: no previous prototype for function 'channel_free' [-Wmissing-prototypes]
void channel_free(struct channel *c)
^
drivers/md/dm-user.c:596:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
void channel_free(struct channel *c)
^
static
drivers/md/dm-user.c:181:30: warning: unused function 'target_from_miscdev' [-Wunused-function]
static inline struct target *target_from_miscdev(struct miscdevice *miscdev)
^
7 warnings generated.
vim +/message_kill +525 drivers/md/dm-user.c
524
> 525 void message_kill(struct message *m, mempool_t *pool)
526 {
527 m->bio->bi_status = BLK_STS_IOERR;
528 bio_endio(m->bio);
529 bio_put(m->bio);
530 mempool_free(m, pool);
531 }
532
533 /*
534 * Returns 0 when there is no work left to do. This must be callable without
535 * holding the target lock, as it is part of the waitqueue's check expression.
536 * When called without the lock it may spuriously indicate there is remaining
537 * work, but when called with the lock it must be accurate.
538 */
> 539 int target_poll(struct target *t)
540 {
541 return !list_empty(&t->to_user) || t->dm_destroyed;
542 }
543
> 544 void target_release(struct kref *ref)
545 {
546 struct target *t = container_of(ref, struct target, references);
547 struct list_head *cur;
548
549 /*
550 * There may be outstanding BIOs that have not yet been given to
551 * userspace. At this point there's nothing we can do about them, as
552 * there are and will never be any channels.
553 */
554 list_for_each (cur, &t->to_user) {
555 message_kill(list_entry(cur, struct message, to_user),
556 &t->message_pool);
557 }
558
559 mempool_exit(&t->message_pool);
560 mutex_unlock(&t->lock);
561 mutex_destroy(&t->lock);
562 kfree(t);
563 }
564
> 565 void target_put(struct target *t)
566 {
567 /*
568 * This both releases a reference to the target and the lock. We leave
569 * it up to the caller to hold the lock, as they probably needed it for
570 * something else.
571 */
572 lockdep_assert_held(&t->lock);
573
574 if (!kref_put(&t->references, target_release))
575 mutex_unlock(&t->lock);
576 }
577
> 578 struct channel *channel_alloc(struct target *t)
579 {
580 struct channel *c;
581
582 lockdep_assert_held(&t->lock);
583
584 c = kzalloc(sizeof(*c), GFP_KERNEL);
585 if (c == NULL)
586 return NULL;
587
588 kref_get(&t->references);
589 c->target = t;
590 c->cur_from_user = &c->scratch_message_from_user;
591 mutex_init(&c->lock);
592 INIT_LIST_HEAD(&c->from_user);
593 return c;
594 }
595
> 596 void channel_free(struct channel *c)
597 {
598 struct list_head *cur;
599
600 lockdep_assert_held(&c->lock);
601
602 /*
603 * There may be outstanding BIOs that have been given to userspace but
604 * have not yet been completed. The channel has been shut down so
605 * there's no way to process the rest of those messages, so we just go
606 * ahead and error out the BIOs. Hopefully whatever's on the other end
607 * can handle the errors. One could imagine splitting the BIOs and
608 * completing as much as we got, but that seems like overkill here.
609 *
610 * Our only other options would be to let the BIO hang around (which
611 * seems way worse) or to resubmit it to userspace in the hope there's
612 * another channel. I don't really like the idea of submitting a
613 * message twice.
614 */
615 if (c->cur_to_user != NULL)
616 message_kill(c->cur_to_user, &c->target->message_pool);
617 if (c->cur_from_user != &c->scratch_message_from_user)
618 message_kill(c->cur_from_user, &c->target->message_pool);
619 list_for_each (cur, &c->from_user)
620 message_kill(list_entry(cur, struct message, to_user),
621 &c->target->message_pool);
622
623 mutex_lock(&c->target->lock);
624 target_put(c->target);
625 mutex_unlock(&c->lock);
626 mutex_destroy(&c->lock);
627 kfree(c);
628 }
629
---
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: 33636 bytes --]
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2020-12-11 2:07 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-11 2:07 [android-common:android-mainline 2/2] drivers/md/dm-user.c:525:6: warning: no previous prototype for function 'message_kill' 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.