From: Kuan-Wei Chiu <visitorckw@gmail.com>
To: kernel test robot <lkp@intel.com>
Cc: oe-kbuild-all@lists.linux.dev,
Andrew Morton <akpm@linux-foundation.org>,
Linux Memory Management List <linux-mm@kvack.org>,
Ian Rogers <irogers@google.com>
Subject: Re: [akpm-mm:mm-nonmm-unstable 38/65] fs/bcachefs/clock.c:150:18-21: Unneeded variable: "ret". Return "NULL" on line 164
Date: Mon, 3 Jun 2024 01:43:40 +0800 [thread overview]
Message-ID: <ZlyvTI8Lf50Q634D@visitorckw-System-Product-Name> (raw)
In-Reply-To: <202406030001.jwsq6DZp-lkp@intel.com>
On Mon, Jun 03, 2024 at 12:46:08AM +0800, kernel test robot wrote:
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-nonmm-unstable
> head: 54524b845fbe070c5401141bc4ff2ec3f01f1e72
> commit: cf66e6c3b24c5aaf365c54bb7dc8b9cb01f47f4d [38/65] bcachefs: remove heap-related macros and switch to generic min_heap
> config: x86_64-randconfig-102-20240602 (https://download.01.org/0day-ci/archive/20240603/202406030001.jwsq6DZp-lkp@intel.com/config)
> compiler: clang version 18.1.5 (https://github.com/llvm/llvm-project 617a15a9eac96088ae5e9134248d8236e34b91b1)
>
> 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/202406030001.jwsq6DZp-lkp@intel.com/
>
> cocci warnings: (new ones prefixed by >>)
> >> fs/bcachefs/clock.c:150:18-21: Unneeded variable: "ret". Return "NULL" on line 164
>
Hi Andrew,
This error occurred because I forgot to store the minimum value into
'ret' before calling min_heap_pop(). Should I submit a new version of
the patch series or send a separate patch to fix this error?
Regards,
Kuan-Wei
> vim +150 fs/bcachefs/clock.c
>
> 1c6fdbd8f2465dd Kent Overstreet 2017-03-16 146
> 1c6fdbd8f2465dd Kent Overstreet 2017-03-16 147 static struct io_timer *get_expired_timer(struct io_clock *clock,
> 1c6fdbd8f2465dd Kent Overstreet 2017-03-16 148 unsigned long now)
> 1c6fdbd8f2465dd Kent Overstreet 2017-03-16 149 {
> 1c6fdbd8f2465dd Kent Overstreet 2017-03-16 @150 struct io_timer *ret = NULL;
> cf66e6c3b24c5aa Kuan-Wei Chiu 2024-05-24 151 const struct min_heap_callbacks callbacks = {
> cf66e6c3b24c5aa Kuan-Wei Chiu 2024-05-24 152 .less = io_timer_cmp,
> cf66e6c3b24c5aa Kuan-Wei Chiu 2024-05-24 153 .swp = io_timer_swp,
> cf66e6c3b24c5aa Kuan-Wei Chiu 2024-05-24 154 };
> 1c6fdbd8f2465dd Kent Overstreet 2017-03-16 155
> 1c6fdbd8f2465dd Kent Overstreet 2017-03-16 156 spin_lock(&clock->timer_lock);
> 1c6fdbd8f2465dd Kent Overstreet 2017-03-16 157
> cf66e6c3b24c5aa Kuan-Wei Chiu 2024-05-24 158 if (clock->timers.nr &&
> 1c6fdbd8f2465dd Kent Overstreet 2017-03-16 159 time_after_eq(now, clock->timers.data[0]->expire))
> cf66e6c3b24c5aa Kuan-Wei Chiu 2024-05-24 160 min_heap_pop(&clock->timers, &callbacks, NULL);
> 1c6fdbd8f2465dd Kent Overstreet 2017-03-16 161
> 1c6fdbd8f2465dd Kent Overstreet 2017-03-16 162 spin_unlock(&clock->timer_lock);
> 1c6fdbd8f2465dd Kent Overstreet 2017-03-16 163
> 1c6fdbd8f2465dd Kent Overstreet 2017-03-16 @164 return ret;
> 1c6fdbd8f2465dd Kent Overstreet 2017-03-16 165 }
> 1c6fdbd8f2465dd Kent Overstreet 2017-03-16 166
>
> :::::: The code at line 150 was first introduced by commit
> :::::: 1c6fdbd8f2465ddfb73a01ec620cbf3d14044e1a bcachefs: Initial commit
>
> :::::: TO: Kent Overstreet <kent.overstreet@gmail.com>
> :::::: CC: Kent Overstreet <kent.overstreet@linux.dev>
>
> --
> 0-DAY CI Kernel Test Service
> https://github.com/intel/lkp-tests/wiki
prev parent reply other threads:[~2024-06-02 17:43 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-02 16:46 kernel test robot
2024-06-02 17:43 ` Kuan-Wei Chiu [this message]
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=ZlyvTI8Lf50Q634D@visitorckw-System-Product-Name \
--to=visitorckw@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=irogers@google.com \
--cc=linux-mm@kvack.org \
--cc=lkp@intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox