firmware: Use PTR_ERR_OR_ZERO()
"Linux Kernel Mailing List" <[email protected]>
| Newsgroups | gmane.linux.kernel.commits.head |
|---|---|
| Message-ID | <[email protected]> |
Web: https://git.kernel.org/torvalds/c/0a9e63aa397711cb7dd8a5c3db33448740a0b844 Commit: 0a9e63aa397711cb7dd8a5c3db33448740a0b844 Parent: c2c9f9bc5b830cbb63d6674b0d51a7773e54c90c Refname: refs/heads/master Author: Vasyl Gomonovych <[email protected]> AuthorDate: Tue Nov 28 22:40:27 2017 +0100 Committer: Michael S. Tsirkin <[email protected]> CommitDate: Wed Jan 31 01:47:34 2018 +0200 firmware: Use PTR_ERR_OR_ZERO() Fix ptr_ret.cocci warnings: drivers/firmware/efi/efi.c:610:8-14: 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 <[email protected]> Signed-off-by: Michael S. Tsirkin <[email protected]> Acked-by: Gabriel Somlo <[email protected]> Reviewed-by: Stefan Hajnoczi <[email protected]> --- drivers/firmware/qemu_fw_cfg.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/firmware/qemu_fw_cfg.c b/drivers/firmware/qemu_fw_cfg.c index deb483064f53..a41b572eeeb1 100644 --- a/drivers/firmware/qemu_fw_cfg.c +++ b/drivers/firmware/qemu_fw_cfg.c @@ -694,10 +694,8 @@ static int fw_cfg_cmdline_set(const char *arg, const struct kernel_param *kp) */ fw_cfg_cmdline_dev = platform_device_register_simple("fw_cfg", PLATFORM_DEVID_NONE, res, processed); - if (IS_ERR(fw_cfg_cmdline_dev)) - return PTR_ERR(fw_cfg_cmdline_dev); - return 0; + return PTR_ERR_OR_ZERO(fw_cfg_cmdline_dev); } static int fw_cfg_cmdline_get(char *buf, const struct kernel_param *kp) -- To unsubscribe from this list: send the line "unsubscribe git-commits-head" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html