From: Vasyl Gomonovych <gomonovych@gmail.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Vasyl Gomonovych <gomonovych@gmail.com>,
"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
Jean Delvare <jdelvare@suse.de>,
linux-kernel@vger.kernel.org
Subject: [PATCH] PNP: pnpbios: Use PTR_ERR_OR_ZERO()
Date: Wed, 29 Nov 2017 17:20:57 +0100 [thread overview]
Message-ID: <1511972460-25499-1-git-send-email-gomonovych@gmail.com> (raw)
Fix ptr_ret.cocci warnings:
drivers/pnp/pnpbios/core.c:584:1-3: WARNING: PTR_ERR_OR_ZERO can be used
Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR
Generated by: scripts/coccinelle/api/ptr_ret.cocci
Signed-off-by: Vasyl Gomonovych <gomonovych@gmail.com>
---
drivers/pnp/pnpbios/core.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/pnp/pnpbios/core.c b/drivers/pnp/pnpbios/core.c
index e681140b85d8..077f334fdbae 100644
--- a/drivers/pnp/pnpbios/core.c
+++ b/drivers/pnp/pnpbios/core.c
@@ -581,10 +581,7 @@ static int __init pnpbios_thread_init(void)
init_completion(&unload_sem);
task = kthread_run(pnp_dock_thread, NULL, "kpnpbiosd");
- if (IS_ERR(task))
- return PTR_ERR(task);
-
- return 0;
+ return PTR_ERR_OR_ZERO(task);
}
/* Start the kernel thread later: */
--
1.9.1
next reply other threads:[~2017-11-29 16:21 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-29 16:20 Vasyl Gomonovych [this message]
2017-11-29 20:55 ` [PATCH] PNP: pnpbios: Use PTR_ERR_OR_ZERO() Jean Delvare
2017-12-17 17:36 ` Rafael J. Wysocki
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=1511972460-25499-1-git-send-email-gomonovych@gmail.com \
--to=gomonovych@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=jdelvare@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=rafael.j.wysocki@intel.com \
/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