linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org,
	Miguel Ojeda <ojeda@kernel.org>,
	Nick Desaulniers <ndesaulniers@google.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Linux Memory Management List <linux-mm@kvack.org>
Subject: mm/damon/core.c:469 __damon_stop() warn: if();
Date: Mon, 21 Mar 2022 23:05:23 +0800	[thread overview]
Message-ID: <202203212359.HWkV7SP9-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   f443e374ae131c168a065ea1748feac6b2e76613
commit: e1edc277e6f6dfb372216522dfc57f9381c39e35 linux/container_of.h: switch to static_assert
date:   4 months ago
config: nds32-randconfig-m031-20220320 (https://download.01.org/0day-ci/archive/20220321/202203212359.HWkV7SP9-lkp@intel.com/config)
compiler: nds32le-linux-gcc (GCC) 11.2.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

smatch warnings:
mm/damon/core.c:469 __damon_stop() warn: if();

vim +469 mm/damon/core.c

2224d8485492e49 SeongJae Park 2021-09-07  456  
2224d8485492e49 SeongJae Park 2021-09-07  457  /*
2224d8485492e49 SeongJae Park 2021-09-07  458   * __damon_stop() - Stops monitoring of given context.
2224d8485492e49 SeongJae Park 2021-09-07  459   * @ctx:	monitoring context
2224d8485492e49 SeongJae Park 2021-09-07  460   *
2224d8485492e49 SeongJae Park 2021-09-07  461   * Return: 0 on success, negative error code otherwise.
2224d8485492e49 SeongJae Park 2021-09-07  462   */
2224d8485492e49 SeongJae Park 2021-09-07  463  static int __damon_stop(struct damon_ctx *ctx)
2224d8485492e49 SeongJae Park 2021-09-07  464  {
0f91d13366a4024 Changbin Du   2021-11-05  465  	struct task_struct *tsk;
0f91d13366a4024 Changbin Du   2021-11-05  466  
2224d8485492e49 SeongJae Park 2021-09-07  467  	mutex_lock(&ctx->kdamond_lock);
0f91d13366a4024 Changbin Du   2021-11-05  468  	tsk = ctx->kdamond;
0f91d13366a4024 Changbin Du   2021-11-05 @469  	if (tsk) {
0f91d13366a4024 Changbin Du   2021-11-05  470  		get_task_struct(tsk);
2224d8485492e49 SeongJae Park 2021-09-07  471  		mutex_unlock(&ctx->kdamond_lock);
0f91d13366a4024 Changbin Du   2021-11-05  472  		kthread_stop(tsk);
0f91d13366a4024 Changbin Du   2021-11-05  473  		put_task_struct(tsk);
2224d8485492e49 SeongJae Park 2021-09-07  474  		return 0;
2224d8485492e49 SeongJae Park 2021-09-07  475  	}
2224d8485492e49 SeongJae Park 2021-09-07  476  	mutex_unlock(&ctx->kdamond_lock);
2224d8485492e49 SeongJae Park 2021-09-07  477  
2224d8485492e49 SeongJae Park 2021-09-07  478  	return -EPERM;
2224d8485492e49 SeongJae Park 2021-09-07  479  }
2224d8485492e49 SeongJae Park 2021-09-07  480  

:::::: The code at line 469 was first introduced by commit
:::::: 0f91d13366a402420bf98eaaf393db03946c13e0 mm/damon: simplify stop mechanism

:::::: TO: Changbin Du <changbin.du@gmail.com>
:::::: CC: Linus Torvalds <torvalds@linux-foundation.org>

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp


                 reply	other threads:[~2022-03-21 15:10 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=202203212359.HWkV7SP9-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux@rasmusvillemoes.dk \
    --cc=ndesaulniers@google.com \
    --cc=ojeda@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox