linux-modules.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michal Marek <mmarek@suse.cz>
To: Lucas De Marchi <lucas.de.marchi@gmail.com>
Cc: linux-modules <linux-modules@vger.kernel.org>
Subject: Re: [PATCH 1/5] testsuite: Check the list of loaded modules after a test
Date: Fri, 28 Feb 2014 07:40:47 +0100	[thread overview]
Message-ID: <53102F6F.7010300@suse.cz> (raw)
In-Reply-To: <CAKi4VAKOh5n9qWjLj1PpO3c0b1xzQOEMdKuD0Fe=C0a2tHmUAQ@mail.gmail.com>

Dne 28.2.2014 07:32, Lucas De Marchi napsal(a):
> On Thu, Feb 27, 2014 at 7:52 PM, Michal Marek <mmarek@suse.cz> 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

  reply	other threads:[~2014-02-28  6:40 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-27 22:52 [PATCH 0/5] kmod_module_insert_module() cleanup and test coverage Michal Marek
2014-02-27 22:52 ` [PATCH 1/5] testsuite: Check the list of loaded modules after a test Michal Marek
2014-02-28  6:32   ` Lucas De Marchi
2014-02-28  6:40     ` Michal Marek [this message]
2014-02-27 22:52 ` [PATCH 2/5] testsuite: Add test for modprobe --force Michal Marek
2014-02-27 22:52 ` [PATCH 3/5] testsuite: Do not provide finit_module(2) on older kernels Michal Marek
2014-02-28  6:37   ` Lucas De Marchi
2014-02-28  6:41     ` Michal Marek
2014-02-27 22:52 ` [PATCH 4/5] Add some tests for kernels without finit_module(2) Michal Marek
2014-02-27 22:52 ` [PATCH 5/5] libkmod-module: Simplify kmod_module_insert_module() Michal Marek
2014-02-28  6:39   ` Lucas De Marchi
2014-02-28  6:03 ` [PATCH 0/5] kmod_module_insert_module() cleanup and test coverage Lucas De Marchi
2014-02-28  6:42   ` Michal Marek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53102F6F.7010300@suse.cz \
    --to=mmarek@suse.cz \
    --cc=linux-modules@vger.kernel.org \
    --cc=lucas.de.marchi@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).