diff options
author | Neels Hofmeyr <nhofmeyr@sysmocom.de> | 2015-11-27 00:05:56 +0100 |
---|---|---|
committer | Neels Hofmeyr <nhofmeyr@sysmocom.de> | 2015-12-03 11:40:18 +0100 |
commit | f977320736fe15ffc3a0e6110bec7823a57c65ee (patch) | |
tree | 9b89e3e5b034574be13a5568282723081145e918 /openbsc/include | |
parent | ba9e9f63bce9a868b8b3e15adca616ac4dec9414 (diff) |
gtphub: cosmetic: for_each_side,_plane macros.
Simplify looping over sides and planes. I'm tired of typing the same for
loops all the time.
Sponsored-by: On-Waves ehi
Diffstat (limited to 'openbsc/include')
-rw-r--r-- | openbsc/include/openbsc/gtphub.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/openbsc/include/openbsc/gtphub.h b/openbsc/include/openbsc/gtphub.h index cc204ef7e..2d9d39000 100644 --- a/openbsc/include/openbsc/gtphub.h +++ b/openbsc/include/openbsc/gtphub.h @@ -141,6 +141,10 @@ enum gtphub_side_idx { GTPH_SIDE_N }; +#define for_each_side(I) for (I = 0; I < GTPH_SIDE_N; I++) +#define for_each_plane(I) for (I = 0; I < GTPH_PLANE_N; I++) +#define for_each_side_and_plane(I,J) for_each_side(I) for_each_plane(J) + static inline int other_side_idx(int side_idx) { return (side_idx + 1) & 1; |