Merge ~info-martin-konrad/epics-base:fix-wrong-order-phas into ~epics-core/epics-base/+git/epics-base:3.15

Proposed by Martin Konrad
Status: Merged
Approved by: Andrew Johnson
Approved revision: 228ad79b7a33ec61cdfcebce9e357a019ead6bb7
Merged at revision: 228ad79b7a33ec61cdfcebce9e357a019ead6bb7
Proposed branch: ~info-martin-konrad/epics-base:fix-wrong-order-phas
Merge into: ~epics-core/epics-base/+git/epics-base:3.15
Diff against target: 29 lines (+3/-6)
1 file modified
src/ioc/db/dbScan.c (+3/-6)
Reviewer Review Type Date Requested Status
Andrew Johnson Approve
Review via email: mp+392190@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Andrew Johnson (anj) wrote :

Looks good, thanks Martin!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/src/ioc/db/dbScan.c b/src/ioc/db/dbScan.c
2index dd283f7..5fc264d 100644
3--- a/src/ioc/db/dbScan.c
4+++ b/src/ioc/db/dbScan.c
5@@ -992,13 +992,10 @@ static void addToList(struct dbCommon *precord, scan_list *psl)
6 pse->pscan_list = psl;
7 ptemp = (scan_element *)ellLast(&psl->list);
8 while (ptemp) {
9- if (ptemp->precord->phas <= precord->phas) {
10- ellInsert(&psl->list, &ptemp->node, &pse->node);
11- break;
12- }
13+ if (ptemp->precord->phas <= precord->phas) break;
14 ptemp = (scan_element *)ellPrevious(&ptemp->node);
15 }
16- if (ptemp == NULL) ellAdd(&psl->list, (void *)pse);
17+ ellInsert(&psl->list, (ptemp ? &ptemp->node : NULL), &pse->node);
18 psl->modified = TRUE;
19 epicsMutexUnlock(psl->lock);
20 }
21@@ -1024,7 +1021,7 @@ static void deleteFromList(struct dbCommon *precord, scan_list *psl)
22 return;
23 }
24 pse->pscan_list = NULL;
25- ellDelete(&psl->list, (void *)pse);
26+ ellDelete(&psl->list, &pse->node);
27 psl->modified = TRUE;
28 epicsMutexUnlock(psl->lock);
29 }

Subscribers

People subscribed via source and target branches