From patchwork Mon Oct 17 19:03:01 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lv Zheng X-Patchwork-Id: 9380265 X-Patchwork-Delegate: rjw@sisk.pl Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B4A48608A7 for ; Mon, 17 Oct 2016 19:07:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9B6E228047 for ; Mon, 17 Oct 2016 19:07:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 907F628EB6; Mon, 17 Oct 2016 19:07:00 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 131F228567 for ; Mon, 17 Oct 2016 19:07:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934952AbcJQTD2 (ORCPT ); Mon, 17 Oct 2016 15:03:28 -0400 Received: from mail-qk0-f196.google.com ([209.85.220.196]:35081 "EHLO mail-qk0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933210AbcJQTDQ (ORCPT ); Mon, 17 Oct 2016 15:03:16 -0400 Received: by mail-qk0-f196.google.com with SMTP id v138so14974892qka.2 for ; Mon, 17 Oct 2016 12:03:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=+Ds1Q+iMfqvrOTcKJ31ywg1A/5+uxDQUMZNuF8Sp5E0=; b=C6DCqgkF0Nh2MZQfNohctSbRX3A5XgsBViIX1rwO4akY5OuPsDD/0rJ7gAd0lmrjP5 23NBTMNDVxyLMT0B4BXy5lIPvCpZQc4Gw/DWCUjACBgd85NqvZx1/uWiURYmxGyKRvoD +YBU+oCGchDPRVSPWacy9EJwCtgR3Qv0VPqc98OqwVPhQs1NJrWnKGf5ZOK9jiaKSbsW 6F2XfGrn0nWHE/TO5pqUYwCg1NdiReCFOYF7ImxPWFFsa+PIgbUVR0Gi34D6Gg3tPmC8 Er050s/YC8Pu93+KvaujY/t625vlaiCVlR/2MOXhx5FCZd8drnVsGK2xpEU9tWhONnEj aXXw== 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=+Ds1Q+iMfqvrOTcKJ31ywg1A/5+uxDQUMZNuF8Sp5E0=; b=QDlFnXYznzZG8Fw/PMNpbx14VBGyiapWQtf7kLfJXew4t/AecSjqlkxFuz2FeycEVY 4tMN4H3J9K3Q8LePxr1+oOkv9VicBssAanrlivwf8YVcbunBoJwqTU/lNx27dn2/TPzn l0fMq7QY33QnegPcQO7uwpwh8rbVwncRVlNeSxYF+WF5qbN6QH+Ly/13n1ORO5aMo153 e6ypnvCe2XWtTqjty49CbJrUoi4YsvyQwo6jYNX/wCkYmDDkQtsNBQQa6dsPwXZubQX+ fzUV1+39UPOp3Pj6RtJ0GU2Lsn0ciV+jgHbpj6pEetJQBaqpQ+S05DdouW6DZuKf9Dfi 0Oqg== X-Gm-Message-State: AA6/9RktyU0MYfJ+pBqGKwxQZgVaPLhvO8FPnprsDswv/4S15bto5BlLdKc1t01nX9OYYQ== X-Received: by 10.55.12.210 with SMTP id 201mr24396010qkm.292.1476730995142; Mon, 17 Oct 2016 12:03:15 -0700 (PDT) Received: from localhost.localdomain (h3.246.129.40.static.ip.windstream.net. [40.129.246.3]) by smtp.gmail.com with ESMTPSA id g11sm15834965qtb.19.2016.10.17.12.03.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 17 Oct 2016 12:03:14 -0700 (PDT) From: Lv Zheng X-Google-Original-From: Lv Zheng To: "Rafael J . Wysocki" , "Rafael J . Wysocki" , Robert Moore , Len Brown , Lv Zheng , "David E . Box" Cc: linux-acpi@vger.kernel.org Subject: [PATCH 3/7] ACPICA: MacOSX: Fix wrong sem_destroy definition Date: Tue, 18 Oct 2016 03:03:01 +0800 Message-Id: <064cfde6bf403ab874bfa8b6e5c5f9af384c894d.1476725675.git.lv.zheng@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: References: Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP ACPICA commit bbcb58f7875381d5c7f3d614bad3bc628a3f5cc6 The following build errors can be seen for MacOSX builds: .../osunixxf.c:882:9: error: 'sem_close' is deprecated [-Werror,-Wdeprecated-declarations] .../acmacosx.h:122:29: note: expanded from macro 'sem_destroy' #define sem_destroy sem_close sem_destroy() issue is caused by the wrong order of the following lines: #define #sem_destroy sem_close #include This patch fixes it by removing the buggy re-definitiion. Lv Zheng. Linux is not affected by this change. Link: https://github.com/acpica/acpica/commit/bbcb58f7 Signed-off-by: Lv Zheng Signed-off-by: Bob Moore --- tools/power/acpi/os_specific/service_layers/osunixxf.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tools/power/acpi/os_specific/service_layers/osunixxf.c b/tools/power/acpi/os_specific/service_layers/osunixxf.c index 8f5ded8..10648aa 100644 --- a/tools/power/acpi/os_specific/service_layers/osunixxf.c +++ b/tools/power/acpi/os_specific/service_layers/osunixxf.c @@ -696,10 +696,15 @@ acpi_status acpi_os_delete_semaphore(acpi_handle handle) if (!sem) { return (AE_BAD_PARAMETER); } - +#ifdef __APPLE__ + if (sem_close(sem) == -1) { + return (AE_BAD_PARAMETER); + } +#else if (sem_destroy(sem) == -1) { return (AE_BAD_PARAMETER); } +#endif return (AE_OK); }