laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bsc/+/31118 )
Change subject: Try to work around coverity false positives in macros ......................................................................
Try to work around coverity false positives in macros
we have some macros that may at times have signed arguments, and at other times unsigned. Checking for <= 0 is not a bug in this case.
Change-Id: I10e60b20c6f8092cf1ce09ebe501e739fd4a9479 Related: CID#272993, CID#272992 (and many others) --- M include/osmocom/bsc/gsm_data.h 1 file changed, 2 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/18/31118/1
diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h index 44a9d5e..5d52f9b 100644 --- a/include/osmocom/bsc/gsm_data.h +++ b/include/osmocom/bsc/gsm_data.h @@ -495,8 +495,10 @@ * * These macros convert from n to the other representations: */ +// coverity[unsigned_compare:FALSE] #define ALG_A5_NR_TO_RSL(A5_N) ((A5_N) >= 0 ? (A5_N)+1 : 0) #define ALG_A5_NR_TO_BSSAP(A5_N) ALG_A5_NR_TO_RSL(A5_N) +// coverity[unsigned_compare:FALSE] #define ALG_A5_NR_TO_PERM_ALG_BITS(A5_N) ((A5_N) >= 0 ? 1<<(A5_N) : 0)
/* Up to 16 SI2quater are multiplexed; each fits 3 EARFCNS, so the practical maximum is 3*16.