From: kbuild test robot <lkp@xxxxxxxxx> drivers/platform/x86/intel_cht_int33fe.c:98: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: 7ea0bcd16565 ("platform/x86: intel_cht_int33fe: Register max17047 in its own function") CC: Heikki Krogerus <heikki.krogerus@xxxxxxxxxxxxxxx> Signed-off-by: kbuild test robot <lkp@xxxxxxxxx> --- tree: https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git bleeding-edge head: 98438d88cbe65037744bdc071720389797f9c575 commit: 7ea0bcd165658c84544d5f241126b782d14fbb7f [80/85] platform/x86: intel_cht_int33fe: Register max17047 in its own function intel_cht_int33fe.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) --- a/drivers/platform/x86/intel_cht_int33fe.c +++ b/drivers/platform/x86/intel_cht_int33fe.c @@ -95,10 +95,7 @@ cht_int33fe_register_max17047(struct dev board_info.dev_name = "max17047"; board_info.properties = max17047_props; data->max17047 = i2c_acpi_new_device(dev, 1, &board_info); - if (IS_ERR(data->max17047)) - return PTR_ERR(data->max17047); - - return 0; + return PTR_ERR_OR_ZERO(data->max17047); } static const struct property_entry fusb302_props[] = {