Re: [PATCH] selftests: arm64: Fix redundancy of a testcase

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

>  	/* ...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 <broonie@xxxxxxxxxx>

> @@ -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.

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux