Change in osmo-bsc[master]: replace ts_*_for_each_lchan() with ts_for_n_lchans()

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

neels gerrit-no-reply at lists.osmocom.org
Tue May 25 15:17:01 UTC 2021


neels has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/24372 )

Change subject: replace ts_*_for_each_lchan() with ts_for_n_lchans()
......................................................................


Patch Set 3:

(3 comments)

https://gerrit.osmocom.org/c/osmo-bsc/+/24372/3/include/osmocom/bsc/gsm_data.h 
File include/osmocom/bsc/gsm_data.h:

https://gerrit.osmocom.org/c/osmo-bsc/+/24372/3/include/osmocom/bsc/gsm_data.h@567 
PS3, Line 567: 	     ((lchan - (ts)->lchan) < ARRAY_SIZE((ts)->lchan)) \
> Are you sure this is correct? AFAIR (lchan - (ts)->lchan) is a pointer distance in bytes, not in ele […]
you *always* get a distance in pointer-type-sizeof. A distance in bytes will only be returned for e.g. uint8_t*. For gsm_lchan* you always get a distance in array indexes. I and we and everyone is using that all over the place and I am absolutely positively sure.

x = &lchan[3] 
is identical to
x = lchan + 3


https://gerrit.osmocom.org/c/osmo-bsc/+/24372/3/include/osmocom/bsc/gsm_data.h@568 
PS3, Line 568: 	     && lchan->fi \
> So if  an lchan has no fi, you early exit the loop? does that make sense? you should simply skip tha […]
I'd like that, but we can't skip in a for loop macro like this : (

And actually there will never be a "fi gap" in the lchan array.
As soon as one NULL fi is encountered, the rest of them will also be NULL.


https://gerrit.osmocom.org/c/osmo-bsc/+/24372/3/include/osmocom/bsc/gsm_data.h@569 
PS3, Line 569: 	     && ((lchan - (ts)->lchan) < (N)); \
> Same here, I'd say that's a distance in bytes, not in elements.
didn't expect this from you Pau ; )  ; )  ; )



-- 
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/24372
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Ib2c6baf73a81ba371143ba5adc912aef6f79238d
Gerrit-Change-Number: 24372
Gerrit-PatchSet: 3
Gerrit-Owner: neels <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-Comment-Date: Tue, 25 May 2021 15:17:01 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: pespin <pespin at sysmocom.de>
Gerrit-MessageType: comment
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210525/8bef52f2/attachment.htm>


More information about the gerrit-log mailing list