Re: [PATCH v2 6/6] panic: sys_info: Factor out read and write handlers

From: Andy Shevchenko

Date: Thu Oct 30 2025 - 03:44:31 EST


On Thu, Oct 30, 2025 at 10:06:14AM +0800, Feng Tang wrote:
> On Wed, Oct 29, 2025 at 12:07:41PM +0100, Andy Shevchenko wrote:
> > For the sake of the code readability and easier maintenance
> > factor out read and write sys_info handlers.

...

> As the if and else block each has only round 10 lines of code, and fit a
> screen well, I'm not sure whether adding 2 new functions will improve
> readabilty, but I'm fine with the change.

It increases readability and understanding as, for example, one don't need to
check what "write" is when giving as a parameter, Also if you noticed one of my
patch actually made it short by a few lines. So, better to compare the before
_the series_ and after. And even so, the size is not often the main metric for
the readability. I made this patch as I obviously see the benefit of it.

P.S. Thanks for your review!

--
With Best Regards,
Andy Shevchenko