Re: [PATCH 1/5] testsuite: Check the list of loaded modules after a test

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

 



Dne 28.2.2014 07:32, Lucas De Marchi napsal(a):
> On Thu, Feb 27, 2014 at 7:52 PM, Michal Marek <mmarek@xxxxxxx> wrote:
>> +       qsort(a1, l1, sizeof(char *), cmp_modnames);
>> +       qsort(a2, l2, sizeof(char *), cmp_modnames);
>> +       for (i = 0; i < l1; i++)
>> +               if (cmp_modnames(&a1[i], &a2[i]) != 0)
>> +                       goto out_a2;
> 
> Isn't the order important? If we take the order into account the code
> could be even simpler because we don't even have to store the char **.
> Just build the second string with ',' as separator and strcmp() them.

The readdir() order is not defined. We could change the preloaded
init_module to build another list of modules that maintains order, but
I'm not sure if it's worth it. I will simplify the allocations as you
suggest.

Michal
--
To unsubscribe from this list: send the line "unsubscribe linux-modules" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux