[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <22a61125-a0b9-f432-218f-cb467d1ef379@intel.com>
Date: Thu, 13 Jul 2023 16:07:22 -0700
From: Reinette Chatre <reinette.chatre@...el.com>
To: Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>,
<linux-kselftest@...r.kernel.org>, Shuah Khan <shuah@...nel.org>,
"Shaopeng Tan" <tan.shaopeng@...fujitsu.com>,
Fenghua Yu <fenghua.yu@...el.com>,
<linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v4 14/19] selftests/resctrl: Improve parameter consistency
in fill_buf
Hi Ilpo,
On 7/13/2023 6:19 AM, Ilpo Järvinen wrote:
> fill_buf's arguments can be improved in multiple ways:
>
> - Multiple functions in fill_buf have start_ptr as one of their
> argument which is a bit long and the extra "start" is pretty
> obvious when it comes to pointers.
>
> - Some of the functions take end_ptr and others size_t to indicate
> the end of the buffer.
>
> - Some arguments meaning buffer size are called just 's'
>
> - mem_flush() takes void * but immediately converts it to char *
>
> Cleanup the parameters to make things simpler and more consistent:
>
> - Rename start_ptr to simply buf as it's shorter.
>
> - Replace end_ptr and s parameters with buf_size and only calculate
> end_ptr in the functions that truly use it.
>
> - Make mem_flush() parameters to follow the same convention as the
> other functions in fill_buf.
>
> - convert mem_flush() char * to unsigned char *.
>
> While at it, fix also a typo in a comment.
>
> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>
This makes the code significantly easier to read. Thank you.
Reviewed-by: Reinette Chatre <reinette.chatre@...el.com>
Reinette
Powered by blists - more mailing lists