From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 0782E385840B for ; Tue, 23 Nov 2021 14:08:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0782E385840B Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-414-8y-otgJGPVOVJ9_EMjKXIg-1; Tue, 23 Nov 2021 09:08:34 -0500 X-MC-Unique: 8y-otgJGPVOVJ9_EMjKXIg-1 Received: by mail-wr1-f69.google.com with SMTP id o4-20020adfca04000000b0018f07ad171aso3707378wrh.20 for ; Tue, 23 Nov 2021 06:08:34 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=IFW297rWhhCbZlJZJAVv5bidk9DoTV/9SpoG1gLpBzw=; b=eB7QtJICeXJ3MYBpP0HTdDkSXb2jcRucFSF+sYwE/u5B8Kc7aRuGv7f+Z+XgtTZsq1 jorKir9xX6ITW9bxvydO7hgHS1DCp45lVVOwgtgqkZYm/maxDArs++O0hSIuXkODn+uY 4Kj11JEDaHSo9ty8XQHyeHYtNwS+wxNcJeE2Wqonh69H0m/+qtqv1XXdBre7WhFtVxQl 8CxRY8qyrs4TKuDsUvDf+xfY7+0+1I22WnJ63EhUcRnOFO6ooSMif10y0kr4KvPVV+Lv +6Xc+dGYb+qQG0FA3XyUaUs4sQLEWwcelWeDC+I37I8Ne17gLA2hnr/KQf55ucmGExVz iRXA== X-Gm-Message-State: AOAM533bM67WUfUWiaEpISqqsVnVFrW/XJA+gMnZwh3K35on3rQH+Wp3 0ibq6pEvvx4/jlVSuXdDW0xJeIAYqEOMG+PFQktRD9PZ/BHekz+KKdciB5Ri8suoMGCGnlNTSAA jZBXYq0dE2IVYB+m4TEF9eC8D8s5CFEuH2iw2k42dBY8N0bwvEGujcz61RMP1EIrUwJ8y84w1wQ == X-Received: by 2002:adf:8008:: with SMTP id 8mr7485423wrk.188.1637676512975; Tue, 23 Nov 2021 06:08:32 -0800 (PST) X-Google-Smtp-Source: ABdhPJy1RsXZ5U+eTyn/oqh4+eSTL8ZRbfGFpAFvmwpXG56e5YV/06bAt7Bbk96Plw/8VbWNwVEkBw== X-Received: by 2002:adf:8008:: with SMTP id 8mr7485392wrk.188.1637676512724; Tue, 23 Nov 2021 06:08:32 -0800 (PST) Received: from localhost (host86-166-129-255.range86-166.btcentralplus.com. [86.166.129.255]) by smtp.gmail.com with ESMTPSA id f7sm14577289wri.74.2021.11.23.06.08.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Nov 2021 06:08:32 -0800 (PST) From: Andrew Burgess To: gdb-patches@sourceware.org Cc: Andrew Burgess Subject: [PATCH 2/4] gdb/remote: merge ::is_async_p and ::can_async_p methods Date: Tue, 23 Nov 2021 14:08:21 +0000 Message-Id: <9c8428eee795182bb60ed37752e48db404ea9307.1637676250.git.aburgess@redhat.com> X-Mailer: git-send-email 2.25.4 In-Reply-To: References: MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" X-Spam-Status: No, score=-10.8 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Nov 2021 14:08:38 -0000 I spotted in passing that remote_target::is_async_p and remote_target::can_async_p are identical. This commit just makes ::is_async_p call ::can_async_p, removing some duplicate code. There should be no user visible changes after this commit. --- gdb/remote.c | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/gdb/remote.c b/gdb/remote.c index 61bde5aaa94..0c4cc6bad0b 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -546,7 +546,10 @@ class remote_target : public process_stratum_target bool can_async_p () override; - bool is_async_p () override; + bool is_async_p () override + { + return can_async_p (); + } void async (int) override; @@ -14390,19 +14393,6 @@ remote_target::can_async_p () return serial_can_async_p (rs->remote_desc); } -bool -remote_target::is_async_p () -{ - struct remote_state *rs = get_remote_state (); - - if (!target_async_permitted) - /* We only enable async when the user specifically asks for it. */ - return false; - - /* We're async whenever the serial device is. */ - return serial_is_async_p (rs->remote_desc); -} - /* Pass the SERIAL event on and up to the client. One day this code will be able to delay notifying the client of an event until the point where an entire packet has been received. */ -- 2.25.4