[Asterisk-code-review] openr2(3/6): Convert r2links to standard Asterisk AST_LIST* (...asterisk[13])

Kevin Harwell asteriskteam at digium.com
Fri Jul 19 15:07:48 CDT 2019


Kevin Harwell has posted comments on this change. ( https://gerrit.asterisk.org/c/asterisk/+/11535 )

Change subject: openr2(3/6): Convert r2links to standard Asterisk AST_LIST*
......................................................................


Patch Set 2: Code-Review-1

(2 comments)

https://gerrit.asterisk.org/#/c/11535/2/channels/chan_dahdi.c 
File channels/chan_dahdi.c:

https://gerrit.asterisk.org/#/c/11535/2/channels/chan_dahdi.c@11949 
PS2, Line 11949: 		struct r2link_entry *tmp = NULL;
               : 		int new_idx = r2links_count + 1;
               : 		int i;
               : 		for (i = 1; i <= r2links_count; i++) {
               : 			int i_unused = 1;
               : 			AST_LIST_TRAVERSE(&r2links, tmp, list) {
               : 				if (i == tmp->mfcr2.index) {
               : 					i_unused = 0;
               : 					break;
               : 				}
               : 			}
               : 			if (i_unused) {
               : 				new_idx = i;
               : 				break;
               : 			}
               : 		}
This loop appears to be unneeded. If the index needs to be unique, and is always set on a new link then  you can just set the index to rlinks_count and forego the look up loop. I may be missing something but I don't see how i_unused would ever be set to zero?


https://gerrit.asterisk.org/#/c/11535/2/channels/chan_dahdi.c@19466 
PS2, Line 19466: 		int x = 0;
variable 'x' appears to be unused aside from incrementing below, so can be removed.



-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/11535
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Change-Id: Ibcb2401515a58782a1488c0b9efbed201c3f3a17
Gerrit-Change-Number: 11535
Gerrit-PatchSet: 2
Gerrit-Owner: Oron Peled <oron.peled at xorcom.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-Reviewer: Tzafrir Cohen <tzafrir.cohen at xorcom.com>
Gerrit-Comment-Date: Fri, 19 Jul 2019 20:07:48 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20190719/06aeb246/attachment.html>


More information about the asterisk-code-review mailing list