All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: [android-common:android-4.19-stable 3/3] drivers/md/dm-user.c:525:6: warning: no previous prototype for function 'message_kill'
Date: Tue, 12 Jan 2021 16:31:04 +0800	[thread overview]
Message-ID: <202101121600.UPgnMHJT-lkp@intel.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 12135 bytes --]

tree:   https://android.googlesource.com/kernel/common android-4.19-stable
head:   1817b1966de75435813c2a50b1f128929b1df515
commit: 1817b1966de75435813c2a50b1f128929b1df515 [3/3] ANDROID: uapi: Add dm-user structure definition
config: arm-randconfig-r033-20210111 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 32bcfcda4e28375e5a85268d2acfabcfcc011abf)
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-4.19-stable
        git checkout 1817b1966de75435813c2a50b1f128929b1df515
        # 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 
   6 warnings generated.


vim +/message_kill +525 drivers/md/dm-user.c

1caf05ce9038bd19 Palmer Dabbelt 2020-09-29  524  
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29 @525  void message_kill(struct message *m, mempool_t *pool)
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29  526  {
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29  527  	m->bio->bi_status = BLK_STS_IOERR;
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29  528  	bio_endio(m->bio);
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29  529  	bio_put(m->bio);
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29  530  	mempool_free(m, pool);
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29  531  }
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29  532  
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29  533  /*
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29  534   * Returns 0 when there is no work left to do.  This must be callable without
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29  535   * holding the target lock, as it is part of the waitqueue's check expression.
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29  536   * When called without the lock it may spuriously indicate there is remaining
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29  537   * work, but when called with the lock it must be accurate.
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29  538   */
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29 @539  int target_poll(struct target *t)
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29  540  {
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29  541  	return !list_empty(&t->to_user) || t->dm_destroyed;
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29  542  }
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29  543  
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29 @544  void target_release(struct kref *ref)
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29  545  {
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29  546  	struct target *t = container_of(ref, struct target, references);
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29  547  	struct list_head *cur;
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29  548  
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29  549  	/*
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29  550  	 * There may be outstanding BIOs that have not yet been given to
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29  551  	 * userspace.  At this point there's nothing we can do about them, as
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29  552  	 * there are and will never be any channels.
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29  553  	 */
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29  554  	list_for_each (cur, &t->to_user) {
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29  555  		message_kill(list_entry(cur, struct message, to_user),
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29  556  			     &t->message_pool);
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29  557  	}
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29  558  
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29  559  	mempool_exit(&t->message_pool);
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29  560  	mutex_unlock(&t->lock);
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29  561  	mutex_destroy(&t->lock);
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29  562  	kfree(t);
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29  563  }
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29  564  
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29 @565  void target_put(struct target *t)
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29  566  {
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29  567  	/*
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29  568  	 * This both releases a reference to the target and the lock.  We leave
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29  569  	 * it up to the caller to hold the lock, as they probably needed it for
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29  570  	 * something else.
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29  571  	 */
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29  572  	lockdep_assert_held(&t->lock);
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29  573  
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29  574  	if (!kref_put(&t->references, target_release))
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29  575  		mutex_unlock(&t->lock);
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29  576  }
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29  577  
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29 @578  struct channel *channel_alloc(struct target *t)
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29  579  {
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29  580  	struct channel *c;
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29  581  
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29  582  	lockdep_assert_held(&t->lock);
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29  583  
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29  584  	c = kzalloc(sizeof(*c), GFP_KERNEL);
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29  585  	if (c == NULL)
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29  586  		return NULL;
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29  587  
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29  588  	kref_get(&t->references);
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29  589  	c->target = t;
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29  590  	c->cur_from_user = &c->scratch_message_from_user;
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29  591  	mutex_init(&c->lock);
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29  592  	INIT_LIST_HEAD(&c->from_user);
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29  593  	return c;
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29  594  }
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29  595  
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29 @596  void channel_free(struct channel *c)
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29  597  {
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29  598  	struct list_head *cur;
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29  599  
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29  600  	lockdep_assert_held(&c->lock);
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29  601  
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29  602  	/*
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29  603  	 * There may be outstanding BIOs that have been given to userspace but
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29  604  	 * have not yet been completed.  The channel has been shut down so
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29  605  	 * there's no way to process the rest of those messages, so we just go
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29  606  	 * ahead and error out the BIOs.  Hopefully whatever's on the other end
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29  607  	 * can handle the errors.  One could imagine splitting the BIOs and
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29  608  	 * completing as much as we got, but that seems like overkill here.
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29  609  	 *
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29  610  	 * Our only other options would be to let the BIO hang around (which
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29  611  	 * seems way worse) or to resubmit it to userspace in the hope there's
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29  612  	 * another channel.  I don't really like the idea of submitting a
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29  613  	 * message twice.
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29  614  	 */
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29  615  	if (c->cur_to_user != NULL)
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29  616  		message_kill(c->cur_to_user, &c->target->message_pool);
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29  617  	if (c->cur_from_user != &c->scratch_message_from_user)
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29  618  		message_kill(c->cur_from_user, &c->target->message_pool);
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29  619  	list_for_each (cur, &c->from_user)
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29  620  		message_kill(list_entry(cur, struct message, to_user),
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29  621  			     &c->target->message_pool);
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29  622  
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29  623  	mutex_lock(&c->target->lock);
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29  624  	target_put(c->target);
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29  625  	mutex_unlock(&c->lock);
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29  626  	mutex_destroy(&c->lock);
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29  627  	kfree(c);
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29  628  }
1caf05ce9038bd19 Palmer Dabbelt 2020-09-29  629  

:::::: The code at line 525 was first introduced by commit
:::::: 1caf05ce9038bd19f956b98061854fbf149c1c50 ANDROID: dm: dm-user: New target that proxies BIOs to userspace

:::::: TO: Palmer Dabbelt <palmerdabbelt@google.com>
:::::: CC: Alistair Delva <adelva@google.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: 25328 bytes --]

                 reply	other threads:[~2021-01-12  8:31 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=202101121600.UPgnMHJT-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild-all@lists.01.org \
    /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.