From patchwork Fri Feb 3 06:10:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shaoqin Huang X-Patchwork-Id: 13127034 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0B40EC636CC for ; Fri, 3 Feb 2023 06:12:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=1dHsYi1wqJKRcbwbzlujcklygtx273a/YO6QV9x0Nm0=; b=yGEpfvZDXQNRvI K758NGnV1WyhZdxy+TnxVbPuT42yeeLbstXqLRQPbzrGHFTYKmmXCO9ipAj6e7QntgLXIRcHK6Ouu 7m5wTD51m+ST8klL67HwewDXoihm4LAInSGd88AO9i6F0xPkOhbfkQz0hD+0e7Cw5CLYO/1xWhDby Y0AQJ6HeR+eOVba3OuOuOcDhreIcYWz521E5pbjgVmkrM36vLsO2OS7QA3pgS59kTNKy+3SFvYqbe bGQHbX2K07YvWEENWCpGHCM3BsToLdrdOK/fNAZNx7FCqXp/b9k/BOlK+cwVg1sG30LrpPtUxbPA1 fQWrp2BqU5RrOoGVb+MQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pNpHt-000W7Q-9g; Fri, 03 Feb 2023 06:11:05 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pNpHo-000W1s-EQ for linux-arm-kernel@lists.infradead.org; Fri, 03 Feb 2023 06:11:02 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1675404652; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=Kg33H3/wUydkKVCKyNEhJogbcog6B4rvz4IVVy4bwwA=; b=DHkhsWwTvYFKMYa6vMSVCG2tybw8/Kw6GgZ17yK7fuyuwaw5jEYBRi/cPUFpAZ+axrYr/H LnTBtnwtU9jm/86Uk2aSBApWL5Tg6qzxFY7I0+vWusB9jJ3175ZxfnIvStbgVD/U3bd2pv 1q9dPxtm7ABZR/Xl4yfiPvJaRg2ERzY= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-335-pNHOeXd8MCuw1ZjvvZCBSQ-1; Fri, 03 Feb 2023 01:10:47 -0500 X-MC-Unique: pNHOeXd8MCuw1ZjvvZCBSQ-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id AA85185A588; Fri, 3 Feb 2023 06:10:46 +0000 (UTC) Received: from q.redhat.com (unknown [10.66.61.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id F387E2026FFB; Fri, 3 Feb 2023 06:10:40 +0000 (UTC) From: shahuang@redhat.com To: kvm@vger.kernel.org Cc: Shaoqin Huang , Marc Zyngier , James Morse , Suzuki K Poulose , Oliver Upton , Zenghui Yu , Paolo Bonzini , Shuah Khan , Sean Christopherson , David Matlack , linux-arm-kernel@lists.infradead.org (moderated list:KERNEL VIRTUAL MACHINE FOR ARM64 (KVM/arm64)), kvmarm@lists.linux.dev (open list:KERNEL VIRTUAL MACHINE FOR ARM64 (KVM/arm64)), kvmarm@lists.cs.columbia.edu (moderated list:KERNEL VIRTUAL MACHINE FOR ARM64 (KVM/arm64)), linux-kselftest@vger.kernel.org (open list:KERNEL SELFTEST FRAMEWORK), linux-kernel@vger.kernel.org (open list) Subject: [PATCH] KVM: selftests: Remove redundant setbuf() Date: Fri, 3 Feb 2023 14:10:36 +0800 Message-Id: <20230203061038.277655-1-shahuang@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230202_221100_598853_25B4A491 X-CRM114-Status: UNSURE ( 9.91 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Shaoqin Huang Since setbuf(stdout, NULL) has been called in kvm_util.c with __attribute((constructor)). Selftests no need to setup it in their own code. Signed-off-by: Shaoqin Huang Reviewed-by: Sean Christopherson --- tools/testing/selftests/kvm/aarch64/page_fault_test.c | 2 -- .../selftests/kvm/x86_64/exit_on_emulation_failure_test.c | 3 --- 2 files changed, 5 deletions(-) diff --git a/tools/testing/selftests/kvm/aarch64/page_fault_test.c b/tools/testing/selftests/kvm/aarch64/page_fault_test.c index beb944fa6fd4..513b20bec3c2 100644 --- a/tools/testing/selftests/kvm/aarch64/page_fault_test.c +++ b/tools/testing/selftests/kvm/aarch64/page_fault_test.c @@ -1093,8 +1093,6 @@ int main(int argc, char *argv[]) enum vm_mem_backing_src_type src_type; int opt; - setbuf(stdout, NULL); - src_type = DEFAULT_VM_MEM_SRC; while ((opt = getopt(argc, argv, "hm:s:")) != -1) { diff --git a/tools/testing/selftests/kvm/x86_64/exit_on_emulation_failure_test.c b/tools/testing/selftests/kvm/x86_64/exit_on_emulation_failure_test.c index 37c61f712fd5..e334844d6e1d 100644 --- a/tools/testing/selftests/kvm/x86_64/exit_on_emulation_failure_test.c +++ b/tools/testing/selftests/kvm/x86_64/exit_on_emulation_failure_test.c @@ -26,9 +26,6 @@ int main(int argc, char *argv[]) struct kvm_vcpu *vcpu; struct kvm_vm *vm; - /* Tell stdout not to buffer its content */ - setbuf(stdout, NULL); - TEST_REQUIRE(kvm_has_cap(KVM_CAP_EXIT_ON_EMULATION_FAILURE)); vm = vm_create_with_one_vcpu(&vcpu, guest_code);