From patchwork Tue Jul 28 09:59:52 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yao Qi X-Patchwork-Id: 7891 Received: (qmail 77510 invoked by alias); 28 Jul 2015 10:00:12 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 77439 invoked by uid 89); 28 Jul 2015 10:00:11 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-pa0-f48.google.com Received: from mail-pa0-f48.google.com (HELO mail-pa0-f48.google.com) (209.85.220.48) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Tue, 28 Jul 2015 10:00:09 +0000 Received: by pacan13 with SMTP id an13so68811320pac.1 for ; Tue, 28 Jul 2015 03:00:07 -0700 (PDT) X-Received: by 10.67.8.40 with SMTP id dh8mr77632769pad.129.1438077607159; Tue, 28 Jul 2015 03:00:07 -0700 (PDT) Received: from E107787-LIN.cambridge.arm.com (gcc1-power7.osuosl.org. [140.211.15.137]) by smtp.gmail.com with ESMTPSA id fc3sm34350634pab.16.2015.07.28.03.00.05 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 28 Jul 2015 03:00:06 -0700 (PDT) From: Yao Qi X-Google-Original-From: Yao Qi To: gdb-patches@sourceware.org Subject: [PATCH 4/4] Remove global variable arm_hwcap Date: Tue, 28 Jul 2015 10:59:52 +0100 Message-Id: <1438077592-15356-5-git-send-email-yao.qi@linaro.org> In-Reply-To: <1438077592-15356-1-git-send-email-yao.qi@linaro.org> References: <1438077592-15356-1-git-send-email-yao.qi@linaro.org> X-IsSubscribed: yes After previous patch, we don't need global variable arm_hwcap. This patch is to remove it. gdb/gdbserver: 2015-07-28 Yao Qi * linux-arm-low.c (arm_hwcap): Remove it. (arm_read_description): New local variable arm_hwcap. Don't set arm_hwcap to zero. --- gdb/gdbserver/linux-arm-low.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/gdb/gdbserver/linux-arm-low.c b/gdb/gdbserver/linux-arm-low.c index 02a1c08..3c5956b 100644 --- a/gdb/gdbserver/linux-arm-low.c +++ b/gdb/gdbserver/linux-arm-low.c @@ -117,8 +117,6 @@ struct arch_lwp_info CORE_ADDR stopped_data_address; }; -static unsigned long arm_hwcap; - /* These are in in current kernels. */ #define HWCAP_VFP 64 #define HWCAP_IWMMXT 512 @@ -844,11 +842,11 @@ static const struct target_desc * arm_read_description (void) { int pid = lwpid_of (current_thread); + unsigned long arm_hwcap = 0; /* Query hardware watchpoint/breakpoint capabilities. */ arm_linux_init_hwbp_cap (pid); - arm_hwcap = 0; if (arm_get_hwcap (&arm_hwcap) == 0) return tdesc_arm; @@ -875,10 +873,8 @@ arm_read_description (void) buf = xmalloc (32 * 8 + 4); if (ptrace (PTRACE_GETVFPREGS, pid, 0, buf) < 0 && errno == EIO) - { - arm_hwcap = 0; - result = tdesc_arm; - } + result = tdesc_arm; + free (buf); return result;