From patchwork Fri May 24 16:01:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jon Doron X-Patchwork-Id: 1105011 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="nC73GDvj"; 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 459WXp350pz9s3l for ; Sat, 25 May 2019 02:09:46 +1000 (AEST) Received: from localhost ([127.0.0.1]:56972 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hUClM-0001YX-Ag for incoming@patchwork.ozlabs.org; Fri, 24 May 2019 12:09:44 -0400 Received: from eggs.gnu.org ([209.51.188.92]:37303) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hUCds-0004I5-2M for qemu-devel@nongnu.org; Fri, 24 May 2019 12:02:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hUCdp-0002Hl-VV for qemu-devel@nongnu.org; Fri, 24 May 2019 12:01:59 -0400 Received: from mail-wm1-x342.google.com ([2a00:1450:4864:20::342]:36845) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hUCdp-0002Fo-Ot for qemu-devel@nongnu.org; Fri, 24 May 2019 12:01:57 -0400 Received: by mail-wm1-x342.google.com with SMTP id v22so2500094wml.1 for ; Fri, 24 May 2019 09:01:56 -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=YsLm+sh0ogQXpVuCi/Ts5K2BgX2LI/eiSGa1dNH+IPU=; b=nC73GDvjYDlRaR0hPVh2e/sAokG6TJY1lqZ67XpZXRRhxxaDGhID0oyUOutf+VQ0M8 T31ahb4SgWyT8Sp4F/0Ga3IDk5zceN04WnijWgL2Y2/uaaeVGARPLrQ1/2sR2tbEgtI/ Ehkx8KnvLZoxR7tu4ormojWMmzLqP/Hr8I6jI0deYPVZX0szhR/5QsPbukzE7S+xTwoE QlOz32sN5Sd200vncREP7N4kHLTlRMVkol8FEclZz96c4GA7GJ5idDHi9EIjzO2tjrxu g7ioNZRhajpY/86Xj4V6I3mDqhCmVDS+uhe8x++PmuTqhOvpELxoa9LMKQXRyr3nknik 0qbA== 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=YsLm+sh0ogQXpVuCi/Ts5K2BgX2LI/eiSGa1dNH+IPU=; b=N3d2i4KN/eZOCd1Tmyq6P7OEpB/VDI14fjXCJ8htbF/Hu5HwuSWqB8kKZxwZb03VP7 V3/ZTxl5LQeqP8MyMa30fwS8i0Qe5MqVwlX92/AKE/WCM8YZ+DIfjwNkPWfxVbacZ3eG K0Ya/snh8peLEk15xuvlMwF8lS8rYd+CYZWhyfOnajsREu1g/Swe/XDWrYZb9bVCoTNi p6cvgX/RhSVrl9KO9BFPG6YFQlqz7kjmdvBYuxZe2+s8ElKrhHVsDbbo0uUxRLEz1QY+ 10/K65cTlWV4BEgkfkx23s3r9Up+AWVqGlhX42Jc7Fb/+d2xu8Y90V26obgLfjzZhY6j ngSg== X-Gm-Message-State: APjAAAU72U3PcwL6jSRg4JEru7pP9s7sTXPYXmOZ9MOnz6k79aiJpd6b 0Oshjym7QKuDXaLZs1AmyAUqxs1E X-Google-Smtp-Source: APXvYqznP2rkEGcL/CofW7922FeYWEaDJbBYEwYXkUCQMhn1og3untgjuwWMA7NtAFZeN0zMPJlriQ== X-Received: by 2002:a1c:1bc4:: with SMTP id b187mr389463wmb.155.1558713714647; Fri, 24 May 2019 09:01:54 -0700 (PDT) Received: from jondnuc.lan ([176.230.64.37]) by smtp.gmail.com with ESMTPSA id s11sm370863wro.17.2019.05.24.09.01.53 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 24 May 2019 09:01:54 -0700 (PDT) From: Jon Doron To: qemu-devel@nongnu.org Date: Fri, 24 May 2019 19:01:17 +0300 Message-Id: <20190524160118.31134-20-arilou@gmail.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190524160118.31134-1-arilou@gmail.com> References: <20190524160118.31134-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 v11 19/20] 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 097b7d1231..9dd934a079 100644 --- a/gdbstub.c +++ b/gdbstub.c @@ -2270,17 +2270,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; @@ -2497,8 +2491,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; }