From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751467AbeABSLL (ORCPT + 1 other); Tue, 2 Jan 2018 13:11:11 -0500 Received: from mail-wm0-f67.google.com ([74.125.82.67]:42155 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751416AbeABSLI (ORCPT ); Tue, 2 Jan 2018 13:11:08 -0500 X-Google-Smtp-Source: ACJfBotwRbrzIzV6prhHl4H25Xsff2+CS9HgE3SmDlxPCKo7VQ+eHOZDWUBvO+7zCZeEU1T5kC7X6Q== From: Ard Biesheuvel To: linux-efi@vger.kernel.org, Ingo Molnar , Thomas Gleixner , "H . Peter Anvin" Cc: Ard Biesheuvel , linux-kernel@vger.kernel.org, Arvind Yadav , Matt Fleming , Stephen Boyd , Tyler Baicar , Vasyl Gomonovych Subject: [PATCH 3/5] efi: Use PTR_ERR_OR_ZERO() Date: Tue, 2 Jan 2018 18:10:40 +0000 Message-Id: <20180102181042.19074-4-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180102181042.19074-1-ard.biesheuvel@linaro.org> References: <20180102181042.19074-1-ard.biesheuvel@linaro.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: From: Vasyl Gomonovych 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 Signed-off-by: Matt Fleming Signed-off-by: Ard Biesheuvel --- drivers/firmware/efi/efi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/firmware/efi/efi.c b/drivers/firmware/efi/efi.c index 557a47829d03..8ce70c2e73d5 100644 --- a/drivers/firmware/efi/efi.c +++ b/drivers/firmware/efi/efi.c @@ -608,7 +608,7 @@ static int __init efi_load_efivars(void) return 0; pdev = platform_device_register_simple("efivars", 0, NULL, 0); - return IS_ERR(pdev) ? PTR_ERR(pdev) : 0; + return PTR_ERR_OR_ZERO(pdev); } device_initcall(efi_load_efivars); #endif -- 2.11.0