Re: [PATCH] mm/damon: remove dead code in damon_lru_sort_enabled_store()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Zeng,

On Fri, 12 Aug 2022 09:24:59 +0800 Zeng Jingxiang <zengjx95@xxxxxxxxx> wrote:

> From: Zeng Jingxiang <linuszeng@xxxxxxxxxxx>
> 
> 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@xxxxxxxxxx/T/#t


Thanks,
SJ

[...]




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux