Commit b1599c3d authored by Kir Kolyshkin's avatar Kir Kolyshkin Committed by Pavel Emelyanov

tcp_read_sysctl_limits(): simplify vect

I spent some time trying to figure out why vect array
is declared as [2][3], also why vect[0] is not used.
The answer is commit 4bca68ba that removed code using it.

Let's save a few bytes, and make the code more readable.
Signed-off-by: 's avatarKir Kolyshkin <kir@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 86bb235b
...@@ -210,11 +210,11 @@ int kerndat_get_dirty_track(void) ...@@ -210,11 +210,11 @@ int kerndat_get_dirty_track(void)
static int tcp_read_sysctl_limits(void) static int tcp_read_sysctl_limits(void)
{ {
u32 vect[2][3] = { }; u32 vect[3] = { };
int ret; int ret;
struct sysctl_req req[] = { struct sysctl_req req[] = {
{ "net/ipv4/tcp_rmem", &vect[1], CTL_U32A(ARRAY_SIZE(vect[1])) }, { "net/ipv4/tcp_rmem", &vect, CTL_U32A(ARRAY_SIZE(vect)) },
}; };
/* /*
...@@ -227,7 +227,7 @@ static int tcp_read_sysctl_limits(void) ...@@ -227,7 +227,7 @@ static int tcp_read_sysctl_limits(void)
goto out; goto out;
} }
kdat.tcp_max_rshare = min(kdat.tcp_max_rshare, (int)vect[1][2]); kdat.tcp_max_rshare = min(kdat.tcp_max_rshare, (int)vect[2]);
if (kdat.tcp_max_rshare < 128) if (kdat.tcp_max_rshare < 128)
pr_warn("The memory limits for TCP queues are suspiciously small\n"); pr_warn("The memory limits for TCP queues are suspiciously small\n");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment