Re: [PATCH] eliminate warnings in generated module files

From: Rusty Russell (rusty@rustcorp.com.au)
Date: Tue Feb 25 2003 - 23:13:09 EST


In message <Pine.LNX.4.44.0302251930280.13501-100000@chaos.physics.uiowa.edu> y
ou write:
> FWIW, I think it's not a good idea. Why call it 'required' in the kernel
> when the normal (gcc) expression for it is 'used'. - We didn't rename
> 'deprecated' to 'obsolete', either ;)

But deprecated was a fine name. "used" is a terrible name, and since
we're renaming it via a macro anyway... (see "likey").

> Also, I don't really see any use for __optional at this point, so why add
> it at all?

>From ip_conntrack_core.c:

#ifdef CONFIG_SYSCTL
static struct ctl_table_header *ip_conntrack_sysctl_header;

static ctl_table ip_conntrack_table[] = {
        {
                .ctl_name = NET_IP_CONNTRACK_MAX,
                .procname = NET_IP_CONNTRACK_MAX_NAME,
                .data = &ip_conntrack_max,
                .maxlen = sizeof(ip_conntrack_max),
                .mode = 0644,
                .proc_handler = proc_dointvec
        },
         { .ctl_name = 0 }
};

static ctl_table ip_conntrack_dir_table[] = {
        {
                .ctl_name = NET_IPV4,
                .procname = "ipv4",
                .maxlen = 0,
                .mode = 0555,
                .child = ip_conntrack_table
        },
        { .ctl_name = 0 }
};

static ctl_table ip_conntrack_root_table[] = {
        {
                .ctl_name = CTL_NET,
                .procname = "net",
                .maxlen = 0,
                .mode = 0555,
                .child = ip_conntrack_dir_table
        },
        { .ctl_name = 0 }
};
#endif /*CONFIG_SYSCTL*/

I'd love to frop the #ifdef and just mark them __optional: before that
would just mean bloat, but when gcc 3.3 rolls in, they should vanish
nicely.

There are numerous other examples...
Rusty.

--
  Anyone who quotes me in their sig is an idiot. -- Rusty Russell.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri Feb 28 2003 - 22:00:34 EST