From patchwork Fri Aug 21 08:17:04 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 52609 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f70.google.com (mail-la0-f70.google.com [209.85.215.70]) by patches.linaro.org (Postfix) with ESMTPS id 7A0B022B05 for ; Fri, 21 Aug 2015 08:21:20 +0000 (UTC) Received: by lagz9 with SMTP id z9sf19316491lag.3 for ; Fri, 21 Aug 2015 01:21:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:mime-version:cc:subject:precedence:list-id :list-unsubscribe:list-post:list-help:list-subscribe:content-type :content-transfer-encoding:sender:errors-to:x-original-sender :x-original-authentication-results:mailing-list:list-archive; bh=0e+v4KP9S48Es+o4RAlvqeKfXuoYuAOXgZhfnxNAYPQ=; b=OA6BjBh9pAGGqL20i4xU0ouDc1nQwVdmg99oklCZHxM6fHnc1vlxa65VpGTJQIgOMV 7rA1dL9jLo3u96hdk7IYaTi9OrqfIAHErkwBudtKW/0UKbrfUOpAkM2UxQ+bv4F0bgIL oFsEhZcYBtKqRyVAUO1guiA7CFTyrvwugDUcgAKzXKEMusVYVhFVxkA4aFe7Y5EXjLPa 5HrltxMC4P9ciS5e1i0Wg88kgCtfWx/eA6N+/E5tvdefFRIp7JpXqYFfoCfZUFtj7ISC wUshUrZYkcut883axj6JbZXjj4UGSB49BJk0VtfI26aX0HZIPNss3hhfTbBgKXmYtO8l VxCw== X-Gm-Message-State: ALoCoQkBiw3btDgnnMY0hSeKQEVeZP1B7rwAyLHghP4jb1uGid2QvwFU3GI9D43OvYiEG8agjwfz X-Received: by 10.152.4.69 with SMTP id i5mr2018575lai.10.1440145279527; Fri, 21 Aug 2015 01:21:19 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.28.226 with SMTP id e2ls251777lah.14.gmail; Fri, 21 Aug 2015 01:21:19 -0700 (PDT) X-Received: by 10.152.18.164 with SMTP id x4mr2031309lad.35.1440145279408; Fri, 21 Aug 2015 01:21:19 -0700 (PDT) Received: from mail-lb0-f180.google.com (mail-lb0-f180.google.com. [209.85.217.180]) by mx.google.com with ESMTPS id u2si531198lal.165.2015.08.21.01.21.19 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 21 Aug 2015 01:21:19 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.180 as permitted sender) client-ip=209.85.217.180; Received: by lbbtg9 with SMTP id tg9so39206990lbb.1 for ; Fri, 21 Aug 2015 01:21:19 -0700 (PDT) X-Received: by 10.152.28.193 with SMTP id d1mr6748968lah.72.1440145279325; Fri, 21 Aug 2015 01:21:19 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.162.200 with SMTP id yc8csp503837lbb; Fri, 21 Aug 2015 01:21:18 -0700 (PDT) X-Received: by 10.55.26.218 with SMTP id l87mr12155579qkh.23.1440145273518; Fri, 21 Aug 2015 01:21:13 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id g138si11631614qhc.66.2015.08.21.01.21.12 (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 21 Aug 2015 01:21:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of xen-devel-bounces@lists.xen.org designates 50.57.142.19 as permitted sender) client-ip=50.57.142.19; Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1ZShXs-0005GN-Eb; Fri, 21 Aug 2015 08:19:28 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1ZShXr-0005GI-7D for xen-devel@lists.xen.org; Fri, 21 Aug 2015 08:19:27 +0000 Received: from [193.109.254.147] by server-5.bemta-14.messagelabs.com id 5F/0A-00475-E0FD6D55; Fri, 21 Aug 2015 08:19:26 +0000 X-Env-Sender: zhaoshenglong@huawei.com X-Msg-Ref: server-8.tower-27.messagelabs.com!1440145135!42742445!1 X-Originating-IP: [119.145.14.65] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogMTE5LjE0NS4xNC42NSA9PiA3NzQ2Mw==\n X-StarScan-Received: X-StarScan-Version: 6.13.16; banners=-,-,- X-VirusChecked: Checked Received: (qmail 26817 invoked from network); 21 Aug 2015 08:19:24 -0000 Received: from szxga02-in.huawei.com (HELO szxga02-in.huawei.com) (119.145.14.65) by server-8.tower-27.messagelabs.com with RC4-SHA encrypted SMTP; 21 Aug 2015 08:19:24 -0000 Received: from 172.24.1.50 (EHLO szxeml431-hub.china.huawei.com) ([172.24.1.50]) by szxrg02-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id CQZ81183; Fri, 21 Aug 2015 16:17:41 +0800 (CST) Received: from HGHY1Z002260041.china.huawei.com (10.177.16.142) by szxeml431-hub.china.huawei.com (10.82.67.208) with Microsoft SMTP Server id 14.3.235.1; Fri, 21 Aug 2015 16:17:34 +0800 From: Shannon Zhao To: , Date: Fri, 21 Aug 2015 16:17:04 +0800 Message-ID: <1440145024-10516-4-git-send-email-zhaoshenglong@huawei.com> X-Mailer: git-send-email 1.9.0.msysgit.0 In-Reply-To: <1440145024-10516-1-git-send-email-zhaoshenglong@huawei.com> References: <1440145024-10516-1-git-send-email-zhaoshenglong@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.177.16.142] X-CFilter-Loop: Reflected Cc: "Rafael J. Wysocki" , shannon.zhao@linaro.org, Hanjun Guo , zhaoshenglong@huawei.com Subject: [Xen-devel] [PATCH v3 3/3] ACPI / table: Replace '1' with specific error return values X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Post: , List-Help: , List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: patch@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.180 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Archive: From: Hanjun Guo After commit 7f8f97c3cc (ACPI: acpi_table_parse() now returns success/fail, not count), acpi_table_parse() returns '1' when it is unable to find the table, but it should return a negative error code in that case. Make it return -ENODEV instead. Fix the same problem in acpi_table_init() analogously. Signed-off-by: Hanjun Guo [rjw: Subject and changelog] Signed-off-by: Rafael J. Wysocki [Linux commit 95df812dbdc350bfcf31e247e9100c378a472480] Signed-off-by: Shannon Zhao --- xen/drivers/acpi/tables.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xen/drivers/acpi/tables.c b/xen/drivers/acpi/tables.c index 6085fda..60c4ab1 100644 --- a/xen/drivers/acpi/tables.c +++ b/xen/drivers/acpi/tables.c @@ -290,7 +290,7 @@ int __init acpi_table_parse(char *id, acpi_table_handler handler) if (table) { return handler(table); } else - return 1; + return -ENODEV; } /* @@ -333,7 +333,7 @@ int __init acpi_table_init(void) status = acpi_initialize_tables(NULL, ACPI_MAX_TABLES, 0); if (ACPI_FAILURE(status)) - return 1; + return -EINVAL; check_multiple_madt(); return 0;