lkml.org 
[lkml]   [2020]   [Jan]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH kunit 1/3] kunit: add debugfs /sys/kernel/debug/kunit/<suite>/results display
On Thu, Jan 23, 2020 at 02:47:18PM +0000, Alan Maguire wrote:
> +int debugfs_init(void)
> +{
> + if (!debugfs_rootdir)
> + debugfs_rootdir = debugfs_create_dir(KUNIT_DEBUGFS_ROOT, NULL);
> + if (IS_ERR(debugfs_rootdir))
> + return PTR_ERR(debugfs_rootdir);
> + return 0;

No, you never care if a debugfs call works or not, just call it and move
on. So just create the directory, and then pass it into whatever
debugfs call you want, never test it or do anything about it. This
function can be void as well.

> +void debugfs_create_suite(struct kunit_suite *suite)
> +{
> + /* First add /sys/kernel/debug/kunit/<testsuite> */
> + suite->debugfs = debugfs_create_dir(suite->name, debugfs_rootdir);
> + if (IS_ERR(suite->debugfs))
> + return;

Same here, don't test, just call and move on.

thanks,

greg k-h

\
 
 \ /
  Last update: 2020-01-23 15:56    [W:0.232 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site