Re: [PATCH] mm/damon/sysfs: change few functions execute order
From: Andrew Morton
Date: Thu Sep 08 2022 - 18:10:51 EST
On Thu, 8 Sep 2022 18:49:47 +0000 SeongJae Park <sj@xxxxxxxxxx> wrote:
> Hi Xin,
>
> On Thu, 8 Sep 2022 16:19:32 +0800 Xin Hao <xhao@xxxxxxxxxxxxxxxxx> 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.