[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <7a72b0b5-f534-f7aa-85c0-f1b97646f81c@huaweicloud.com>
Date: Thu, 1 Dec 2022 09:36:06 +0800
From: Kemeng Shi <shikemeng@...weicloud.com>
To: Tejun Heo <tj@...nel.org>, Kemeng Shi <shikemeng@...wei.com>
Cc: josef@...icpanda.com, axboe@...nel.dk, cgroups@...r.kernel.org,
linux-block@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 10/10] blk-throttle: avoid dead code in
throtl_hierarchy_can_upgrade
Hi, Tejun
on 12/1/2022 5:36 AM, Tejun Heo wrote:
> On Tue, Nov 29, 2022 at 11:01:47AM +0800, Kemeng Shi wrote:
>> Function throtl_hierarchy_can_upgrade will always return from while loop,
>> so the return outside while loop is never reached. Break the loop when
>> we traverse to root as throtl_hierarchy_can_downgrade do to avoid dead
>> code.
>
> I don't know why this is an improvement.
>
I just found that the "return false" outside of the while loop is never
executed which may be not reached by code coverage test. Of course,
we can simply remove this "return false", but I found a similar function
throtl_hierarchy_can_upgrade which has no such problem. So I avoid
unreachable code as throtl_hierarchy_can_upgrade do.
Is this make sense to you? If not, I will remove this patch in next
version.
Thanks.
--
Best wishes
Kemeng Shi
Powered by blists - more mailing lists