From patchwork Mon May 4 17:31:07 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 467741 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 9FA4B1402A0 for ; Tue, 5 May 2015 03:33:02 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 68D7C4B8A5; Mon, 4 May 2015 19:32:59 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id VsMfjU6gEpEw; Mon, 4 May 2015 19:32:59 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 0B6FD4B88B; Mon, 4 May 2015 19:32:38 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 7FDAC4B896 for ; Mon, 4 May 2015 19:32:28 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 18SJAdle4nLw for ; Mon, 4 May 2015 19:32:28 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-oi0-f74.google.com (mail-oi0-f74.google.com [209.85.218.74]) by theia.denx.de (Postfix) with ESMTPS id 070344B892 for ; Mon, 4 May 2015 19:32:25 +0200 (CEST) Received: by oiax69 with SMTP id x69so10265441oia.1 for ; Mon, 04 May 2015 10:32:24 -0700 (PDT) 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=E96IYVnlD0Q6vDYjEshacXeRJq8YwJOr0Dop3YxbqW4=; b=VUT2Tc6SrsTaEd+/1QNMuQx7OZLmLuL5EyFAAOYtXdNXkZoyHjgQ4NSOSZvZqqpVKF 3XhyAzWY369U1N8GKMKoFypxqyTmPk5obp1MOC8Mk+3P+X+reJJ82U2166DJs6J2VQk8 oTP0qoivFIimsatKzq5tpU6KtoEj6W/+S7aSCrw8kZw7T3tXXJIiuIZ7NlGhlegH+sA5 rVmqSgbmSOm/xGA92P2OXmbQP//iHdqwSdl5bgTmvi+26AvNQv4L4lE3Q47zIz0uofl0 o2DCPUB/hPaABjeBLr9qhlphlH/vfbVem9MutpkEUVCf/4KXtF0p4V9ws45drKMCZu7h WFYA== X-Gm-Message-State: ALoCoQmES3+7ZZFwABsOSIIR8w9WdqrwxWNrTN1vCvaNwliZyg0EjuoI+p8PKf4l+FBkWmcl1/CD X-Received: by 10.43.178.201 with SMTP id ox9mr47964598icc.12.1430760744613; Mon, 04 May 2015 10:32:24 -0700 (PDT) Received: from corpmail-nozzle1-2.hot.corp.google.com ([100.108.1.103]) by gmr-mx.google.com with ESMTPS id v23si727339yhv.4.2015.05.04.10.32.24 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 04 May 2015 10:32:24 -0700 (PDT) Received: from kaki.bld.corp.google.com ([172.29.216.32]) by corpmail-nozzle1-2.hot.corp.google.com with ESMTP id K9kGGler.1; Mon, 04 May 2015 10:32:24 -0700 Received: by kaki.bld.corp.google.com (Postfix, from userid 121222) id E8856220F4F; Mon, 4 May 2015 11:32:23 -0600 (MDT) From: Simon Glass To: U-Boot Mailing List Date: Mon, 4 May 2015 11:31:07 -0600 Message-Id: <1430760687-28505-15-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 2.2.0.rc0.207.ga3a616c In-Reply-To: <1430760687-28505-2-git-send-email-sjg@chromium.org> References: <1430760687-28505-2-git-send-email-sjg@chromium.org> Cc: Joe Hershberger , Tom Rini Subject: [U-Boot] [PATCH 14/24] sandbox: Correct error handling in state_read_file() X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" This function should return a useful error for U-Boot, rather than -1. Signed-off-by: Simon Glass Reviewed-by: Joe Hershberger --- arch/sandbox/cpu/state.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/sandbox/cpu/state.c b/arch/sandbox/cpu/state.c index 033958c..cae731c 100644 --- a/arch/sandbox/cpu/state.c +++ b/arch/sandbox/cpu/state.c @@ -51,7 +51,7 @@ static int state_read_file(struct sandbox_state *state, const char *fname) ret = os_get_filesize(fname, &size); if (ret < 0) { printf("Cannot find sandbox state file '%s'\n", fname); - return ret; + return -ENOENT; } state->state_fdt = os_malloc(size); if (!state->state_fdt) {