From patchwork Fri Apr 26 04:35:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jon Doron X-Patchwork-Id: 1091262 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="L8SqferM"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44r1qL1zWLz9s47 for ; Fri, 26 Apr 2019 14:51:42 +1000 (AEST) Received: from localhost ([127.0.0.1]:39150 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hJspo-0003P9-3x for incoming@patchwork.ozlabs.org; Fri, 26 Apr 2019 00:51:40 -0400 Received: from eggs.gnu.org ([209.51.188.92]:45320) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hJsmP-0000dG-OG for qemu-devel@nongnu.org; Fri, 26 Apr 2019 00:48:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hJsbY-00053Z-3D for qemu-devel@nongnu.org; Fri, 26 Apr 2019 00:36:56 -0400 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]:47041) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hJsbX-00052f-SA for qemu-devel@nongnu.org; Fri, 26 Apr 2019 00:36:56 -0400 Received: by mail-wr1-x442.google.com with SMTP id t17so2384999wrw.13 for ; Thu, 25 Apr 2019 21:36:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=PH0hXIwENcqo6TbPIzo2Qw9MFujZWmL0zJ/Tm+4JKGw=; b=L8SqferM1OaybvHivFyxMdAcLXm6Ly9CslZy5z0WQh73gVa9cE/40wyMv4ExL789RK 5WtaSzQrcFMVS2xfj709tWlcG89LAh9qawTg3PvUiwNMwA4skqkApLj5dlFomHB2DJUK vByG2IZ3o1U8Dm/+QYOJTZnDlfXr2TflFmBJ/wO0niQQc9HlbmlqFwrUJ8X3PXmqrmSn qsUottbKJ69i0Oe+AFhp/JyUS9Y/1gJJCNH4CTTWQe4eh3J/yNrPlDsk5VnuAEOLiOXf XGmUuLN912cJCxcW0NdX0cTahspk6SWTTpA/m7ywVndtwNyDnC8WWRjlTX7aBu8iGrpU +uvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=PH0hXIwENcqo6TbPIzo2Qw9MFujZWmL0zJ/Tm+4JKGw=; b=hoCsnMO0jg+/WmxNTNfbV/duExjbtNtQPWWziLS4opGr6af46qtYTUBNIHvQ6btg+D ++QA3IWxOrDrMTsO1ICn4smZ1P3Ht8U0norVFcsP9hmDwRVuZy7xJDagcxYAnTmLX1AL onCpOf6sO3zMLcKQEMDZ4BWMrI19nu8peGIHavdnKnlSTcVCSwrwzeIKEc+INCNjthO5 g0sRM6/4utt5CBtYIiCacWaAe8mTQa6N35KclgLOQUUL9rQF3lrLWggSADREFi+Y5efT 2SvjZLeLoxKnf6QThn5rbWigOnBa85ztN2LE8EvEE3m2RfCxj5wUbk8tz7E1T/hDWQRC mg2A== X-Gm-Message-State: APjAAAWocVvGKQWmEUHo/HC8G9Ay9Nolae/kPaacprSHNC10LrOQv/lk URhDYdIFDNrP1nCG1h2gpWbV4Nry X-Google-Smtp-Source: APXvYqxjlLyO7t3TccronAZXmuQoA/WHnxB5Hhpw7M+Y9dB7HrxfHYlMSI1Vn0Xc8VlASZQAyWOvxA== X-Received: by 2002:adf:c993:: with SMTP id f19mr2810001wrh.246.1556253414370; Thu, 25 Apr 2019 21:36:54 -0700 (PDT) Received: from localhost.localdomain (bzq-79-178-247-46.red.bezeqint.net. [79.178.247.46]) by smtp.gmail.com with ESMTPSA id h5sm3467088wmf.38.2019.04.25.21.36.52 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 25 Apr 2019 21:36:53 -0700 (PDT) From: Jon Doron To: qemu-devel@nongnu.org Date: Fri, 26 Apr 2019 07:35:58 +0300 Message-Id: <20190426043558.6888-22-arilou@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190426043558.6888-1-arilou@gmail.com> References: <20190426043558.6888-1-arilou@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::442 Subject: [Qemu-devel] [PATCH v7 21/21] gdbstub: Clear unused variables in gdb_handle_packet X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alex.bennee@linaro.org, Jon Doron Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Jon Doron --- gdbstub.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/gdbstub.c b/gdbstub.c index d678191705..8bdfae4b29 100644 --- a/gdbstub.c +++ b/gdbstub.c @@ -2259,17 +2259,11 @@ static void handle_target_halt(GdbCmdContext *gdb_ctx, void *user_ctx) static int gdb_handle_packet(GDBState *s, const char *line_buf) { - const char *p; - int ch; - uint8_t mem_buf[MAX_PACKET_LENGTH]; - char buf[sizeof(mem_buf) + 1 /* trailing NUL */]; const GdbCmdParseEntry *cmd_parser = NULL; trace_gdbstub_io_command(line_buf); - p = line_buf; - ch = *p++; - switch(ch) { + switch (line_buf[0]) { case '!': put_packet(s, "OK"); break; @@ -2486,8 +2480,7 @@ static int gdb_handle_packet(GDBState *s, const char *line_buf) break; default: /* put empty packet */ - buf[0] = '\0'; - put_packet(s, buf); + put_packet(s, ""); break; }