diff options
author | Gerrit Renker <gerrit@erg.abdn.ac.uk> | 2006-11-14 09:57:34 -0500 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-12-03 00:22:30 -0500 |
commit | 09dbc3895e3242346bd434dae743c456fd28fc6a (patch) | |
tree | a7bc1d0879b025152bff9e4a0ba44beaa5da654b /net/dccp/proto.c | |
parent | c02fdc0e81e9c735d8d895af1e201b235df326d8 (diff) |
[DCCP]: Miscellaneous code tidy-ups
This patch does not change code; it performs some trivial clean/tidy-ups:
* removal of a `debug_prefix' string in favour of the
already existing dccp_role(sk)
* add documentation of structures and constants
* separated out the cases for invalid packets (step 1
of the packet validation)
* removing duplicate statements
* combining declaration & initialisation
Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
Diffstat (limited to 'net/dccp/proto.c')
-rw-r--r-- | net/dccp/proto.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/net/dccp/proto.c b/net/dccp/proto.c index 9c9c08cffdaf..0225bdacd3b1 100644 --- a/net/dccp/proto.c +++ b/net/dccp/proto.c | |||
@@ -452,9 +452,8 @@ out_free_val: | |||
452 | static int do_dccp_setsockopt(struct sock *sk, int level, int optname, | 452 | static int do_dccp_setsockopt(struct sock *sk, int level, int optname, |
453 | char __user *optval, int optlen) | 453 | char __user *optval, int optlen) |
454 | { | 454 | { |
455 | struct dccp_sock *dp; | 455 | struct dccp_sock *dp = dccp_sk(sk); |
456 | int err; | 456 | int val, err = 0; |
457 | int val; | ||
458 | 457 | ||
459 | if (optlen < sizeof(int)) | 458 | if (optlen < sizeof(int)) |
460 | return -EINVAL; | 459 | return -EINVAL; |
@@ -466,9 +465,6 @@ static int do_dccp_setsockopt(struct sock *sk, int level, int optname, | |||
466 | return dccp_setsockopt_service(sk, val, optval, optlen); | 465 | return dccp_setsockopt_service(sk, val, optval, optlen); |
467 | 466 | ||
468 | lock_sock(sk); | 467 | lock_sock(sk); |
469 | dp = dccp_sk(sk); | ||
470 | err = 0; | ||
471 | |||
472 | switch (optname) { | 468 | switch (optname) { |
473 | case DCCP_SOCKOPT_PACKET_SIZE: | 469 | case DCCP_SOCKOPT_PACKET_SIZE: |
474 | dp->dccps_packet_size = val; | 470 | dp->dccps_packet_size = val; |