Re: [PATCH v2] kunit: run test suites only after module initialization completes

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

 




On 28/11/23 12:15, Javier Martinez Canillas wrote:
> Marco Pagani <marpagan@xxxxxxxxxx> writes:
> 
> Hello Marco,
> 
> [...]
> 
>> @@ -737,12 +738,14 @@ static void kunit_module_exit(struct module *mod)
>>  	};
>>  	const char *action = kunit_action();
>>  
>> +	if (!suite_set.start || !virt_addr_valid(suite_set.start))
>> +		return;
>> +
> 
> I would add a comment here explaining why this condition is checked and
> what it means. Maybe something like the following ?
> 
> +       /*
> +        * Check if the kunit test suite start address is a virtual
> +        * address or a direct mapping address. This is used as an
> +        * indication of whether the kunit_filter_suites() was used
> +        * to filter the kunit test suite or not.
> +        *
> +        * If is not a virtual address, then this means that the
> +        * kunit_module_init() function was not called and the kunit
> +        * suite was not filtered. Let's just bail out in that case.
> +        */
> +       if (!suite_set.start || !virt_addr_valid(suite_set.start))
> +               return;

Good point. I'll add a comment in v3.

> 
> The patch makes sense to me though and agree that is a better approach.
> 
> Reviewed-by: Javier Martinez Canillas <javierm@xxxxxxxxxx>
> 

Thanks,
Marco





[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