mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@rjwysocki.net>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-kernel@vger.kernel.org, Len Brown <len.brown@intel.com>,
	Pavel Machek <pavel@ucw.cz>,
	linux-pm@vger.kernel.org
Subject: Re: [PATCH] power: qos: no need to check return value of debugfs_create functions
Date: Thu, 24 Jan 2019 11:42:45 +0100	[thread overview]
Message-ID: <7412175.ooW4tQdR9c@aspire.rjw.lan> (raw)
In-Reply-To: <20190122152151.16139-48-gregkh@linuxfoundation.org>

On Tuesday, January 22, 2019 4:21:47 PM CET 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: "Rafael J. Wysocki" <rjw@rjwysocki.net>
> Cc: Len Brown <len.brown@intel.com>
> Cc: Pavel Machek <pavel@ucw.cz>
> Cc: linux-pm@vger.kernel.org
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> ---
>  kernel/power/qos.c | 8 ++------
>  1 file changed, 2 insertions(+), 6 deletions(-)
> 
> diff --git a/kernel/power/qos.c b/kernel/power/qos.c
> index b7a82502857a..9d22131afc1e 100644
> --- a/kernel/power/qos.c
> +++ b/kernel/power/qos.c
> @@ -582,10 +582,8 @@ static int register_pm_qos_misc(struct pm_qos_object *qos, struct dentry *d)
>  	qos->pm_qos_power_miscdev.name = qos->name;
>  	qos->pm_qos_power_miscdev.fops = &pm_qos_power_fops;
>  
> -	if (d) {
> -		(void)debugfs_create_file(qos->name, S_IRUGO, d,
> -					  (void *)qos, &pm_qos_debug_fops);
> -	}
> +	debugfs_create_file(qos->name, S_IRUGO, d, (void *)qos,
> +			    &pm_qos_debug_fops);
>  
>  	return misc_register(&qos->pm_qos_power_miscdev);
>  }
> @@ -685,8 +683,6 @@ static int __init pm_qos_power_init(void)
>  	BUILD_BUG_ON(ARRAY_SIZE(pm_qos_array) != PM_QOS_NUM_CLASSES);
>  
>  	d = debugfs_create_dir("pm_qos", NULL);
> -	if (IS_ERR_OR_NULL(d))
> -		d = NULL;
>  
>  	for (i = PM_QOS_CPU_DMA_LATENCY; i < PM_QOS_NUM_CLASSES; i++) {
>  		ret = register_pm_qos_misc(pm_qos_array[i], d);
> 

Applied, thanks!



      parent reply	other threads:[~2019-01-24 10:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-22 15:21 Greg Kroah-Hartman
2019-01-22 15:30 ` Rafael J. Wysocki
2019-01-22 15:53   ` Greg Kroah-Hartman
2019-01-24 10:42 ` Rafael J. Wysocki [this message]

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=7412175.ooW4tQdR9c@aspire.rjw.lan \
    --to=rjw@rjwysocki.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=len.brown@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=pavel@ucw.cz \
    /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

all inboxes | Powered by JetHome®