On 10/24/06, Johannes Berg <[EMAIL PROTECTED]> wrote:


> +static int load_iso3166_1(void) {
> +       int r = 0;
> +       r |= iso3166_1_add(4, "AF", "AFG",
> +               "Afghanistan");
[...]

Why don't you make the table a static array, then you can use ARRAY_SIZE
and get rid of the whole list_head, not have it eat up code size and
mark it as read-only static data.

This was how I had the original implementation, I moved it to linked
lists thinking we'd update it frequently but obviously that's not the
case. You are right, also if we index based on alpha3 we get O(1)
access to the elements. Will make these changes.

> +EXPORT_SYMBOL(iso3166_1_list);

Why export the list?

No good reason -- will remove this, right again.

> +EXPORT_SYMBOL(get_iso3166_1_numeric);
> +EXPORT_SYMBOL(get_iso3166_1_alpha2);
> +EXPORT_SYMBOL(get_iso3166_1_alpha3);
> +EXPORT_SYMBOL(iso3166_1_exists);

Also, please put these along with the function.

Sure.

 Luis
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to