All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] platform/x86: intel_telemetry_debugfs: fix some error codes in init
@ 2017-06-30  7:52 ` Dan Carpenter
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2017-06-30  7:52 UTC (permalink / raw)
  To: Souvik Kumar Chakravarty
  Cc: Darren Hart, Andy Shevchenko, platform-driver-x86, kernel-janitors

There are bunch of "goto out;" paths where we don't set the error code.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/platform/x86/intel_telemetry_debugfs.c b/drivers/platform/x86/intel_telemetry_debugfs.c
index 4cc2f4ea0a25..b8be058a8754 100644
--- a/drivers/platform/x86/intel_telemetry_debugfs.c
+++ b/drivers/platform/x86/intel_telemetry_debugfs.c
@@ -938,7 +938,7 @@ static struct notifier_block pm_notifier = {
 static int __init telemetry_debugfs_init(void)
 {
 	const struct x86_cpu_id *id;
-	int err = -ENOMEM;
+	int err;
 	struct dentry *f;
 
 	/* Only APL supported for now */
@@ -958,11 +958,10 @@ static int __init telemetry_debugfs_init(void)
 
 	register_pm_notifier(&pm_notifier);
 
+	err = -ENOMEM;
 	debugfs_conf->telemetry_dbg_dir = debugfs_create_dir("telemetry", NULL);
-	if (!debugfs_conf->telemetry_dbg_dir) {
-		err = -ENOMEM;
+	if (!debugfs_conf->telemetry_dbg_dir)
 		goto out_pm;
-	}
 
 	f = debugfs_create_file("pss_info", S_IFREG | S_IRUGO,
 				debugfs_conf->telemetry_dbg_dir, NULL,

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

* [PATCH] platform/x86: intel_telemetry_debugfs: fix some error codes in init
@ 2017-06-30  7:52 ` Dan Carpenter
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2017-06-30  7:52 UTC (permalink / raw)
  To: Souvik Kumar Chakravarty
  Cc: Darren Hart, Andy Shevchenko, platform-driver-x86, kernel-janitors

There are bunch of "goto out;" paths where we don't set the error code.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/platform/x86/intel_telemetry_debugfs.c b/drivers/platform/x86/intel_telemetry_debugfs.c
index 4cc2f4ea0a25..b8be058a8754 100644
--- a/drivers/platform/x86/intel_telemetry_debugfs.c
+++ b/drivers/platform/x86/intel_telemetry_debugfs.c
@@ -938,7 +938,7 @@ static struct notifier_block pm_notifier = {
 static int __init telemetry_debugfs_init(void)
 {
 	const struct x86_cpu_id *id;
-	int err = -ENOMEM;
+	int err;
 	struct dentry *f;
 
 	/* Only APL supported for now */
@@ -958,11 +958,10 @@ static int __init telemetry_debugfs_init(void)
 
 	register_pm_notifier(&pm_notifier);
 
+	err = -ENOMEM;
 	debugfs_conf->telemetry_dbg_dir = debugfs_create_dir("telemetry", NULL);
-	if (!debugfs_conf->telemetry_dbg_dir) {
-		err = -ENOMEM;
+	if (!debugfs_conf->telemetry_dbg_dir)
 		goto out_pm;
-	}
 
 	f = debugfs_create_file("pss_info", S_IFREG | S_IRUGO,
 				debugfs_conf->telemetry_dbg_dir, NULL,

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

* Re: [PATCH] platform/x86: intel_telemetry_debugfs: fix some error codes in init
  2017-06-30  7:52 ` Dan Carpenter
@ 2017-06-30 16:17   ` Andy Shevchenko
  -1 siblings, 0 replies; 4+ messages in thread
From: Andy Shevchenko @ 2017-06-30 16:17 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Souvik Kumar Chakravarty, Darren Hart, Andy Shevchenko,
	Platform Driver, kernel-janitors

On Fri, Jun 30, 2017 at 10:52 AM, Dan Carpenter
<dan.carpenter@oracle.com> wrote:
> There are bunch of "goto out;" paths where we don't set the error code.
>

Applied for testing, thanks!

> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> diff --git a/drivers/platform/x86/intel_telemetry_debugfs.c b/drivers/platform/x86/intel_telemetry_debugfs.c
> index 4cc2f4ea0a25..b8be058a8754 100644
> --- a/drivers/platform/x86/intel_telemetry_debugfs.c
> +++ b/drivers/platform/x86/intel_telemetry_debugfs.c
> @@ -938,7 +938,7 @@ static struct notifier_block pm_notifier = {
>  static int __init telemetry_debugfs_init(void)
>  {
>         const struct x86_cpu_id *id;
> -       int err = -ENOMEM;
> +       int err;
>         struct dentry *f;
>
>         /* Only APL supported for now */
> @@ -958,11 +958,10 @@ static int __init telemetry_debugfs_init(void)
>
>         register_pm_notifier(&pm_notifier);
>
> +       err = -ENOMEM;
>         debugfs_conf->telemetry_dbg_dir = debugfs_create_dir("telemetry", NULL);
> -       if (!debugfs_conf->telemetry_dbg_dir) {
> -               err = -ENOMEM;
> +       if (!debugfs_conf->telemetry_dbg_dir)
>                 goto out_pm;
> -       }
>
>         f = debugfs_create_file("pss_info", S_IFREG | S_IRUGO,
>                                 debugfs_conf->telemetry_dbg_dir, NULL,



-- 
With Best Regards,
Andy Shevchenko

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

* Re: [PATCH] platform/x86: intel_telemetry_debugfs: fix some error codes in init
@ 2017-06-30 16:17   ` Andy Shevchenko
  0 siblings, 0 replies; 4+ messages in thread
From: Andy Shevchenko @ 2017-06-30 16:17 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Souvik Kumar Chakravarty, Darren Hart, Andy Shevchenko,
	Platform Driver, kernel-janitors

On Fri, Jun 30, 2017 at 10:52 AM, Dan Carpenter
<dan.carpenter@oracle.com> wrote:
> There are bunch of "goto out;" paths where we don't set the error code.
>

Applied for testing, thanks!

> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> diff --git a/drivers/platform/x86/intel_telemetry_debugfs.c b/drivers/platform/x86/intel_telemetry_debugfs.c
> index 4cc2f4ea0a25..b8be058a8754 100644
> --- a/drivers/platform/x86/intel_telemetry_debugfs.c
> +++ b/drivers/platform/x86/intel_telemetry_debugfs.c
> @@ -938,7 +938,7 @@ static struct notifier_block pm_notifier = {
>  static int __init telemetry_debugfs_init(void)
>  {
>         const struct x86_cpu_id *id;
> -       int err = -ENOMEM;
> +       int err;
>         struct dentry *f;
>
>         /* Only APL supported for now */
> @@ -958,11 +958,10 @@ static int __init telemetry_debugfs_init(void)
>
>         register_pm_notifier(&pm_notifier);
>
> +       err = -ENOMEM;
>         debugfs_conf->telemetry_dbg_dir = debugfs_create_dir("telemetry", NULL);
> -       if (!debugfs_conf->telemetry_dbg_dir) {
> -               err = -ENOMEM;
> +       if (!debugfs_conf->telemetry_dbg_dir)
>                 goto out_pm;
> -       }
>
>         f = debugfs_create_file("pss_info", S_IFREG | S_IRUGO,
>                                 debugfs_conf->telemetry_dbg_dir, NULL,



-- 
With Best Regards,
Andy Shevchenko

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

end of thread, other threads:[~2017-06-30 16:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-30  7:52 [PATCH] platform/x86: intel_telemetry_debugfs: fix some error codes in init Dan Carpenter
2017-06-30  7:52 ` Dan Carpenter
2017-06-30 16:17 ` Andy Shevchenko
2017-06-30 16:17   ` Andy Shevchenko

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.