All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: cros-kernel-buildreports@googlegroups.com
Cc: oe-kbuild-all@lists.linux.dev
Subject: [android-common:android13-5.10 2/2] drivers/md/dm-user.c:539:5: warning: no previous prototype for function 'target_poll'
Date: Wed, 27 Aug 2025 07:00:34 +0200	[thread overview]
Message-ID: <202508270714.FU7A4hF8-lkp@intel.com> (raw)

tree:   https://android.googlesource.com/kernel/common android13-5.10
head:   456275f3e7f8f3b2be487c9f5b18c811bee029fc
commit: 83bf345abc0bc06b98e906bfbb120a52446e1c43 [2/2] ANDROID: dm: dm-user: New target that proxies BIOs to userspace
config: x86_64-rhel-9.4-rust (https://download.01.org/0day-ci/archive/20250827/202508270714.FU7A4hF8-lkp@intel.com/config)
compiler: clang version 22.0.0git (https://github.com/llvm/llvm-project d26ea02060b1c9db751d188b2edb0059a9eb273d)
rustc: rustc 1.58.0 (02072b482 2022-01-11)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250827/202508270714.FU7A4hF8-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/202508270714.FU7A4hF8-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]
     525 | 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
     525 | 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]
     539 | 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
     539 | int target_poll(struct target *t)
         | ^
         | static 
>> drivers/md/dm-user.c:544:6: warning: no previous prototype for function 'target_release' [-Wmissing-prototypes]
     544 | 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
     544 | void target_release(struct kref *ref)
         | ^
         | static 
>> drivers/md/dm-user.c:565:6: warning: no previous prototype for function 'target_put' [-Wmissing-prototypes]
     565 | 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
     565 | void target_put(struct target *t)
         | ^
         | static 
   drivers/md/dm-user.c:578:17: warning: no previous prototype for function 'channel_alloc' [-Wmissing-prototypes]
     578 | 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
     578 | 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]
     596 | 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
     596 | void channel_free(struct channel *c)
         | ^
         | static 
   drivers/md/dm-user.c:181:30: warning: unused function 'target_from_miscdev' [-Wunused-function]
     181 | static inline struct target *target_from_miscdev(struct miscdevice *miscdev)
         |                              ^~~~~~~~~~~~~~~~~~~
   7 warnings generated.


vim +/target_poll +539 drivers/md/dm-user.c

   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
https://github.com/intel/lkp-tests/wiki

                 reply	other threads:[~2025-08-27  5:01 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=202508270714.FU7A4hF8-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=cros-kernel-buildreports@googlegroups.com \
    --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.