Return-Path: Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Re: [PATCH] Bluetooth: btintel: fix ptr_ret.cocci warnings From: Marcel Holtmann In-Reply-To: <20180822015950.cgvy5wvcdwarka7r@wfg-t540p.sh.intel.com> Date: Wed, 22 Aug 2018 08:08:11 +0200 Cc: Raghuram Hegde , amit.k.bag@intel.com, linux-bluetooth@vger.kernel.org, kbuild-all@01.org, sukumar.ghorai@intel.com, chethan.tumkur.narayan@intel.com, Philip Li Message-Id: References: <1534844080-31240-1-git-send-email-raghuram.hegde@intel.com> <20180822015950.cgvy5wvcdwarka7r@wfg-t540p.sh.intel.com> To: Fengguang Wu Sender: linux-bluetooth-owner@vger.kernel.org List-ID: Hi Fengguang, > 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 > Signed-off-by: Fengguang Wu > --- > > > 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); > } this does not apply cleanly to bluetooth-next tree. And then I realized this is against a patch that I have not applied. So sorry for the noise. Regards Marcel