From patchwork Sun Aug 18 17:27:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 34162 Received: (qmail 77435 invoked by alias); 18 Aug 2019 17:27:45 -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 77325 invoked by uid 89); 18 Aug 2019 17:27:41 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-19.6 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.1 spammy=args X-HELO: gateway24.websitewelcome.com Received: from gateway24.websitewelcome.com (HELO gateway24.websitewelcome.com) (192.185.50.252) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 18 Aug 2019 17:27:39 +0000 Received: from cm12.websitewelcome.com (cm12.websitewelcome.com [100.42.49.8]) by gateway24.websitewelcome.com (Postfix) with ESMTP id 2881B3257 for ; Sun, 18 Aug 2019 12:27:38 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id zOxuhly79iQerzOxuh7JEN; Sun, 18 Aug 2019 12:27:38 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=/K/1tEdpfuPPk06FkJ+9qSMoILaMmlz3aiPvPPf+RPw=; b=wSQw8wGbf2BU7jL1h/N1YIhQ8K LLH9xP3WOs1ua/BDvqPKO3ooPLYNakly+QGCDtuv+x88EPWLe5wkBedXhrQQ192vmU26D+sskX4jL 8wc0LZqNuw2MVJDEOVXuILyc5; Received: from 97-122-178-82.hlrn.qwest.net ([97.122.178.82]:44512 helo=bapiya.Home) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from ) id 1hzOxt-002aYY-Ty; Sun, 18 Aug 2019 12:27:38 -0500 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 02/14] Remove NULL check from tui_reg_command Date: Sun, 18 Aug 2019 11:27:23 -0600 Message-Id: <20190818172735.17477-3-tom@tromey.com> In-Reply-To: <20190818172735.17477-1-tom@tromey.com> References: <20190818172735.17477-1-tom@tromey.com> tui_reg_command has an unnecessary NULL check. The preceding call to tui_reg_layout will ensure the window exists. This patch removes the check. gdb/ChangeLog 2019-08-18 Tom Tromey * tui/tui-regs.c (tui_reg_command): Remove NULL check. --- gdb/ChangeLog | 4 ++++ gdb/tui/tui-regs.c | 4 +--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/gdb/tui/tui-regs.c b/gdb/tui/tui-regs.c index 8fcb7bc46bc..b3c7ce627b4 100644 --- a/gdb/tui/tui-regs.c +++ b/gdb/tui/tui-regs.c @@ -669,9 +669,7 @@ tui_reg_command (const char *args, int from_tty) if (TUI_DATA_WIN == NULL || !TUI_DATA_WIN->is_visible ()) tui_reg_layout (); - struct reggroup *current_group = NULL; - if (TUI_DATA_WIN != NULL) - current_group = TUI_DATA_WIN->current_group; + struct reggroup *current_group = TUI_DATA_WIN->current_group; if (strncmp (args, "next", len) == 0) match = tui_reg_next (current_group, gdbarch); else if (strncmp (args, "prev", len) == 0)