mirror of https://gerrit.osmocom.org/libosmocore
gb/gprs_bssgp.c: avoid valueless goto usage
Change-Id: I0c2aaf1ab462c923d62232f1a63fae1e4eb18b4d
This commit is contained in:
parent
d1c7323f3c
commit
f178695466
|
@ -698,24 +698,17 @@ static int bssgp_fc_needs_queueing(struct bssgp_flow_control *fc, uint32_t pdu_l
|
||||||
/* ... and subtract the number of leaked bytes */
|
/* ... and subtract the number of leaked bytes */
|
||||||
bucket_predicted -= leaked;
|
bucket_predicted -= leaked;
|
||||||
|
|
||||||
if (bucket_predicted < pdu_len) {
|
if (bucket_predicted < pdu_len)
|
||||||
/* this is just to make sure the bucket doesn't underflow */
|
return 0;
|
||||||
bucket_predicted = pdu_len;
|
|
||||||
goto pass;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (bucket_predicted <= fc->bucket_size_max) {
|
if (bucket_predicted <= fc->bucket_size_max) {
|
||||||
/* the bucket is not full yet, we can pass the packet */
|
/* the bucket is not full yet, we can pass the packet */
|
||||||
fc->bucket_counter = bucket_predicted;
|
fc->bucket_counter = bucket_predicted;
|
||||||
goto pass;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* bucket is full, PDU needs to be delayed */
|
/* bucket is full, PDU needs to be delayed */
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
pass:
|
|
||||||
/* if we reach here, the PDU can pass */
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* output callback for BVC flow control */
|
/* output callback for BVC flow control */
|
||||||
|
|
Loading…
Reference in New Issue