linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm: cleancache: no need to check return value of debugfs_create functions
@ 2019-01-22 15:21 Greg Kroah-Hartman
  2019-01-23 14:25 ` Konrad Rzeszutek Wilk
  0 siblings, 1 reply; 2+ messages in thread
From: Greg Kroah-Hartman @ 2019-01-22 15:21 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, Konrad Rzeszutek Wilk, linux-mm

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.

Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: linux-mm@kvack.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 mm/cleancache.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/mm/cleancache.c b/mm/cleancache.c
index 2bf12da9baa0..082fdda7aaa6 100644
--- a/mm/cleancache.c
+++ b/mm/cleancache.c
@@ -305,8 +305,7 @@ static int __init init_cleancache(void)
 {
 #ifdef CONFIG_DEBUG_FS
 	struct dentry *root = debugfs_create_dir("cleancache", NULL);
-	if (root == NULL)
-		return -ENXIO;
+
 	debugfs_create_u64("succ_gets", 0444, root, &cleancache_succ_gets);
 	debugfs_create_u64("failed_gets", 0444, root, &cleancache_failed_gets);
 	debugfs_create_u64("puts", 0444, root, &cleancache_puts);
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] mm: cleancache: no need to check return value of debugfs_create functions
  2019-01-22 15:21 [PATCH] mm: cleancache: no need to check return value of debugfs_create functions Greg Kroah-Hartman
@ 2019-01-23 14:25 ` Konrad Rzeszutek Wilk
  0 siblings, 0 replies; 2+ messages in thread
From: Konrad Rzeszutek Wilk @ 2019-01-23 14:25 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-kernel, linux-mm

On Tue, Jan 22, 2019 at 04:21:11PM +0100, Greg Kroah-Hartman wrote:
> 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.
> 
> Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>

OK.

Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>

or I can push it through my tree but it may be just easier for Andrew
too do it
> Cc: linux-mm@kvack.org
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> ---
>  mm/cleancache.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/mm/cleancache.c b/mm/cleancache.c
> index 2bf12da9baa0..082fdda7aaa6 100644
> --- a/mm/cleancache.c
> +++ b/mm/cleancache.c
> @@ -305,8 +305,7 @@ static int __init init_cleancache(void)
>  {
>  #ifdef CONFIG_DEBUG_FS
>  	struct dentry *root = debugfs_create_dir("cleancache", NULL);
> -	if (root == NULL)
> -		return -ENXIO;
> +
>  	debugfs_create_u64("succ_gets", 0444, root, &cleancache_succ_gets);
>  	debugfs_create_u64("failed_gets", 0444, root, &cleancache_failed_gets);
>  	debugfs_create_u64("puts", 0444, root, &cleancache_puts);
> -- 
> 2.20.1
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-01-23 14:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-22 15:21 [PATCH] mm: cleancache: no need to check return value of debugfs_create functions Greg Kroah-Hartman
2019-01-23 14:25 ` Konrad Rzeszutek Wilk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).