Re: [PATCH 1/4] ref_tracker: add a top level debugfs directory for ref_tracker
From: Andrew Lunn
Date: Mon Apr 14 2025 - 18:35:46 EST
> +static int __init ref_tracker_debug_init(void)
> +{
> + ref_tracker_debug_dir = debugfs_create_dir("ref_tracker", NULL);
> + if (IS_ERR(ref_tracker_debug_dir)) {
I'm pretty sure GregKH will tell you not to check the return
code. Nothing bad should happen. Yes, it takes a while to get used to
this, but that is the way debugfs is designed.
> + pr_warn("ref_tracker: unable to create debugfs ref_tracker directory: %pe\n",
> + ref_tracker_debug_dir);
> + ref_tracker_debug_dir = NULL;
No need for this. All debugfs_ functions are happy to accept an err
pointer and do a NOP.
Andrew