linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Fengguang Wu <fengguang.wu@intel.com>
To: Marcel Holtmann <marcel@holtmann.org>,
	Raghuram Hegde <raghuram.hegde@intel.com>
Cc: amit.k.bag@intel.com, raghuram.hegde@intel.com,
	linux-bluetooth@vger.kernel.org, kbuild-all@01.org,
	sukumar.ghorai@intel.com, chethan.tumkur.narayan@intel.com,
	Philip Li <philip.li@intel.com>
Subject: [PATCH] Bluetooth: btintel: fix ptr_ret.cocci warnings
Date: Wed, 22 Aug 2018 09:59:50 +0800	[thread overview]
Message-ID: <20180822015950.cgvy5wvcdwarka7r@wfg-t540p.sh.intel.com> (raw)
In-Reply-To: <1534844080-31240-1-git-send-email-raghuram.hegde@intel.com>

Coccinelle warns about

         drivers/bluetooth/btintel.c:416:1-3: WARNING: PTR_ERR_OR_ZERO can be used

Fix it by using PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR.

Generated by: scripts/coccinelle/api/ptr_ret.cocci

Fixes: 38ca310b0d2c ("Bluetooth: btintel: Add platform device for rfkill signal")
CC: Sukumar Ghorai <sukumar.ghorai@intel.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
---


  btintel.c |    5 +----
  1 file changed, 1 insertion(+), 4 deletions(-)

--- a/drivers/bluetooth/btintel.c
+++ b/drivers/bluetooth/btintel.c
@@ -413,10 +413,7 @@ static int btintel_probe(struct platform
  
  	reset_gpio_handler = devm_gpiod_get_optional(&pdev->dev,
  					"reset", GPIOD_OUT_HIGH);
-	if (IS_ERR(reset_gpio_handler))
-		return PTR_ERR(reset_gpio_handler);
-
-	return 0;
+	return PTR_ERR_OR_ZERO(reset_gpio_handler);
  }
  
  static int btintel_remove(struct platform_device *pdev)
_______________________________________________
kbuild-all mailing list
kbuild-all@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild-all

  parent reply	other threads:[~2018-08-22  1:59 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-21  9:34 [PATCH 1/2] Bluetooth: btintel: Add platform device for rfkill signal Raghuram Hegde
2018-08-21  9:34 ` [PATCH 2/2] Bluletooth: Add hardware reset callback to reset intel bluetooth chip Raghuram Hegde
2018-08-21 14:14   ` Marcel Holtmann
2018-08-21 14:42     ` chethan tn
2018-08-21 14:13 ` [PATCH 1/2] Bluetooth: btintel: Add platform device for rfkill signal Marcel Holtmann
2018-08-21 14:58   ` chethan tn
2018-08-21 15:09     ` Marcel Holtmann
2018-09-11  4:45       ` chethan tn
2018-09-11  5:13         ` Hegde, Raghuram
2018-09-27 10:44           ` Marcel Holtmann
2018-08-21 14:54 ` kbuild test robot
2018-08-21 16:55 ` kbuild test robot
2018-08-21 16:55 ` [PATCH] Bluetooth: btintel: fix ptr_ret.cocci warnings kbuild test robot
2018-08-21 20:20   ` Marcel Holtmann
2018-08-22  1:52     ` [kbuild-all] " Li, Philip
2018-08-22  2:00     ` Fengguang Wu
2018-08-22  1:59 ` Fengguang Wu [this message]
2018-08-22  6:08   ` Marcel Holtmann
2018-08-22  6:35     ` Fengguang Wu

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=20180822015950.cgvy5wvcdwarka7r@wfg-t540p.sh.intel.com \
    --to=fengguang.wu@intel.com \
    --cc=amit.k.bag@intel.com \
    --cc=chethan.tumkur.narayan@intel.com \
    --cc=kbuild-all@01.org \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=marcel@holtmann.org \
    --cc=philip.li@intel.com \
    --cc=raghuram.hegde@intel.com \
    --cc=sukumar.ghorai@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;
as well as URLs for NNTP newsgroup(s).