On 07/14/15 18:03, Mike Holmes wrote:

    @@ -41,13 +41,13 @@ static void cpumask_test_odp_cpumask_def(void)
     {
            int num_worker;
            int num_control;
    -       int max_cpus = get_max_number_of_cpus_in_a_mask();
    +       int max_cpus = mask_capacity();
            odp_cpumask_t mask;

            num_worker = odp_cpumask_def_worker(&mask, max_cpus - 1);
            num_control = odp_cpumask_def_control(&mask, 1);

    -       CU_ASSERT((num_control + num_worker) == max_cpus);
    +       CU_ASSERT((num_control + num_worker) <= max_cpus);


Bug fix should be its own patch describing why it is needed

Agree with Mike.

Also you can add checks that:
num_worker > 0
num_control == 1

And add comment that on some platforms num_workers and num_controls might be limited, so that
we can not expect that (num_control + num_worker) == max_cpus.


Thanks,
Maxim.

_______________________________________________
lng-odp mailing list
[email protected]
https://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to