From patchwork Fri Mar 6 12:07:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Liu, Jingqi" X-Patchwork-Id: 11423733 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 99D1A14E3 for ; Fri, 6 Mar 2020 12:14:22 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3957A2072D for ; Fri, 6 Mar 2020 12:14:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3957A2072D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:35782 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jABrw-0003fG-Tk for patchwork-qemu-devel@patchwork.kernel.org; Fri, 06 Mar 2020 07:14:20 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:38384) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jABq0-0000gY-Cp for qemu-devel@nongnu.org; Fri, 06 Mar 2020 07:12:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jABpy-0001go-PL for qemu-devel@nongnu.org; Fri, 06 Mar 2020 07:12:19 -0500 Received: from mga14.intel.com ([192.55.52.115]:37225) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jABpy-0001eN-HB for qemu-devel@nongnu.org; Fri, 06 Mar 2020 07:12:18 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Mar 2020 04:12:14 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,522,1574150400"; d="scan'208";a="275519233" Received: from dazhang1-mobile.sh.intel.com ([10.239.48.70]) by fmsmga002.fm.intel.com with ESMTP; 06 Mar 2020 04:12:12 -0800 From: Jingqi Liu To: jtomko@redhat.com, peter.maydell@linaro.org, mst@redhat.com, ehabkost@redhat.com Subject: [PATCH] util: fix to check if target OS is linux in util/mmap-alloc.c Date: Fri, 6 Mar 2020 20:07:35 +0800 Message-Id: <20200306120735.24457-1-jingqi.liu@intel.com> X-Mailer: git-send-email 2.17.1 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 192.55.52.115 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jingqi Liu , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" The CONFIG_LINUX symbol is always undefined before including "qemu/osdep.h". Use __linux__ to check if target OS is linux instead of CONFIG_LINUX. Signed-off-by: Jingqi Liu --- util/mmap-alloc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/util/mmap-alloc.c b/util/mmap-alloc.c index 27dcccd8ec..8340540292 100644 --- a/util/mmap-alloc.c +++ b/util/mmap-alloc.c @@ -10,12 +10,12 @@ * later. See the COPYING file in the top-level directory. */ -#ifdef CONFIG_LINUX +#ifdef __linux__ #include -#else /* !CONFIG_LINUX */ +#else #define MAP_SYNC 0x0 #define MAP_SHARED_VALIDATE 0x0 -#endif /* CONFIG_LINUX */ +#endif #include "qemu/osdep.h" #include "qemu/mmap-alloc.h"