Re: [Jan Beulich] [PATCH] constify tables in kernel/sysctl_check.c

2007-12-21 Thread Eric W. Biederman
Dave Jones <[EMAIL PROTECTED]> writes:

> On Thu, Dec 20, 2007 at 04:14:05PM -0700, Eric W. Biederman wrote:
>
>  > Remains the question whether it is intended that many, perhaps even
>  > large, tables are compiled in without ever having a chance to get used,
>  > i.e. whether there shouldn't #ifdef CONFIG_xxx get added.
>
>  > -static struct trans_ctl_table trans_net_ax25_param_table[] = {
>  > +static const struct trans_ctl_table trans_net_ax25_table[] = {
>
> we lost the _param, which will cause a duplicate definition with ..
>  
>  > -static struct trans_ctl_table trans_net_ax25_table[] = {
>  > +static const struct trans_ctl_table trans_net_ax25_table[] = {
>
> cut-n-paste thinko ?

Thanks, for catching that.

Anyway this patch looks sound in principle but I expect it might conflict
with the bug fix Andrew just merged.

Eric
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [Jan Beulich] [PATCH] constify tables in kernel/sysctl_check.c

2007-12-21 Thread Eric W. Biederman
Dave Jones [EMAIL PROTECTED] writes:

 On Thu, Dec 20, 2007 at 04:14:05PM -0700, Eric W. Biederman wrote:

   Remains the question whether it is intended that many, perhaps even
   large, tables are compiled in without ever having a chance to get used,
   i.e. whether there shouldn't #ifdef CONFIG_xxx get added.

   -static struct trans_ctl_table trans_net_ax25_param_table[] = {
   +static const struct trans_ctl_table trans_net_ax25_table[] = {

 we lost the _param, which will cause a duplicate definition with ..
  
   -static struct trans_ctl_table trans_net_ax25_table[] = {
   +static const struct trans_ctl_table trans_net_ax25_table[] = {

 cut-n-paste thinko ?

Thanks, for catching that.

Anyway this patch looks sound in principle but I expect it might conflict
with the bug fix Andrew just merged.

Eric
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [Jan Beulich] [PATCH] constify tables in kernel/sysctl_check.c

2007-12-20 Thread Jan Beulich
Thanks for catching this!

>>> Dave Jones <[EMAIL PROTECTED]> 21.12.07 03:30 >>>
On Thu, Dec 20, 2007 at 04:14:05PM -0700, Eric W. Biederman wrote:

 > Remains the question whether it is intended that many, perhaps even
 > large, tables are compiled in without ever having a chance to get used,
 > i.e. whether there shouldn't #ifdef CONFIG_xxx get added.

 > -static struct trans_ctl_table trans_net_ax25_param_table[] = {
 > +static const struct trans_ctl_table trans_net_ax25_table[] = {

we lost the _param, which will cause a duplicate definition with ..
 
 > -static struct trans_ctl_table trans_net_ax25_table[] = {
 > +static const struct trans_ctl_table trans_net_ax25_table[] = {

cut-n-paste thinko ?

Dave

-- 
http://www.codemonkey.org.uk

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [Jan Beulich] [PATCH] constify tables in kernel/sysctl_check.c

2007-12-20 Thread Dave Jones
On Thu, Dec 20, 2007 at 04:14:05PM -0700, Eric W. Biederman wrote:

 > Remains the question whether it is intended that many, perhaps even
 > large, tables are compiled in without ever having a chance to get used,
 > i.e. whether there shouldn't #ifdef CONFIG_xxx get added.

 > -static struct trans_ctl_table trans_net_ax25_param_table[] = {
 > +static const struct trans_ctl_table trans_net_ax25_table[] = {

we lost the _param, which will cause a duplicate definition with ..
 
 > -static struct trans_ctl_table trans_net_ax25_table[] = {
 > +static const struct trans_ctl_table trans_net_ax25_table[] = {

cut-n-paste thinko ?

Dave

-- 
http://www.codemonkey.org.uk
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[Jan Beulich] [PATCH] constify tables in kernel/sysctl_check.c

2007-12-20 Thread Eric W. Biederman

From: "Jan Beulich" <[EMAIL PROTECTED]>

Remains the question whether it is intended that many, perhaps even
large, tables are compiled in without ever having a chance to get used,
i.e. whether there shouldn't #ifdef CONFIG_xxx get added.

Signed-off-by: Jan Beulich <[EMAIL PROTECTED]>
Acked-by: "Eric W. Biederman" <[EMAIL PROTECTED]>

---

 kernel/sysctl_check.c |  149 --
 1 file changed, 74 insertions(+), 75 deletions(-)

--- linux-2.6.24-postrc5/kernel/sysctl_check.c  2007-12-12 16:48:47.0 
+0100
+++ 2.6.24-postrc5-const-sysctl-check/kernel/sysctl_check.c 2007-12-06 
14:57:15.0 +0100
@@ -9,10 +9,10 @@
 struct trans_ctl_table {
int ctl_name;
const char  *procname;
-   struct trans_ctl_table  *child;
+   const struct trans_ctl_table *child;
 };
 
-static struct trans_ctl_table trans_random_table[] = {
+static const struct trans_ctl_table trans_random_table[] = {
{ RANDOM_POOLSIZE,  "poolsize" },
{ RANDOM_ENTROPY_COUNT, "entropy_avail" },
{ RANDOM_READ_THRESH,   "read_wakeup_threshold" },
@@ -22,13 +22,13 @@ static struct trans_ctl_table trans_rand
{}
 };
 
-static struct trans_ctl_table trans_pty_table[] = {
+static const struct trans_ctl_table trans_pty_table[] = {
{ PTY_MAX,  "max" },
{ PTY_NR,   "nr" },
{}
 };
 
-static struct trans_ctl_table trans_kern_table[] = {
+static const struct trans_ctl_table trans_kern_table[] = {
{ KERN_OSTYPE,  "ostype" },
{ KERN_OSRELEASE,   "osrelease" },
/* KERN_OSREV not used */
@@ -112,7 +112,7 @@ static struct trans_ctl_table trans_kern
{}
 };
 
-static struct trans_ctl_table trans_vm_table[] = {
+static const struct trans_ctl_table trans_vm_table[] = {
{ VM_OVERCOMMIT_MEMORY, "overcommit_memory" },
{ VM_PAGE_CLUSTER,  "page-cluster" },
{ VM_DIRTY_BACKGROUND,  "dirty_background_ratio" },
@@ -144,7 +144,7 @@ static struct trans_ctl_table trans_vm_t
{}
 };
 
-static struct trans_ctl_table trans_net_core_table[] = {
+static const struct trans_ctl_table trans_net_core_table[] = {
{ NET_CORE_WMEM_MAX,"wmem_max" },
{ NET_CORE_RMEM_MAX,"rmem_max" },
{ NET_CORE_WMEM_DEFAULT,"wmem_default" },
@@ -170,14 +170,14 @@ static struct trans_ctl_table trans_net_
{},
 };
 
-static struct trans_ctl_table trans_net_unix_table[] = {
+static const struct trans_ctl_table trans_net_unix_table[] = {
/* NET_UNIX_DESTROY_DELAY unused */
/* NET_UNIX_DELETE_DELAY unused */
{ NET_UNIX_MAX_DGRAM_QLEN,  "max_dgram_qlen" },
{}
 };
 
-static struct trans_ctl_table trans_net_ipv4_route_table[] = {
+static const struct trans_ctl_table trans_net_ipv4_route_table[] = {
{ NET_IPV4_ROUTE_FLUSH, "flush" },
{ NET_IPV4_ROUTE_MIN_DELAY, "min_delay" },
{ NET_IPV4_ROUTE_MAX_DELAY, "max_delay" },
@@ -200,7 +200,7 @@ static struct trans_ctl_table trans_net_
{}
 };
 
-static struct trans_ctl_table trans_net_ipv4_conf_vars_table[] = {
+static const struct trans_ctl_table trans_net_ipv4_conf_vars_table[] = {
{ NET_IPV4_CONF_FORWARDING, "forwarding" },
{ NET_IPV4_CONF_MC_FORWARDING,  "mc_forwarding" },
 
@@ -227,14 +227,14 @@ static struct trans_ctl_table trans_net_
{}
 };
 
-static struct trans_ctl_table trans_net_ipv4_conf_table[] = {
+static const struct trans_ctl_table trans_net_ipv4_conf_table[] = {
{ NET_PROTO_CONF_ALL,   "all",  
trans_net_ipv4_conf_vars_table },
{ NET_PROTO_CONF_DEFAULT,   "default",  
trans_net_ipv4_conf_vars_table },
{ 0, NULL, trans_net_ipv4_conf_vars_table },
{}
 };
 
-static struct trans_ctl_table trans_net_neigh_vars_table[] = {
+static const struct trans_ctl_table trans_net_neigh_vars_table[] = {
{ NET_NEIGH_MCAST_SOLICIT,  "mcast_solicit" },
{ NET_NEIGH_UCAST_SOLICIT,  "ucast_solicit" },
{ NET_NEIGH_APP_SOLICIT,"app_solicit" },
@@ -256,13 +256,13 @@ static struct trans_ctl_table trans_net_
{}
 };
 
-static struct trans_ctl_table trans_net_neigh_table[] = {
+static const struct trans_ctl_table trans_net_neigh_table[] = {
{ NET_PROTO_CONF_DEFAULT, "default", trans_net_neigh_vars_table },
{ 0, NULL, trans_net_neigh_vars_table },
{}
 };
 
-static struct trans_ctl_table trans_net_ipv4_netfilter_table[] = {
+static const struct trans_ctl_table trans_net_ipv4_netfilter_table[] = {
{ NET_IPV4_NF_CONNTRACK_MAX,
"ip_conntrack_max" },
 
{ NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_SYN_SENT,   
"ip_conntrack_tcp_timeout_syn_sent" },
@@ -299,7 +299,7 @@ static struct trans_ctl_table trans_net_
   

[Jan Beulich] [PATCH] constify tables in kernel/sysctl_check.c

2007-12-20 Thread Eric W. Biederman

From: Jan Beulich [EMAIL PROTECTED]

Remains the question whether it is intended that many, perhaps even
large, tables are compiled in without ever having a chance to get used,
i.e. whether there shouldn't #ifdef CONFIG_xxx get added.

Signed-off-by: Jan Beulich [EMAIL PROTECTED]
Acked-by: Eric W. Biederman [EMAIL PROTECTED]

---

 kernel/sysctl_check.c |  149 --
 1 file changed, 74 insertions(+), 75 deletions(-)

--- linux-2.6.24-postrc5/kernel/sysctl_check.c  2007-12-12 16:48:47.0 
+0100
+++ 2.6.24-postrc5-const-sysctl-check/kernel/sysctl_check.c 2007-12-06 
14:57:15.0 +0100
@@ -9,10 +9,10 @@
 struct trans_ctl_table {
int ctl_name;
const char  *procname;
-   struct trans_ctl_table  *child;
+   const struct trans_ctl_table *child;
 };
 
-static struct trans_ctl_table trans_random_table[] = {
+static const struct trans_ctl_table trans_random_table[] = {
{ RANDOM_POOLSIZE,  poolsize },
{ RANDOM_ENTROPY_COUNT, entropy_avail },
{ RANDOM_READ_THRESH,   read_wakeup_threshold },
@@ -22,13 +22,13 @@ static struct trans_ctl_table trans_rand
{}
 };
 
-static struct trans_ctl_table trans_pty_table[] = {
+static const struct trans_ctl_table trans_pty_table[] = {
{ PTY_MAX,  max },
{ PTY_NR,   nr },
{}
 };
 
-static struct trans_ctl_table trans_kern_table[] = {
+static const struct trans_ctl_table trans_kern_table[] = {
{ KERN_OSTYPE,  ostype },
{ KERN_OSRELEASE,   osrelease },
/* KERN_OSREV not used */
@@ -112,7 +112,7 @@ static struct trans_ctl_table trans_kern
{}
 };
 
-static struct trans_ctl_table trans_vm_table[] = {
+static const struct trans_ctl_table trans_vm_table[] = {
{ VM_OVERCOMMIT_MEMORY, overcommit_memory },
{ VM_PAGE_CLUSTER,  page-cluster },
{ VM_DIRTY_BACKGROUND,  dirty_background_ratio },
@@ -144,7 +144,7 @@ static struct trans_ctl_table trans_vm_t
{}
 };
 
-static struct trans_ctl_table trans_net_core_table[] = {
+static const struct trans_ctl_table trans_net_core_table[] = {
{ NET_CORE_WMEM_MAX,wmem_max },
{ NET_CORE_RMEM_MAX,rmem_max },
{ NET_CORE_WMEM_DEFAULT,wmem_default },
@@ -170,14 +170,14 @@ static struct trans_ctl_table trans_net_
{},
 };
 
-static struct trans_ctl_table trans_net_unix_table[] = {
+static const struct trans_ctl_table trans_net_unix_table[] = {
/* NET_UNIX_DESTROY_DELAY unused */
/* NET_UNIX_DELETE_DELAY unused */
{ NET_UNIX_MAX_DGRAM_QLEN,  max_dgram_qlen },
{}
 };
 
-static struct trans_ctl_table trans_net_ipv4_route_table[] = {
+static const struct trans_ctl_table trans_net_ipv4_route_table[] = {
{ NET_IPV4_ROUTE_FLUSH, flush },
{ NET_IPV4_ROUTE_MIN_DELAY, min_delay },
{ NET_IPV4_ROUTE_MAX_DELAY, max_delay },
@@ -200,7 +200,7 @@ static struct trans_ctl_table trans_net_
{}
 };
 
-static struct trans_ctl_table trans_net_ipv4_conf_vars_table[] = {
+static const struct trans_ctl_table trans_net_ipv4_conf_vars_table[] = {
{ NET_IPV4_CONF_FORWARDING, forwarding },
{ NET_IPV4_CONF_MC_FORWARDING,  mc_forwarding },
 
@@ -227,14 +227,14 @@ static struct trans_ctl_table trans_net_
{}
 };
 
-static struct trans_ctl_table trans_net_ipv4_conf_table[] = {
+static const struct trans_ctl_table trans_net_ipv4_conf_table[] = {
{ NET_PROTO_CONF_ALL,   all,  
trans_net_ipv4_conf_vars_table },
{ NET_PROTO_CONF_DEFAULT,   default,  
trans_net_ipv4_conf_vars_table },
{ 0, NULL, trans_net_ipv4_conf_vars_table },
{}
 };
 
-static struct trans_ctl_table trans_net_neigh_vars_table[] = {
+static const struct trans_ctl_table trans_net_neigh_vars_table[] = {
{ NET_NEIGH_MCAST_SOLICIT,  mcast_solicit },
{ NET_NEIGH_UCAST_SOLICIT,  ucast_solicit },
{ NET_NEIGH_APP_SOLICIT,app_solicit },
@@ -256,13 +256,13 @@ static struct trans_ctl_table trans_net_
{}
 };
 
-static struct trans_ctl_table trans_net_neigh_table[] = {
+static const struct trans_ctl_table trans_net_neigh_table[] = {
{ NET_PROTO_CONF_DEFAULT, default, trans_net_neigh_vars_table },
{ 0, NULL, trans_net_neigh_vars_table },
{}
 };
 
-static struct trans_ctl_table trans_net_ipv4_netfilter_table[] = {
+static const struct trans_ctl_table trans_net_ipv4_netfilter_table[] = {
{ NET_IPV4_NF_CONNTRACK_MAX,
ip_conntrack_max },
 
{ NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_SYN_SENT,   
ip_conntrack_tcp_timeout_syn_sent },
@@ -299,7 +299,7 @@ static struct trans_ctl_table trans_net_
{}
 };
 
-static struct trans_ctl_table 

Re: [Jan Beulich] [PATCH] constify tables in kernel/sysctl_check.c

2007-12-20 Thread Dave Jones
On Thu, Dec 20, 2007 at 04:14:05PM -0700, Eric W. Biederman wrote:

  Remains the question whether it is intended that many, perhaps even
  large, tables are compiled in without ever having a chance to get used,
  i.e. whether there shouldn't #ifdef CONFIG_xxx get added.

  -static struct trans_ctl_table trans_net_ax25_param_table[] = {
  +static const struct trans_ctl_table trans_net_ax25_table[] = {

we lost the _param, which will cause a duplicate definition with ..
 
  -static struct trans_ctl_table trans_net_ax25_table[] = {
  +static const struct trans_ctl_table trans_net_ax25_table[] = {

cut-n-paste thinko ?

Dave

-- 
http://www.codemonkey.org.uk
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [Jan Beulich] [PATCH] constify tables in kernel/sysctl_check.c

2007-12-20 Thread Jan Beulich
Thanks for catching this!

 Dave Jones [EMAIL PROTECTED] 21.12.07 03:30 
On Thu, Dec 20, 2007 at 04:14:05PM -0700, Eric W. Biederman wrote:

  Remains the question whether it is intended that many, perhaps even
  large, tables are compiled in without ever having a chance to get used,
  i.e. whether there shouldn't #ifdef CONFIG_xxx get added.

  -static struct trans_ctl_table trans_net_ax25_param_table[] = {
  +static const struct trans_ctl_table trans_net_ax25_table[] = {

we lost the _param, which will cause a duplicate definition with ..
 
  -static struct trans_ctl_table trans_net_ax25_table[] = {
  +static const struct trans_ctl_table trans_net_ax25_table[] = {

cut-n-paste thinko ?

Dave

-- 
http://www.codemonkey.org.uk

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/