Re: [PATCH v8 3/3] selftests/mm: add new selftests for KSM

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

 



David Hildenbrand <david@xxxxxxxxxx> writes:

> On 17.04.23 16:35, David Hildenbrand wrote:
>>> +/* Verify that KSM can be enabled / queried with prctl. */
>>> +static void test_prctl(void)
>>> +{
>>> +	int ret;
>>> +
>>> +	ksft_print_msg("[RUN] %s\n", __func__);
>>> +
>>> +	ret = prctl(PR_SET_MEMORY_MERGE, 1, 0, 0, 0);
>>> +	if (ret < 0 && errno == EINVAL) {
>>> +		ksft_test_result_skip("PR_SET_MEMORY_MERGE not supported\n");
>>> +		return;
>>> +	} else if (ret) {
>>> +		ksft_test_result_fail("PR_SET_MEMORY_MERGE=1 failed\n");
>>> +	}
>> Just realized we're missing a "return;" in case of the failure here.
>>
>
>
> And we should probably fix that as well:
>
> ERROR: do not initialise globals to 0
> #235: FILE: tools/testing/selftests/mm/ksm_tests.c:57:
> +int debug = 0;
>
> total: 1 errors, 0 warnings, 512 lines checked

I'll fix it in the next version.'



[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