lkml.org 
[lkml]   [2019]   [Nov]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] mtd: no need to check return value of debugfs_create functions
Hi Greg,

Greg Kroah-Hartman <gregkh@linuxfoundation.org> wrote on Thu, 7 Nov
2019 09:51:11 +0100:

> When calling debugfs functions, there is no need to ever check the
> return value. The function can work or not, but the code logic should
> never do something different based on this.

I didn't know about this. Is this something new or has it been the rule
since the beginning? In the case, don't we need a Fixes tag here?

> Cc: David Woodhouse <dwmw2@infradead.org>
> Cc: Brian Norris <computersforpeace@gmail.com>
> Cc: Marek Vasut <marek.vasut@gmail.com>
> Cc: Miquel Raynal <miquel.raynal@bootlin.com>
> Cc: Richard Weinberger <richard@nod.at>
> Cc: Vignesh Raghavendra <vigneshr@ti.com>
> Cc: Artem Bityutskiy <dedekind1@gmail.com>
> Cc: linux-mtd@lists.infradead.org
> Cc: linux-kernel@vger.kernel.org
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

[...]

> +
> + d->dfs_emulate_io_failures = debugfs_create_file("tst_emulate_io_failures",
> + S_IWUSR, d->dfs_dir,
> + (void *)ubi_num,
> + &dfs_fops);
> +
> + d->dfs_emulate_power_cut = debugfs_create_file("tst_emulate_power_cut",
> + S_IWUSR, d->dfs_dir,
> + (void *)ubi_num,
> + &dfs_fops);

Nitpick: I think we miss an empty line here. I can fix it when applying.

> + d->dfs_power_cut_min = debugfs_create_file("tst_emulate_power_cut_min",
> + S_IWUSR, d->dfs_dir,
> + (void *)ubi_num, &dfs_fops);
> +
> + d->dfs_power_cut_max = debugfs_create_file("tst_emulate_power_cut_max",
> + S_IWUSR, d->dfs_dir,
> + (void *)ubi_num, &dfs_fops);
> +
> + debugfs_create_file("detailed_erase_block_info", S_IRUSR, d->dfs_dir,
> + (void *)ubi_num, &eraseblk_count_fops);
> +
> + return 0;
> }
>
> /**

Thanks,
Miquèl

\
 
 \ /
  Last update: 2019-11-07 10:10    [W:0.074 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site