<p style="white-space: pre-wrap; word-wrap: break-word;">Since it was decided to merge this bomb 'as-is', let's move it forward. Please consider my comments as the points for further improvements and follow-up patches, not as merge-blockers.</p><p><a href="https://gerrit.osmocom.org/13137">View Change</a></p><p>5 comments:</p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.osmocom.org/#/c/13137/9/src/libmsc/call_leg.c">File src/libmsc/call_leg.c:</a></p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/#/c/13137/9/src/libmsc/call_leg.c@78">Patch Set #9, Line 78:</a> <code style="font-family:monospace,monospace">talloc_zero</code></p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><p style="white-space: pre-wrap; word-wrap: break-word;">The talloc API does not provide a macro similar to talloc_zero() that names the struct [...]</p></blockquote><p style="white-space: pre-wrap; word-wrap: break-word;">Of course it does, see talloc(). talloc_zero() is just a wrapper around talloc() + memset().</p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><p style="white-space: pre-wrap; word-wrap: break-word;">What is the reason for this statement, optimization?</p></blockquote><p style="white-space: pre-wrap; word-wrap: break-word;">Exactly. I'm not sure if compiler can optimize out such double zero-initialization.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/#/c/13137/9/src/libmsc/call_leg.c@158">Patch Set #9, Line 158:</a> <code style="font-family:monospace,monospace">ase CALL_LEG</code></p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><p style="white-space: pre-wrap; word-wrap: break-word;">it is to clarify the type of the data argument [...]</p></blockquote><pre style="font-family: monospace,monospace; white-space: pre-wrap;">  osmo_fsm_inst_dispatch(fi->proc.parent, cl->parent_event_rtp_addr_available, (struct rtp_stream *) rtps);</pre></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/#/c/13137/9/src/libmsc/call_leg.c@178">Patch Set #9, Line 178:</a> <code style="font-family:monospace,monospace"></code></p><p style="white-space: pre-wrap; word-wrap: break-word;">Also same opinion, variable is not needed for that:</p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">  osmo_fsm_inst_dispatch(fi->proc.parent, cl->parent_event_rtp_complete, (struct call_leg *) cl);</pre><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><p style="white-space: pre-wrap; word-wrap: break-word;">prefer to keep for some degree of "type safety"</p></blockquote><p style="white-space: pre-wrap; word-wrap: break-word;">TBH, I dont't see any "type safety" here. This just indicates the original type of the pointer to code readers.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/#/c/13137/9/src/libmsc/call_leg.c@290">Patch Set #9, Line 290:</a> <code style="font-family:monospace,monospace"></code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">the critical difference is that it calls call_leg_rtp_alloc() only if it hasn't been called yet on t […]</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Well, call_leg_rtp_alloc() also would just return 0 if it was already called for a given RTP stream. I still think that this function should be merged into call_leg_rtp_alloc().</p></li></ul></li><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.osmocom.org/#/c/13137/9/src/libmsc/gsm_04_08.c">File src/libmsc/gsm_04_08.c:</a></p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/#/c/13137/9/src/libmsc/gsm_04_08.c@156">Patch Set #9, Line 156:</a> <code style="font-family:monospace,monospace">DEBUGP</code></p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><p style="white-space: pre-wrap; word-wrap: break-word;">This is legacy logging, not sure if we really need to change all of it now?</p></blockquote><p style="white-space: pre-wrap; word-wrap: break-word;">You're already changing some DEBUGP / LOGP statements to LOG_MSC_A_CAT() in this patch. I would rather change all of them and don't leave this work to somebody else...</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.osmocom.org/13137">change 13137</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/13137"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-msc </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: comment </div>
<div style="display:none"> Gerrit-Change-Id: I27e4988e0371808b512c757d2b52ada1615067bd </div>
<div style="display:none"> Gerrit-Change-Number: 13137 </div>
<div style="display:none"> Gerrit-PatchSet: 18 </div>
<div style="display:none"> Gerrit-Owner: Neels Hofmeyr <nhofmeyr@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Harald Welte <laforge@gnumonks.org> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder (1000002) </div>
<div style="display:none"> Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Vadim Yanitskiy <axilirator@gmail.com> </div>
<div style="display:none"> Gerrit-CC: Pau Espin Pedrol <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-Comment-Date: Wed, 08 May 2019 10:13:38 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>
<div style="display:none"> Gerrit-HasLabels: No </div>