public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: "luo.liu.linux" <luo.liu.linux@163.com>
To: "Sakari Ailus" <sakari.ailus@linux.intel.com>
Cc: mchehab@kernel.org, linux-media@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re:Re: [PATCH v2] media:v4l2-async:add debugfs under CONFIG_DEBUG_FS
Date: Wed, 11 Mar 2026 17:42:15 +0800 (CST)	[thread overview]
Message-ID: <50d50ad1.88ee.19cdc468501.Coremail.luo.liu.linux@163.com> (raw)
In-Reply-To: <abEz6U82C994zgw7@kekkonen.localdomain>




Hi Sakari,

        Thank you very much for your review and suggestions.


          Yes, I originally intended to wrap everything in a single #ifdef CONFIG_DEBUG_FS ... #endif block. However, since v4l2_async_init and v4l2_async_exit are mandatory entry points (registered via subsys_initcall and module_exit), 

they must remain present regardless of the configuration. This limits the granularity, forcing me to place the conditional checks inside these two functions.


Kind regards, 

Luo.Liu


At 2026-03-11 17:20:41, "Sakari Ailus" <sakari.ailus@linux.intel.com> wrote:
>On Fri, Mar 06, 2026 at 05:41:17PM +0800, luo.liu.linux wrote:
>>  
>>  Hello Sakari and Mauro,
>>   
>>      Gentle ping ....
>> 
>> 
>> At 2026-01-21 11:14:56, "luo.liu" <luo.liu.linux@163.com> wrote:
>> >All debugfs-related code is guarded by CONFIG_DEBUG_FS to avoid
>> >bloating the kernel when debugfs is disabled.
>> >
>> >Signed-off-by: luo.liu <luo.liu.linux@163.com>
>> >---
>> > drivers/media/v4l2-core/v4l2-async.c | 6 ++++++
>> > 1 file changed, 6 insertions(+)
>> >
>> >diff --git a/drivers/media/v4l2-core/v4l2-async.c b/drivers/media/v4l2-core/v4l2-async.c
>> >index 1c08bba9ecb9..f6a1a57149ba 100644
>> >--- a/drivers/media/v4l2-core/v4l2-async.c
>> >+++ b/drivers/media/v4l2-core/v4l2-async.c
>> >@@ -947,6 +947,7 @@ v4l2_async_nf_name(struct v4l2_async_notifier *notifier)
>> > 		return "nil";
>> > }
>> > 
>> >+#ifdef CONFIG_DEBUG_FS
>> > static int pending_subdevs_show(struct seq_file *s, void *data)
>> > {
>> > 	struct v4l2_async_notifier *notif;
>> >@@ -967,20 +968,25 @@ static int pending_subdevs_show(struct seq_file *s, void *data)
>> > DEFINE_SHOW_ATTRIBUTE(pending_subdevs);
>> > 
>> > static struct dentry *v4l2_async_debugfs_dir;
>> >+#endif
>> > 
>> > static int __init v4l2_async_init(void)
>> > {
>> >+#ifdef CONFIG_DEBUG_FS
>> > 	v4l2_async_debugfs_dir = debugfs_create_dir("v4l2-async", NULL);
>> > 	debugfs_create_file("pending_async_subdevices", 0444,
>> > 			    v4l2_async_debugfs_dir, NULL,
>> > 			    &pending_subdevs_fops);
>> > 
>> >+#endif
>> > 	return 0;
>> > }
>> > 
>> > static void __exit v4l2_async_exit(void)
>> > {
>> >+#ifdef CONFIG_DEBUG_FS
>> > 	debugfs_remove_recursive(v4l2_async_debugfs_dir);
>> >+#endif
>> > }
>
>If debugfs is disabled, the init functions won't do anything. You can put
>these behind a single #ifdef .. #endif.
>
>-- 
>Sakari Ailus

  reply	other threads:[~2026-03-11  9:42 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-21  3:14 [PATCH v2] media:v4l2-async:add debugfs under CONFIG_DEBUG_FS luo.liu
2026-03-06  9:41 ` luo.liu.linux
2026-03-11  9:20   ` [PATCH " Sakari Ailus
2026-03-11  9:42     ` luo.liu.linux [this message]
2026-03-12  7:06     ` luo.liu.linux
2026-03-11  7:04 ` Sakari Ailus
2026-03-11  8:58   ` luo.liu.linux
2026-03-11  9:16     ` Sakari Ailus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50d50ad1.88ee.19cdc468501.Coremail.luo.liu.linux@163.com \
    --to=luo.liu.linux@163.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=sakari.ailus@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox