From patchwork Thu May 2 08:15:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jon Doron X-Patchwork-Id: 1094081 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="Ocjw+b60"; 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 44vpVh3Yd7z9s3Z for ; Thu, 2 May 2019 18:35:24 +1000 (AEST) Received: from localhost ([127.0.0.1]:47450 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hM7Ba-0003Cd-FP for incoming@patchwork.ozlabs.org; Thu, 02 May 2019 04:35:22 -0400 Received: from eggs.gnu.org ([209.51.188.92]:42965) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hM6tk-0003bX-7j for qemu-devel@nongnu.org; Thu, 02 May 2019 04:16:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hM6th-0008OW-Ce for qemu-devel@nongnu.org; Thu, 02 May 2019 04:16:55 -0400 Received: from mail-wm1-x342.google.com ([2a00:1450:4864:20::342]:50256) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hM6th-0007k4-1V for qemu-devel@nongnu.org; Thu, 02 May 2019 04:16:53 -0400 Received: by mail-wm1-x342.google.com with SMTP id p21so1486781wmc.0 for ; Thu, 02 May 2019 01:16:41 -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=Ocjw+b600EID3SmwmdlKFoILn6PyqIdLOu17mVLYrTPfq6e7z77r8FpScYh0F5vNpA 9NLH55MR3terbSYIQbynHQaGzCBT9nseDqeI8D7mzKYLnUDja8RqJCTxwKY66chdB0T6 9fZAxxK8YSJLxWmdD7S4+kNVyN6F9A2j5rfQNV/Yv+4sM02SpgulaHRRprHUMaiJqDnH FnrGAVM3QeHBg9VN4cSV8yTbW6hkvw+CktbPsJQDbV+FMl5z4RSSssvx6nw/6dloR/B7 UlGaqDTc3Q5P5OjxLNS1g8P/NES1AKgNn8RxvIjtvloKI382szoZFp7NyZ3nE53vW0/t RW7w== 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=OeRkGd8pRQtt0rjg1m6v8uAkJSlNXQ//VFaM5GDHoU+Y3X1lTcO987uVtQWHusWMrW QGih18oNTDK1kq2FBVr73w226HtLouN07FBziwppIEJsmg5VuFclE9DXC1ZylYvBHYSN MSyG8B1UptdO+feCB1gO7+RKQEe+N+XUk/YI67z4my0q3+1+kmVuOE374as4K6tOFF8l S4v65gTAhJBUn2xcnRWAJFKF5JoUf9zea1OKR3QJ16MvUwMYWhrtuHTAKIy+5FRUKAfE TP8MB09nqDmoOyodhB6e/zCInFAvXecZhq6przKkwSIH4Nt4zcqZrV9QL5vCMAxPtD0S cuIw== X-Gm-Message-State: APjAAAVzCd/SX1lCoI+gBUucxvQWkimHEGZD67whDLGGWXEPPnkvI9+w /c3Jg/Da/pxqM3RA/qPy2m9ynqGO X-Google-Smtp-Source: APXvYqwSNcbUr8dZAwuoXmAaQY+UGrayJvVJ264Bbn9tw26Vwq59Ur7Iz6w87iEicoufUevluyK6yw== X-Received: by 2002:a1c:4302:: with SMTP id q2mr1374998wma.28.1556785000126; Thu, 02 May 2019 01:16:40 -0700 (PDT) Received: from localhost.localdomain ([176.230.64.186]) by smtp.gmail.com with ESMTPSA id d16sm44698367wra.54.2019.05.02.01.16.38 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 02 May 2019 01:16:39 -0700 (PDT) From: Jon Doron To: qemu-devel@nongnu.org Date: Thu, 2 May 2019 11:15:48 +0300 Message-Id: <20190502081554.5521-22-arilou@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190502081554.5521-1-arilou@gmail.com> References: <20190502081554.5521-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::342 Subject: [Qemu-devel] [PATCH v9 21/27] 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 Reviewed-by: Alex Bennée --- 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; }