diff options
author | Gerrit Renker <gerrit@erg.abdn.ac.uk> | 2007-12-13 09:27:14 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 17:57:49 -0500 |
commit | 7913350663e2756ecb91dd3a7c773806b943426e (patch) | |
tree | 3fcb07f5465930633526affa050571527ecd5c5a /net/dccp/proto.c | |
parent | b8599d20708fa3bde1e414689f3474560c2d990b (diff) |
[DCCP]: Collapse repeated `len' statements into one
This replaces 4 individual assignments for `len' with a single
one, placed where the control flow of those 4 leads to.
Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
Signed-off-by: Ian McDonald <ian.mcdonald@jandi.co.nz>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dccp/proto.c')
-rw-r--r-- | net/dccp/proto.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/net/dccp/proto.c b/net/dccp/proto.c index cc87c500bfb8..0bed4a6095b7 100644 --- a/net/dccp/proto.c +++ b/net/dccp/proto.c | |||
@@ -657,19 +657,15 @@ static int do_dccp_getsockopt(struct sock *sk, int level, int optname, | |||
657 | (__be32 __user *)optval, optlen); | 657 | (__be32 __user *)optval, optlen); |
658 | case DCCP_SOCKOPT_GET_CUR_MPS: | 658 | case DCCP_SOCKOPT_GET_CUR_MPS: |
659 | val = dp->dccps_mss_cache; | 659 | val = dp->dccps_mss_cache; |
660 | len = sizeof(val); | ||
661 | break; | 660 | break; |
662 | case DCCP_SOCKOPT_SERVER_TIMEWAIT: | 661 | case DCCP_SOCKOPT_SERVER_TIMEWAIT: |
663 | val = dp->dccps_server_timewait; | 662 | val = dp->dccps_server_timewait; |
664 | len = sizeof(val); | ||
665 | break; | 663 | break; |
666 | case DCCP_SOCKOPT_SEND_CSCOV: | 664 | case DCCP_SOCKOPT_SEND_CSCOV: |
667 | val = dp->dccps_pcslen; | 665 | val = dp->dccps_pcslen; |
668 | len = sizeof(val); | ||
669 | break; | 666 | break; |
670 | case DCCP_SOCKOPT_RECV_CSCOV: | 667 | case DCCP_SOCKOPT_RECV_CSCOV: |
671 | val = dp->dccps_pcrlen; | 668 | val = dp->dccps_pcrlen; |
672 | len = sizeof(val); | ||
673 | break; | 669 | break; |
674 | case 128 ... 191: | 670 | case 128 ... 191: |
675 | return ccid_hc_rx_getsockopt(dp->dccps_hc_rx_ccid, sk, optname, | 671 | return ccid_hc_rx_getsockopt(dp->dccps_hc_rx_ccid, sk, optname, |
@@ -681,6 +677,7 @@ static int do_dccp_getsockopt(struct sock *sk, int level, int optname, | |||
681 | return -ENOPROTOOPT; | 677 | return -ENOPROTOOPT; |
682 | } | 678 | } |
683 | 679 | ||
680 | len = sizeof(val); | ||
684 | if (put_user(len, optlen) || copy_to_user(optval, &val, len)) | 681 | if (put_user(len, optlen) || copy_to_user(optval, &val, len)) |
685 | return -EFAULT; | 682 | return -EFAULT; |
686 | 683 | ||