* drivers/phy/tegra/phy-tegra194-p2u.c:95:1-3: WARNING: PTR_ERR_OR_ZERO can be used
@ 2020-11-16 23:00 kernel test robot
2020-11-16 23:00 ` [PATCH] phy: fix ptr_ret.cocci warnings kernel test robot
0 siblings, 1 reply; 3+ messages in thread
From: kernel test robot @ 2020-11-16 23:00 UTC (permalink / raw)
To: Tiezhu Yang; +Cc: kbuild-all, linux-kernel, Vinod Koul, Heiko Stuebner
[-- Attachment #1: Type: text/plain, Size: 776 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 09162bc32c880a791c6c0668ce0745cf7958f576
commit: 133552bf03edbe3892767a4b64c56e3bed746374 phy: Remove CONFIG_ARCH_* check for related subdir in Makefile
date: 5 months ago
config: h8300-randconfig-c004-20201116 (attached as .config)
compiler: h8300-linux-gcc (GCC) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
"coccinelle warnings: (new ones prefixed by >>)"
>> drivers/phy/tegra/phy-tegra194-p2u.c:95:1-3: WARNING: PTR_ERR_OR_ZERO can be used
Please review and possibly fold the followup patch.
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 36449 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH] phy: fix ptr_ret.cocci warnings
2020-11-16 23:00 drivers/phy/tegra/phy-tegra194-p2u.c:95:1-3: WARNING: PTR_ERR_OR_ZERO can be used kernel test robot
@ 2020-11-16 23:00 ` kernel test robot
2020-11-17 13:28 ` Thierry Reding
0 siblings, 1 reply; 3+ messages in thread
From: kernel test robot @ 2020-11-16 23:00 UTC (permalink / raw)
To: Tiezhu Yang
Cc: kbuild-all, linux-kernel, Vinod Koul, Heiko Stuebner,
Kishon Vijay Abraham I, Thierry Reding, Jonathan Hunter,
linux-tegra
From: kernel test robot <lkp@intel.com>
drivers/phy/tegra/phy-tegra194-p2u.c:95: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: 133552bf03ed ("phy: Remove CONFIG_ARCH_* check for related subdir in Makefile")
CC: Tiezhu Yang <yangtiezhu@loongson.cn>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 09162bc32c880a791c6c0668ce0745cf7958f576
commit: 133552bf03edbe3892767a4b64c56e3bed746374 phy: Remove CONFIG_ARCH_* check for related subdir in Makefile
phy-tegra194-p2u.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
--- a/drivers/phy/tegra/phy-tegra194-p2u.c
+++ b/drivers/phy/tegra/phy-tegra194-p2u.c
@@ -92,10 +92,7 @@ static int tegra_p2u_probe(struct platfo
phy_set_drvdata(generic_phy, phy);
phy_provider = devm_of_phy_provider_register(dev, of_phy_simple_xlate);
- if (IS_ERR(phy_provider))
- return PTR_ERR(phy_provider);
-
- return 0;
+ return PTR_ERR_OR_ZERO(phy_provider);
}
static const struct of_device_id tegra_p2u_id_table[] = {
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] phy: fix ptr_ret.cocci warnings
2020-11-16 23:00 ` [PATCH] phy: fix ptr_ret.cocci warnings kernel test robot
@ 2020-11-17 13:28 ` Thierry Reding
0 siblings, 0 replies; 3+ messages in thread
From: Thierry Reding @ 2020-11-17 13:28 UTC (permalink / raw)
To: kernel test robot
Cc: Tiezhu Yang, kbuild-all, linux-kernel, Vinod Koul,
Heiko Stuebner, Kishon Vijay Abraham I, Jonathan Hunter,
linux-tegra
[-- Attachment #1: Type: text/plain, Size: 2103 bytes --]
On Tue, Nov 17, 2020 at 07:00:32AM +0800, kernel test robot wrote:
> From: kernel test robot <lkp@intel.com>
>
> drivers/phy/tegra/phy-tegra194-p2u.c:95: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: 133552bf03ed ("phy: Remove CONFIG_ARCH_* check for related subdir in Makefile")
> CC: Tiezhu Yang <yangtiezhu@loongson.cn>
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: kernel test robot <lkp@intel.com>
> ---
>
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head: 09162bc32c880a791c6c0668ce0745cf7958f576
> commit: 133552bf03edbe3892767a4b64c56e3bed746374 phy: Remove CONFIG_ARCH_* check for related subdir in Makefile
>
> phy-tegra194-p2u.c | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
A similar patch was recently sent out against the pci-tegra driver. That
was perhaps the third time or so that it happened and both the Bjorn
(the PCI maintainer) and I have agreed multiple times in the past that
this isn't an actual improvement.
There are two reasons why I think this is actually worse than the
original: 1) this doesn't look like regular error handling and therefore
becomes more difficult to read and 2) if we ever need to add code
between the devm_of_phy_provider_register() and the final successful
return, we need to go and effectively revert this patch again.
I wonder if there's enough consensus that PTR_ERR_OR_ZERO() is really
that useful.
Thierry
>
> --- a/drivers/phy/tegra/phy-tegra194-p2u.c
> +++ b/drivers/phy/tegra/phy-tegra194-p2u.c
> @@ -92,10 +92,7 @@ static int tegra_p2u_probe(struct platfo
> phy_set_drvdata(generic_phy, phy);
>
> phy_provider = devm_of_phy_provider_register(dev, of_phy_simple_xlate);
> - if (IS_ERR(phy_provider))
> - return PTR_ERR(phy_provider);
> -
> - return 0;
> + return PTR_ERR_OR_ZERO(phy_provider);
> }
>
> static const struct of_device_id tegra_p2u_id_table[] = {
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-11-17 13:53 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-16 23:00 drivers/phy/tegra/phy-tegra194-p2u.c:95:1-3: WARNING: PTR_ERR_OR_ZERO can be used kernel test robot
2020-11-16 23:00 ` [PATCH] phy: fix ptr_ret.cocci warnings kernel test robot
2020-11-17 13:28 ` Thierry Reding
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).