From patchwork Wed Jun 5 11:54:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dev Jain X-Patchwork-Id: 13686731 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 4E3A5C27C53 for ; Wed, 5 Jun 2024 11:56:36 +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=fl3AcAl324/nGqJ1PfpKAakWp+QyjqSNI7DDtgQ8Sbw=; b=SBRqSf66VqvKdB uokpuPBagVvnRTJsCFPyQx6zUuxKJB/JWd7SWLzH4RTzFMEL0fz2T3ylAUOB9k6V87lINUDYdBUgn DzHBaCxbDYdMHNcZW53JHl7Dxk7RGx7hpJ4DC84Gi6y0xy9OwASMPcKWrDKopDudvB7gRvcZTZHj+ 7rki00MMwZVf4Z6NfBX3GaFVQ9JF0mst7ccRFgz+nFKtyn4zP3c13i6wz/xoa2J+gUTMLFpM+HmJN y7tcIuFiEfxc+s5wJ0SJkKpLgU+crAIWkr5X8MvwdBuYJGdj4UFMFQgUIcPzWzAC0F1IRa22sSWUg Th8QLAIvAx5lzrdOJ8tg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sEpFh-00000005oei-23pg; Wed, 05 Jun 2024 11:56:25 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sEpFe-00000005ocy-1ZmS for linux-arm-kernel@lists.infradead.org; Wed, 05 Jun 2024 11:56:23 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 37701339; Wed, 5 Jun 2024 04:56:42 -0700 (PDT) Received: from e116581.blr.arm.com (e116581.arm.com [10.162.40.27]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 625493F762; Wed, 5 Jun 2024 04:56:14 -0700 (PDT) From: Dev Jain To: linux-arm-kernel@lists.infradead.org, catalin.marinas@arm.com, will@kernel.org, shuah@kernel.org, linux-kselftest@vger.kernel.org Cc: linux-kernel@vger.kernel.org, broonie@kernel.org, suzuki.poulose@arm.com, Anshuman.Khandual@arm.com, Dev Jain Subject: [PATCH] selftests: arm64: Fix redundancy of a testcase Date: Wed, 5 Jun 2024 17:24:48 +0530 Message-Id: <20240605115448.640717-1-dev.jain@arm.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240605_045622_485054_CE221B5B X-CRM114-Status: GOOD ( 10.62 ) 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 Currently, we are writing the same value as we read, into the TLS register; hence, we cannot confirm updation of the register, making the testcase "verify_tpidr_one" redundant. Fix this; while at it, do a style change. Signed-off-by: Dev Jain Reviewed-by: Mark Brown --- tools/testing/selftests/arm64/abi/ptrace.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/arm64/abi/ptrace.c b/tools/testing/selftests/arm64/abi/ptrace.c index abe4d58d731d..c105703442f9 100644 --- a/tools/testing/selftests/arm64/abi/ptrace.c +++ b/tools/testing/selftests/arm64/abi/ptrace.c @@ -47,7 +47,7 @@ static void test_tpidr(pid_t child) /* ...write a new value.. */ write_iov.iov_len = sizeof(uint64_t); - write_val[0] = read_val[0]++; + write_val[0] = read_val[0] + 1; ret = ptrace(PTRACE_SETREGSET, child, NT_ARM_TLS, &write_iov); ksft_test_result(ret == 0, "write_tpidr_one\n"); @@ -108,7 +108,7 @@ static void test_tpidr(pid_t child) /* Writing only TPIDR... */ write_iov.iov_len = sizeof(uint64_t); memcpy(write_val, read_val, sizeof(read_val)); - write_val[0] += 1; + ++write_val[0]; ret = ptrace(PTRACE_SETREGSET, child, NT_ARM_TLS, &write_iov); if (ret == 0) {