From patchwork Fri Oct 31 18:30:21 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 39975 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f197.google.com (mail-wi0-f197.google.com [209.85.212.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 39E2E202FE for ; Fri, 31 Oct 2014 19:55:12 +0000 (UTC) Received: by mail-wi0-f197.google.com with SMTP id ex7sf1030217wid.4 for ; Fri, 31 Oct 2014 12:55:11 -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:mime-version:in-reply-to:references :from:date:message-id:to:cc:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list:content-type; bh=0dWSmD16br/MVq3WhXLXZ0TlrWCyzN1vCbkk91iNcRc=; b=FpXZwSW9kM9ipJXrNmqvsWZw44jkeNEOPp6dsSNe/XAeMvjb80LYq6jj4mIM9MAgbV 4siU8pqWni1kSyUgGf5DHC2w6RoDrecz9zp3hiI79vY0GCuqKdukE1D4uLMb9PMKjcOa /wsdLvnwAcHWugiXesZE85V4Kc4kUqIQ3cj/lLBXA+7e8/dhqc9NKzQ0KJzdjgo+Oml6 zNE7Ql6viwpMaw2gNzTtjiYAhm++OF5UcB3TtobsoClE2Cq/5njYhhhk58oxDNrryGD/ XTvr1/sQT5xXyzHGjVZrhnuOF4oeOLqCHviUbF0AV0QkJqXabeWx6kpiqX5JKhxjir+o NWLA== X-Gm-Message-State: ALoCoQms6mmlrMrnG0FgtIRJZS/PAR6ZM3/bCk+dRqwbQDVMTDJ/aalHFGQGJWAebhxskL0gA9Co X-Received: by 10.180.219.40 with SMTP id pl8mr399649wic.3.1414785311289; Fri, 31 Oct 2014 12:55:11 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.9.66 with SMTP id x2ls506302laa.63.gmail; Fri, 31 Oct 2014 12:55:11 -0700 (PDT) X-Received: by 10.112.73.103 with SMTP id k7mr28951837lbv.41.1414785311001; Fri, 31 Oct 2014 12:55:11 -0700 (PDT) Received: from mail-la0-f45.google.com (mail-la0-f45.google.com. [209.85.215.45]) by mx.google.com with ESMTPS id g2si18500181laf.43.2014.10.31.12.55.10 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 31 Oct 2014 12:55:10 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.45 as permitted sender) client-ip=209.85.215.45; Received: by mail-la0-f45.google.com with SMTP id pn19so1461493lab.18 for ; Fri, 31 Oct 2014 12:55:10 -0700 (PDT) X-Received: by 10.152.5.38 with SMTP id p6mr28627556lap.44.1414785310731; Fri, 31 Oct 2014 12:55:10 -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.84.229 with SMTP id c5csp253112lbz; Fri, 31 Oct 2014 12:55:09 -0700 (PDT) X-Received: by 10.224.88.134 with SMTP id a6mr40202478qam.28.1414785309135; Fri, 31 Oct 2014 12:55:09 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id u3si14667450qat.92.2014.10.31.12.55.08 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 31 Oct 2014 12:55:09 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Received: from localhost ([::1]:42202 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XkIHs-0002IY-08 for patch@linaro.org; Fri, 31 Oct 2014 15:55:08 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40550) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XkGyJ-0002Oz-NB for qemu-devel@nongnu.org; Fri, 31 Oct 2014 14:30:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XkGyD-0006f1-HD for qemu-devel@nongnu.org; Fri, 31 Oct 2014 14:30:51 -0400 Received: from mail-lb0-f177.google.com ([209.85.217.177]:49284) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XkGyD-0006eh-Ay for qemu-devel@nongnu.org; Fri, 31 Oct 2014 14:30:45 -0400 Received: by mail-lb0-f177.google.com with SMTP id 10so6550423lbg.36 for ; Fri, 31 Oct 2014 11:30:42 -0700 (PDT) X-Received: by 10.112.42.198 with SMTP id q6mr28241897lbl.69.1414780241962; Fri, 31 Oct 2014 11:30:41 -0700 (PDT) MIME-Version: 1.0 Received: by 10.112.173.168 with HTTP; Fri, 31 Oct 2014 11:30:21 -0700 (PDT) In-Reply-To: <1414731561-13391-1-git-send-email-syeon.hwang@samsung.com> References: <1414731561-13391-1-git-send-email-syeon.hwang@samsung.com> From: Peter Maydell Date: Fri, 31 Oct 2014 18:30:21 +0000 Message-ID: To: SeokYeon Hwang X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.217.177 Cc: QEMU Developers Subject: Re: [Qemu-devel] [PATCH] translate-all: wrapped map_exec() in #ifdef X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: peter.maydell@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.215.45 as permitted sender) smtp.mail=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 On 31 October 2014 04:59, SeokYeon Hwang wrote: > Moved map_exec() and wrapped it in #ifdef to avoid "-Wunused-function" on clang 3.4 or later. > > Signed-off-by: SeokYeon Hwang I had this kind of on my todo list too, but I didn't much like the nested ifdefs which are really only because of what the different implementations of alloc_code_gen_buffer() happen to do. I think it would be more robust to just mark the functions with the 'unused' attribute instead of relying on 'inline' to implicitly do this for us: thanks -- PMM --- a/translate-all.c +++ b/translate-all.c @@ -270,14 +270,14 @@ bool cpu_restore_state(CPUState *cpu, uintptr_t retaddr) } #ifdef _WIN32 -static inline void map_exec(void *addr, long size) +static __attribute__((unused)) void map_exec(void *addr, long size) { DWORD old_protect; VirtualProtect(addr, size, PAGE_EXECUTE_READWRITE, &old_protect); } #else -static inline void map_exec(void *addr, long size) +static __attribute__((unused)) void map_exec(void *addr, long size) { unsigned long start, end, page_size;