[MERGED] libosmocore[master]: gb/gprs_bssgp.c: avoid valueless goto usage

2017-06-15 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: gb/gprs_bssgp.c: avoid valueless goto usage
..


gb/gprs_bssgp.c: avoid valueless goto usage

Change-Id: I0c2aaf1ab462c923d62232f1a63fae1e4eb18b4d
---
M src/gb/gprs_bssgp.c
1 file changed, 3 insertions(+), 10 deletions(-)

Approvals:
  Max: Looks good to me, but someone else must approve
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/gb/gprs_bssgp.c b/src/gb/gprs_bssgp.c
index aa6e37b..142f589 100644
--- a/src/gb/gprs_bssgp.c
+++ b/src/gb/gprs_bssgp.c
@@ -698,24 +698,17 @@
/* ... and subtract the number of leaked bytes */
bucket_predicted -= leaked;
 
-   if (bucket_predicted < pdu_len) {
-   /* this is just to make sure the bucket doesn't underflow */
-   bucket_predicted = pdu_len;
-   goto pass;
-   }
+   if (bucket_predicted < pdu_len)
+   return 0;
 
if (bucket_predicted <= fc->bucket_size_max) {
/* the bucket is not full yet, we can pass the packet */
fc->bucket_counter = bucket_predicted;
-   goto pass;
+   return 0;
}
 
/* bucket is full, PDU needs to be delayed */
return 1;
-
-pass:
-   /* if we reach here, the PDU can pass */
-   return 0;
 }
 
 /* output callback for BVC flow control */

-- 
To view, visit https://gerrit.osmocom.org/2878
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I0c2aaf1ab462c923d62232f1a63fae1e4eb18b4d
Gerrit-PatchSet: 2
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max 


libosmocore[master]: gb/gprs_bssgp.c: avoid valueless goto usage

2017-06-13 Thread Harald Welte

Patch Set 1: Code-Review+2

-- 
To view, visit https://gerrit.osmocom.org/2878
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I0c2aaf1ab462c923d62232f1a63fae1e4eb18b4d
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max 
Gerrit-HasComments: No


libosmocore[master]: gb/gprs_bssgp.c: avoid valueless goto usage

2017-06-12 Thread Max

Patch Set 1: Code-Review+1

-- 
To view, visit https://gerrit.osmocom.org/2878
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I0c2aaf1ab462c923d62232f1a63fae1e4eb18b4d
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max 
Gerrit-HasComments: No


[PATCH] libosmocore[master]: gb/gprs_bssgp.c: avoid valueless goto usage

2017-06-11 Thread Vadim Yanitskiy

Review at  https://gerrit.osmocom.org/2878

gb/gprs_bssgp.c: avoid valueless goto usage

Change-Id: I0c2aaf1ab462c923d62232f1a63fae1e4eb18b4d
---
M src/gb/gprs_bssgp.c
1 file changed, 3 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/78/2878/1

diff --git a/src/gb/gprs_bssgp.c b/src/gb/gprs_bssgp.c
index aa6e37b..142f589 100644
--- a/src/gb/gprs_bssgp.c
+++ b/src/gb/gprs_bssgp.c
@@ -698,24 +698,17 @@
/* ... and subtract the number of leaked bytes */
bucket_predicted -= leaked;
 
-   if (bucket_predicted < pdu_len) {
-   /* this is just to make sure the bucket doesn't underflow */
-   bucket_predicted = pdu_len;
-   goto pass;
-   }
+   if (bucket_predicted < pdu_len)
+   return 0;
 
if (bucket_predicted <= fc->bucket_size_max) {
/* the bucket is not full yet, we can pass the packet */
fc->bucket_counter = bucket_predicted;
-   goto pass;
+   return 0;
}
 
/* bucket is full, PDU needs to be delayed */
return 1;
-
-pass:
-   /* if we reach here, the PDU can pass */
-   return 0;
 }
 
 /* output callback for BVC flow control */

-- 
To view, visit https://gerrit.osmocom.org/2878
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0c2aaf1ab462c923d62232f1a63fae1e4eb18b4d
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Vadim Yanitskiy