Dne 28.2.2014 07:32, Lucas De Marchi napsal(a):
> On Thu, Feb 27, 2014 at 7:52 PM, Michal Marek <[email protected]> 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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to