On Thursday, October 04, 2012 05:18:00 Antonio Quartulli wrote:
On Thu, Oct 04, 2012 at 01:06:55AM +0800, Marek Lindner wrote:
On Thursday, October 04, 2012 00:35:36 Antonio Quartulli wrote:
@@ -355,6 +366,13 @@ void batadv_debugfs_init(void)
if (!file) pr_err("Can't add debugfs file: %s\n",
bat_debug->attr.name);
bat_debug = &batadv_debuginfo_compat_version;
file = debugfs_create_file(bat_debug->attr.name,
S_IFREG | bat_debug->attr.mode,
batadv_debugfs, NULL,
&bat_debug->fops); + if (!file)
pr_err("Can't add debugfs file: %s\n",
bat_debug->attr.name); +
out: return;
}
If we start to create more files here you should add a a loop like in batadv_debugfs_add_meshif() to avoid duplicate code.
do you think we should do that for two files already? I do not think there will be so much to add in this debugfs folder. Maybe we can add a loop as soon as add the next one, but for two I think we can still leave with this implementation.
Well, when I added the 'routing_algos' file I also thought nobody else would want to add something there ...
Cheers, Marek