summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorGerrit Renker <gerrit@erg.abdn.ac.uk>2007-12-13 12:27:14 -0200
committerDavid S. Miller <davem@davemloft.net>2008-01-28 14:57:49 -0800
commit7913350663e2756ecb91dd3a7c773806b943426e (patch)
tree3fcb07f5465930633526affa050571527ecd5c5a /net
parentb8599d20708fa3bde1e414689f3474560c2d990b (diff)
downloadkernel-crypto-7913350663e2756ecb91dd3a7c773806b943426e.tar.gz
kernel-crypto-7913350663e2756ecb91dd3a7c773806b943426e.tar.xz
kernel-crypto-7913350663e2756ecb91dd3a7c773806b943426e.zip
[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')
-rw-r--r--net/dccp/proto.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/net/dccp/proto.c b/net/dccp/proto.c
index cc87c500bfb..0bed4a6095b 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,
(__be32 __user *)optval, optlen);
case DCCP_SOCKOPT_GET_CUR_MPS:
val = dp->dccps_mss_cache;
- len = sizeof(val);
break;
case DCCP_SOCKOPT_SERVER_TIMEWAIT:
val = dp->dccps_server_timewait;
- len = sizeof(val);
break;
case DCCP_SOCKOPT_SEND_CSCOV:
val = dp->dccps_pcslen;
- len = sizeof(val);
break;
case DCCP_SOCKOPT_RECV_CSCOV:
val = dp->dccps_pcrlen;
- len = sizeof(val);
break;
case 128 ... 191:
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,
return -ENOPROTOOPT;
}
+ len = sizeof(val);
if (put_user(len, optlen) || copy_to_user(optval, &val, len))
return -EFAULT;