[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220908151042.239189ddb1635c0f598c6fd2@linux-foundation.org>
Date: Thu, 8 Sep 2022 15:10:42 -0700
From: Andrew Morton <akpm@...ux-foundation.org>
To: SeongJae Park <sj@...nel.org>
Cc: Xin Hao <xhao@...ux.alibaba.com>, damon@...ts.linux.dev,
linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mm/damon/sysfs: change few functions execute order
On Thu, 8 Sep 2022 18:49:47 +0000 SeongJae Park <sj@...nel.org> wrote:
> Hi Xin,
>
> On Thu, 8 Sep 2022 16:19:32 +0800 Xin Hao <xhao@...ux.alibaba.com> wrote:
>
> > These nr_{schemes,regions,contexts,kdamonds}_store() functions are both call
>
> checkpatch complains as below:
>
> WARNING: Possible unwrapped commit description (prefer a maximum 75 chars per line)
> #10:
> These nr_{schemes,regions,contexts,kdamonds}_store() functions are both call
I fix that sort of thing. A lot ;)
> > kstrtoint() to get relative values from sysfs interface, if it return an
> > error, there get kobject instance would be meaningless through 'container_of'.
>
> I was thinking the compiler could do that kind of optimization on its own, so I
> preferred to make the code shorter.
Yes, the compiler will do this.
> This change makes the code slightly longer, while the benefit of the change is
> unclear. I'd like to keep it as is unless we get some clear benefit of this?
I find it a readability improvement. Puts the initialization in a more
appropriate place and avoids those nasty tricks to prevent unreasonable
line lengths.
Powered by blists - more mailing lists