From: "Luiz Fernando N. Capitulino" <lcapitulino@conectiva.com.br>
To: linux-kernel@vger.kernel.org
Cc: akpm@osdl.org, davem@davemloft.net
Subject: [PATCH 2/2] - net/socket.c::__sock_create() cleanup.
Date: Tue, 16 Nov 2004 18:55:26 -0200 [thread overview]
Message-ID: <20041116185526.1c5cfb97.lcapitulino@conectiva.com.br> (raw)
Hi,
The 'i' variable in net/socket.c::__sock_create() is not
necessary. It's have been used to store error codes but there is
an 'err' variable already.
The patch bellow removes the extra variable, and makes use
of 'err' istead.
Agains't 2.6.10-rc2.
Signed-off-by: Luiz Capitulino <lcapitulino@conectiva.com.br>
net/socket.c | 11 +++++------
1 files changed, 5 insertions(+), 6 deletions(-)
diff -X /home/lcapitulino/kernels/2.6/dontdiff -Nparu a/net/socket.c a~/net/socket.c
--- a/net/socket.c 2004-08-14 02:36:45.000000000 -0300
+++ a~/net/socket.c 2004-10-30 23:44:34.000000000 -0200
@@ -1073,7 +1073,6 @@ int sock_wake_async(struct socket *sock,
static int __sock_create(int family, int type, int protocol, struct socket **res, int kern)
{
- int i;
int err;
struct socket *sock;
@@ -1118,7 +1117,7 @@ static int __sock_create(int family, int
net_family_read_lock();
if (net_families[family] == NULL) {
- i = -EAFNOSUPPORT;
+ err = -EAFNOSUPPORT;
goto out;
}
@@ -1131,7 +1130,7 @@ static int __sock_create(int family, int
if (!(sock = sock_alloc()))
{
printk(KERN_WARNING "socket: no more sockets\n");
- i = -ENFILE; /* Not exactly a match, but its the
+ err = -ENFILE; /* Not exactly a match, but its the
closest posix thing */
goto out;
}
@@ -1142,11 +1141,11 @@ static int __sock_create(int family, int
* We will call the ->create function, that possibly is in a loadable
* module, so we have to bump that loadable module refcnt first.
*/
- i = -EAFNOSUPPORT;
+ err = -EAFNOSUPPORT;
if (!try_module_get(net_families[family]->owner))
goto out_release;
- if ((i = net_families[family]->create(sock, protocol)) < 0)
+ if ((err = net_families[family]->create(sock, protocol)) < 0)
goto out_module_put;
/*
* Now to bump the refcnt of the [loadable] module that owns this
@@ -1166,7 +1165,7 @@ static int __sock_create(int family, int
out:
net_family_read_unlock();
- return i;
+ return err;
out_module_put:
module_put(net_families[family]->owner);
out_release:
reply other threads:[~2004-11-16 22:54 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20041116185526.1c5cfb97.lcapitulino@conectiva.com.br \
--to=lcapitulino@conectiva.com.br \
--cc=akpm@osdl.org \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
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
all inboxes | Powered by JetHome®