From: Changli Gao <xiaosuo@gmail•com>
To: "David S. Miller" <davem@davemloft•net>
Cc: netdev@vger•kernel.org, Changli Gao <xiaosuo@gmail•com>
Subject: [PATCH] net: unix: make some variables constant
Date: Tue, 19 Oct 2010 13:24:02 +0800 [thread overview]
Message-ID: <1287465842-2958-1-git-send-email-xiaosuo@gmail.com> (raw)
And since ctl_table.data is initialized later, we don't need to initialize
the data member of the template variable unix_table.
Signed-off-by: Changli Gao <xiaosuo@gmail•com>
---
net/unix/sysctl_net_unix.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/net/unix/sysctl_net_unix.c b/net/unix/sysctl_net_unix.c
index 397cffe..1114ccc 100644
--- a/net/unix/sysctl_net_unix.c
+++ b/net/unix/sysctl_net_unix.c
@@ -15,10 +15,9 @@
#include <net/af_unix.h>
-static ctl_table unix_table[] = {
+const static ctl_table unix_table[] = {
{
.procname = "max_dgram_qlen",
- .data = &init_net.unx.sysctl_max_dgram_qlen,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec
@@ -26,7 +25,7 @@ static ctl_table unix_table[] = {
{ }
};
-static struct ctl_path unix_path[] = {
+const static struct ctl_path unix_path[] = {
{ .procname = "net", },
{ .procname = "unix", },
{ },
next reply other threads:[~2010-10-19 5:24 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-19 5:24 Changli Gao [this message]
2010-10-19 5:47 ` [PATCH] net: unix: make some variables constant Eric Dumazet
2010-10-19 6:03 ` Changli Gao
2010-10-19 6:03 ` Stephen Hemminger
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=1287465842-2958-1-git-send-email-xiaosuo@gmail.com \
--to=xiaosuo@gmail$(echo .)com \
--cc=davem@davemloft$(echo .)net \
--cc=netdev@vger$(echo .)kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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