Re: [PATCH V4 4/4] x86/resctrl: Use appropriate API for strings terminated by newline

2020-05-18 Thread Reinette Chatre
Hi Andy, On 5/18/2020 9:06 AM, Reinette Chatre wrote: > On 5/18/2020 4:50 AM, Andy Shevchenko wrote: >> On Sat, May 16, 2020 at 11:28:41AM -0700, Reinette Chatre wrote: >>> The user input to files in the resctrl filesystem are expected to be >>> terminated with a newline. Testing the user input in

Re: [PATCH V4 4/4] x86/resctrl: Use appropriate API for strings terminated by newline

2020-05-18 Thread Reinette Chatre
Hi Andy, On 5/18/2020 4:50 AM, Andy Shevchenko wrote: > On Sat, May 16, 2020 at 11:28:41AM -0700, Reinette Chatre wrote: >> The user input to files in the resctrl filesystem are expected to be >> terminated with a newline. Testing the user input includes a test for >> the presence of a newline and

Re: [PATCH V4 4/4] x86/resctrl: Use appropriate API for strings terminated by newline

2020-05-18 Thread Andy Shevchenko
On Sat, May 16, 2020 at 11:28:41AM -0700, Reinette Chatre wrote: > The user input to files in the resctrl filesystem are expected to be > terminated with a newline. Testing the user input includes a test for > the presence of a newline and then replacing the newline with NUL > byte followed by comp

[PATCH V4 4/4] x86/resctrl: Use appropriate API for strings terminated by newline

2020-05-16 Thread Reinette Chatre
The user input to files in the resctrl filesystem are expected to be terminated with a newline. Testing the user input includes a test for the presence of a newline and then replacing the newline with NUL byte followed by comparison using strcmp(). sysfs_streq() exists to test if strings are equal