Received: by 2002:ab2:6d45:0:b0:1fb:d597:ff75 with SMTP id d5csp306538lqr; Wed, 5 Jun 2024 06:47:50 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWU8gl0UbFO+WKFv2rHTpSU9lrlf40YmRCIZBiveS4OP8CQQD1L06MTnpc1dCb8e0ax+ktFXogFGruRfgaJf4bB35fKSmzEKtDkNjGBXQ== X-Google-Smtp-Source: AGHT+IEf2bYkOYuzEp7SOaljqVDE8yKQq4w5piAZzX2QYQmVdod3QF+tKtgnhmvaz4SUcJVrXkx/ X-Received: by 2002:a05:6358:281a:b0:17f:6b3f:1b0a with SMTP id e5c5f4694b2df-19c6c7ad666mr299958055d.15.1717595270543; Wed, 05 Jun 2024 06:47:50 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717595270; cv=pass; d=google.com; s=arc-20160816; b=IqAp/W2S2JUx679QP4SVI81LR/qfK2K+53emqR+JmmkCDYjHC0TO4GW2PKR3+QqMGn NpwjSixet++MDzGxYVMbB5zzwEg+Q16EkIrtAJU+wNoUfuc3VJY6+/XmusYwOcMlbL26 ThEyLuwB+GcK2FBsMhpss8Rlxd0BvT925gS6AIsdk4PMKhX6d6EHkqgMKoUAljURVHjC Ems3N5Ub/iZvLEyRWV71YJsvZZSbB6uNVXYVf9wg/tDbNBZEqLXeByhkbDMXYsQONd+/ hkOXiW/c+j3lTJ1gDrDhyw4myBQIFvWOw/bIZ6kJ9b47W1EMbF6wEsspYN6ze+hSBIWu dBVA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=RpSdDLKtyiyuNmo2UWXIywCTsCQXRPPEYR61aYaT074=; fh=tsR/maJpv5ckigxPrLiWq4Q0h+Z7/EoOaXEDONyQ+YE=; b=dF2n5Cm3fkJogQo4LAwIEEsLwEzHs07hqE7trW2MM/bTG+PcWHrHc02CwDp2MqHZDU xQV6NTn5Zyk2QALsZ0R75NpHdXh7NCwIiKRJAlrLSt90LdoC8tFD6T4v4fABqB1TgJnW 3uFEUSEUSCU1DDp7JlEDYxeS5h/QZCVaw4EEvYwgmOYe5BSqieNFq2EyAjv0RT6i5zUG VeWzWkhD00HA0I3oJFOiva4+ZI0Bf8c3+Z3Qq3NApJVJ+kE4ClD0RoK35Qz/OFMy03pj GHkTPwMnQMhilsCvUBaE88RnckqiP0AIfWcKcPL+54pRdV27M/I0i5UsBRe002RE9VBk NrOA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-202602-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-202602-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id 41be03b00d2f7-6d99b777860si1500598a12.876.2024.06.05.06.47.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 06:47:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-202602-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-202602-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-202602-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 2EED6B250D4 for ; Wed, 5 Jun 2024 13:11:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3DF2D19B587; Wed, 5 Jun 2024 12:26:34 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5377219B3DF; Wed, 5 Jun 2024 12:26:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717590393; cv=none; b=JeUjOphUhKFUlAQ8LEvtCyCw7ITOptOtOp2xPUo1Xjta3tTNxPFHmA/6tSOWS+trLIo7GEMAQ9eXugzHD8TCuxe6Ldi3omgxT9S2LJhnL0bLusVgbn7qemdnCds451eb9zC6OCNLEHsKInADKAEgj0Fp5vbXfIfVpSn3q4xZC60= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717590393; c=relaxed/simple; bh=OpM7hf33K9cNQBheqRJr3tktJceZPUA/A8LQOs1Ns34=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=CCr+NkR2raabwZ0pju/H9LMHwDZeaIdL9A/Y7ZMAkZDeFyrl+fFU2yElkWJf5ce//MysB2CgSwuS93eInfn6jCqYtsffdK5+3k7/Jp6/o8KroktOo1XYXRz1K6ZiTfx5CRDaKpGZ26D9mRh1N7GRqT3zNxJIoPHHjCAF2tBN8OQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com 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 29038DA7; Wed, 5 Jun 2024 05:26:56 -0700 (PDT) Received: from [10.162.40.27] (e116581.arm.com [10.162.40.27]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B878B3F762; Wed, 5 Jun 2024 05:26:28 -0700 (PDT) Message-ID: <9710a691-1c94-4f0b-b320-9fc78ee15ae8@arm.com> Date: Wed, 5 Jun 2024 17:56:25 +0530 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] selftests: arm64: Fix redundancy of a testcase To: Mark Brown Cc: linux-arm-kernel@lists.infradead.org, catalin.marinas@arm.com, will@kernel.org, shuah@kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, suzuki.poulose@arm.com, Anshuman.Khandual@arm.com References: <20240605115448.640717-1-dev.jain@arm.com> Content-Language: en-US From: Dev Jain In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 6/5/24 17:30, Mark Brown wrote: > On Wed, Jun 05, 2024 at 05:24:48PM +0530, Dev Jain wrote: >> 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. > Please don't combine unrelated changes into a single patch. I shall take care of that in the future. > >> /* ...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"); > This is a good fix: > > Reviewed-by: Mark Brown Thanks! > >> @@ -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]; > I'm less convinced that this is a good style change. Well, what I have seen usually is, when we add 1, we use prefix/postfix increment, and do a "+=" when it is not 1. But, I get your point: such style may confuse people into thinking that we are doing an index/pointer increment, since that is the usual usecase for this.