From patchwork Mon Nov 23 07:43:24 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 57114 Delivered-To: patch@linaro.org Received: by 10.112.155.196 with SMTP id vy4csp1280520lbb; Sun, 22 Nov 2015 23:46:11 -0800 (PST) X-Received: by 10.69.8.226 with SMTP id dn2mr34684459pbd.138.1448264771740; Sun, 22 Nov 2015 23:46:11 -0800 (PST) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id it8si18094702pbc.103.2015.11.22.23.46.11 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 22 Nov 2015 23:46:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) smtp.mailfrom=linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org; dkim=neutral (body hash did not verify) header.i=@linaro-org.20150623.gappssmtp.com Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1a0lnm-0004Xa-1C; Mon, 23 Nov 2015 07:44:42 +0000 Received: from mail-wm0-x233.google.com ([2a00:1450:400c:c09::233]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1a0lnK-0004Iy-G3 for linux-arm-kernel@lists.infradead.org; Mon, 23 Nov 2015 07:44:16 +0000 Received: by wmec201 with SMTP id c201so147159630wme.0 for ; Sun, 22 Nov 2015 23:43:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=qvgHvxRpEZlMSnPMnTQLCYF4tv2hmIEY92tafes+gLs=; b=pp3Ur4JDFQmr5LbOSqL3wvlQnTtTRaF8BmUMiJc+xbkMnGeAz4oovF6CGm01AmAb5K 2MfL53uZyCmj9ASIYxu6/vDSbx9joxxl/Ntvo9u4gF/FsfC4gXq0B9eba0rtsLM+xI1I n+StpY64spKoV6xYch+O8R7Ki+nndHF5lvhXtfC+O0kvXe7mUpjR4m1vzTCz7wx3AT2m c9wR7H1GgoVfuD6gCizJVKX2bKCIUk3apekMB3CUsReYuJ6CnqAmHcjcdfhBrot9jVoj MD0rvmg1tIiQ8hR8J7H28VHW8sJHjWcCLQhdE2GX9LcWIV0bzcY8+it5klR2c6nzQd5f c1Gw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=qvgHvxRpEZlMSnPMnTQLCYF4tv2hmIEY92tafes+gLs=; b=X8EbgaqpKIfRKwBd9JXViDl1um4uFQpwRAa+xIuXaj3hVOKH5VC/gEhb1P0fKI8eYj +9bdH4sK8CEDTQugwV15e/RLuBU7Xpukqqpfn5yWbpjaL2vMpSjJu7evlR7xhQmvJ251 w9PtculA8WgK7RC/dXYGal53DdC/GBrt6XtVGXkeeEFlmhe42uZCO1lw0VdqmInJsDtX JRutZNn9IGTkF9GtNwWL9unJXg4bZ5HxojdGT9dPy08n3ljH9T2WVZUgQSdhfGRqJG6B qPvvPmfXp3dZROsMd+VU8atMeIu9Av4z0Z5Rw2QbOMBdmLCQZtN56yOMkyebY2oiB+qs vhOA== X-Gm-Message-State: ALoCoQmqgF2vb9vkHMCwv7csPVIKxTX5BwmUmcO4oQUI8B0DWFvfkJ7Qfw+ThUOiTjnOxRPyF6cZ X-Received: by 10.28.234.200 with SMTP id g69mr16523403wmi.97.1448264632716; Sun, 22 Nov 2015 23:43:52 -0800 (PST) Received: from localhost.localdomain ([2.44.140.166]) by smtp.gmail.com with ESMTPSA id cw3sm11853548wjb.26.2015.11.22.23.43.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 22 Nov 2015 23:43:52 -0800 (PST) From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org, catalin.marinas@arm.com, leif.lindholm@linaro.org Subject: [PATCH 2/2] arm64: efi: fix initcall return values Date: Mon, 23 Nov 2015 08:43:24 +0100 Message-Id: <1448264604-19411-3-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1448264604-19411-1-git-send-email-ard.biesheuvel@linaro.org> References: <1448264604-19411-1-git-send-email-ard.biesheuvel@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151122_234414_914850_48B0B523 X-CRM114-Status: GOOD ( 11.52 ) X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2a00:1450:400c:c09:0:0:0:233 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: matt@codeblueprint.co.uk, linux@arm.linux.org.uk, will.deacon@arm.com, Ard Biesheuvel MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org Even though initcall return values are typically ignored, the prototype is to return 0 on success or a negative errno value on error. So fix the arm_enable_runtime_services() implementation to return 0 on conditions that are not in fact errors, and return a meaningful error code otherwise. Signed-off-by: Ard Biesheuvel --- arch/arm64/kernel/efi.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) -- 1.9.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel diff --git a/arch/arm64/kernel/efi.c b/arch/arm64/kernel/efi.c index 186b9e119d4a..3aeb576965c0 100644 --- a/arch/arm64/kernel/efi.c +++ b/arch/arm64/kernel/efi.c @@ -285,12 +285,12 @@ static int __init arm64_enable_runtime_services(void) if (!efi_enabled(EFI_BOOT)) { pr_info("EFI services will not be available.\n"); - return -1; + return 0; } if (efi_runtime_disabled()) { pr_info("EFI runtime services will be disabled.\n"); - return -1; + return 0; } pr_info("Remapping and enabling EFI services.\n"); @@ -300,7 +300,7 @@ static int __init arm64_enable_runtime_services(void) mapsize); if (!memmap.map) { pr_err("Failed to remap EFI memory map\n"); - return -1; + return -ENOMEM; } memmap.map_end = memmap.map + mapsize; efi.memmap = &memmap; @@ -309,13 +309,13 @@ static int __init arm64_enable_runtime_services(void) sizeof(efi_system_table_t)); if (!efi.systab) { pr_err("Failed to remap EFI System Table\n"); - return -1; + return -ENOMEM; } set_bit(EFI_SYSTEM_TABLES, &efi.flags); if (!efi_virtmap_init()) { pr_err("No UEFI virtual mapping was installed -- runtime services will not be available\n"); - return -1; + return -ENOMEM; } /* Set up runtime services function pointers */