Messages in this thread | | | From | SeongJae Park <> | Subject | Re: [PATCH] mm/damon: remove dead code in damon_lru_sort_enabled_store() | Date | Fri, 12 Aug 2022 01:50:18 +0000 |
| |
Hi Zeng,
On Fri, 12 Aug 2022 09:24:59 +0800 Zeng Jingxiang <zengjx95@gmail.com> wrote:
> From: Zeng Jingxiang <linuszeng@tencent.com> > > The variable damon_lru_sort_initialized is always true, causing the > corresponding conditional expression cannot be executed. > > Assigning true to damon_lru_sort_initialized here > 544 damon_lru_sort_initialized = true;
Before the assignment, the variable is set 'false'.
> > The value of damon_lru_sort_initialized is always true. > As a result, the following expression cannot be executed. > > 463 if (!damon_lru_sort_initialized) > 464 return rc;
If this code is executed before the assignment, the expression can be executed.
Actually, there was a bug due to the absence of the variable. You may refer to that for the detail: https://lore.kernel.org/damon/20220604192222.1488-1-sj@kernel.org/T/#t
Thanks, SJ
[...]
| |