linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tri Vo <trong@android.com>
To: kbuild test robot <lkp@intel.com>
Cc: kbuild-all@01.org, linux-acpi@vger.kernel.org, devel@acpica.org,
	Linux PM <linux-pm@vger.kernel.org>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: Re: [PATCH] PM / wakeup: fix ptr_ret.cocci warnings
Date: Tue, 23 Jul 2019 09:27:13 -0700	[thread overview]
Message-ID: <CANA+-vCDTSvfeD8upBfpUP5aSpM7cUqT8xB0URRwkhZ1Gqr+qQ@mail.gmail.com> (raw)
In-Reply-To: <20190723140337.GA54192@lkp-kbuild04>

On Tue, Jul 23, 2019 at 7:03 AM kbuild test robot <lkp@intel.com> wrote:
>
> From: kbuild test robot <lkp@intel.com>
>
> drivers/base/power/wakeup_stats.c:143: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
>
> Fixes: 0b050f7fb8a1 ("PM / wakeup: show wakeup sources stats in sysfs")
> CC: Tri Vo <trong@android.com>
> Signed-off-by: kbuild test robot <lkp@intel.com>

Reviewed-by: Tri Vo <trong@android.com>

> ---
>
> tree:   https://kernel.googlesource.com/pub/scm/linux/kernel/git/rafael/linux-pm.git bleeding-edge
> head:   14b99dcec44e7bca9f01e042002f57e9f0dda133
> commit: 0b050f7fb8a1e45c72ca945bac2821a59d4a0101 [21/23] PM / wakeup: show wakeup sources stats in sysfs
>
>  wakeup_stats.c |    5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
>
> --- a/drivers/base/power/wakeup_stats.c
> +++ b/drivers/base/power/wakeup_stats.c
> @@ -140,10 +140,7 @@ EXPORT_SYMBOL_GPL(wakeup_source_sysfs_re
>  static int __init wakeup_sources_sysfs_init(void)
>  {
>         wakeup_class = class_create(THIS_MODULE, "wakeup");
> -       if (IS_ERR(wakeup_class))
> -               return PTR_ERR(wakeup_class);
> -
> -       return 0;
> +       return PTR_ERR_OR_ZERO(wakeup_class);
>  }
>
>  postcore_initcall(wakeup_sources_sysfs_init);

      reply	other threads:[~2019-07-23 16:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-23 14:03 [pm:bleeding-edge 21/23] drivers/base/power/wakeup_stats.c:143:1-3: WARNING: PTR_ERR_OR_ZERO can be used kbuild test robot
2019-07-23 14:03 ` [PATCH] PM / wakeup: fix ptr_ret.cocci warnings kbuild test robot
2019-07-23 16:27   ` Tri Vo [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=CANA+-vCDTSvfeD8upBfpUP5aSpM7cUqT8xB0URRwkhZ1Gqr+qQ@mail.gmail.com \
    --to=trong@android.com \
    --cc=devel@acpica.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=kbuild-all@01.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=rjw@rjwysocki.net \
    /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;
as well as URLs for NNTP newsgroup(s).