[GitHub] [mynewt-nimble] wnnwoo commented on a change in pull request #731: update ble_ll_sched_adv_reschedule

2020-02-03 Thread GitBox
wnnwoo commented on a change in pull request #731: update 
ble_ll_sched_adv_reschedule
URL: https://github.com/apache/mynewt-nimble/pull/731#discussion_r374047122
 
 

 ##
 File path: nimble/controller/src/ble_ll_sched.c
 ##
 @@ -961,20 +966,25 @@ ble_ll_sched_adv_reschedule(struct ble_ll_sched_item 
*sch, uint32_t *start,
  * with original duration.
  */
 before = NULL;
-orig_start = sch->start_time;
+sch->start_time = orig_start;
 entry = start_overlap;
 sch->end_time = sch->start_time + duration;
 while (1) {
 next_sch = entry->link.tqe_next;
 if ((int32_t)(sch->end_time - entry->start_time) <= 0) {
-rand_ticks = entry->start_time - sch->end_time;
-before = entry;
-TAILQ_INSERT_BEFORE(before, sch, link);
-break;
-} else {
-sch->start_time = entry->end_time;
-sch->end_time = sch->start_time + duration;
 
 Review comment:
   understood.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [mynewt-nimble] wnnwoo commented on a change in pull request #731: update ble_ll_sched_adv_reschedule

2020-01-15 Thread GitBox
wnnwoo commented on a change in pull request #731: update 
ble_ll_sched_adv_reschedule
URL: https://github.com/apache/mynewt-nimble/pull/731#discussion_r367169033
 
 

 ##
 File path: nimble/controller/src/ble_ll_sched.c
 ##
 @@ -961,20 +966,25 @@ ble_ll_sched_adv_reschedule(struct ble_ll_sched_item 
*sch, uint32_t *start,
  * with original duration.
  */
 before = NULL;
-orig_start = sch->start_time;
+sch->start_time = orig_start;
 entry = start_overlap;
 sch->end_time = sch->start_time + duration;
 while (1) {
 next_sch = entry->link.tqe_next;
 if ((int32_t)(sch->end_time - entry->start_time) <= 0) {
-rand_ticks = entry->start_time - sch->end_time;
-before = entry;
-TAILQ_INSERT_BEFORE(before, sch, link);
-break;
-} else {
-sch->start_time = entry->end_time;
-sch->end_time = sch->start_time + duration;
 
 Review comment:
   but there is issue in the handle for the insert after this moving.
   The sch may overlap next_sch  **if (sch->end_time >next_sch->start_time)**
   ```
   } else {
   if (next_sch == NULL) {
   TAILQ_INSERT_TAIL(_ble_ll_sched_q, sch, link);
   } else {
   TAILQ_INSERT_BEFORE(next_sch, sch, link);
   }
   }
   ```


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [mynewt-nimble] wnnwoo commented on a change in pull request #731: update ble_ll_sched_adv_reschedule

2020-01-15 Thread GitBox
wnnwoo commented on a change in pull request #731: update 
ble_ll_sched_adv_reschedule
URL: https://github.com/apache/mynewt-nimble/pull/731#discussion_r367169033
 
 

 ##
 File path: nimble/controller/src/ble_ll_sched.c
 ##
 @@ -961,20 +966,25 @@ ble_ll_sched_adv_reschedule(struct ble_ll_sched_item 
*sch, uint32_t *start,
  * with original duration.
  */
 before = NULL;
-orig_start = sch->start_time;
+sch->start_time = orig_start;
 entry = start_overlap;
 sch->end_time = sch->start_time + duration;
 while (1) {
 next_sch = entry->link.tqe_next;
 if ((int32_t)(sch->end_time - entry->start_time) <= 0) {
-rand_ticks = entry->start_time - sch->end_time;
-before = entry;
-TAILQ_INSERT_BEFORE(before, sch, link);
-break;
-} else {
-sch->start_time = entry->end_time;
-sch->end_time = sch->start_time + duration;
 
 Review comment:
   but there is issue in the handle for the insert after this moving.
   The sch may overlap next_sch  **if (sch->end_time >next_sch->start_time)**
   ```
   } else {
   if (next_sch == NULL) {
   TAILQ_INSERT_TAIL(_ble_ll_sched_q, sch, link);
   } else {
   TAILQ_INSERT_BEFORE(next_sch, sch, link);
   }
   }
   ```


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [mynewt-nimble] wnnwoo commented on a change in pull request #731: update ble_ll_sched_adv_reschedule

2020-01-15 Thread GitBox
wnnwoo commented on a change in pull request #731: update 
ble_ll_sched_adv_reschedule
URL: https://github.com/apache/mynewt-nimble/pull/731#discussion_r367169033
 
 

 ##
 File path: nimble/controller/src/ble_ll_sched.c
 ##
 @@ -961,20 +966,25 @@ ble_ll_sched_adv_reschedule(struct ble_ll_sched_item 
*sch, uint32_t *start,
  * with original duration.
  */
 before = NULL;
-orig_start = sch->start_time;
+sch->start_time = orig_start;
 entry = start_overlap;
 sch->end_time = sch->start_time + duration;
 while (1) {
 next_sch = entry->link.tqe_next;
 if ((int32_t)(sch->end_time - entry->start_time) <= 0) {
-rand_ticks = entry->start_time - sch->end_time;
-before = entry;
-TAILQ_INSERT_BEFORE(before, sch, link);
-break;
-} else {
-sch->start_time = entry->end_time;
-sch->end_time = sch->start_time + duration;
 
 Review comment:
   but there is issue in the handle for the insert after this moving.
   The sch may overlap next_sch  **if (sch->end_time >next_sch->start_time)**
   ```
   } else {
   if (next_sch == NULL) {
   TAILQ_INSERT_TAIL(_ble_ll_sched_q, sch, link);
   } else {
   **TAILQ_INSERT_BEFORE(next_sch, sch, link);**
   }
   }
   ```


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [mynewt-nimble] wnnwoo commented on a change in pull request #731: update ble_ll_sched_adv_reschedule

2020-01-15 Thread GitBox
wnnwoo commented on a change in pull request #731: update 
ble_ll_sched_adv_reschedule
URL: https://github.com/apache/mynewt-nimble/pull/731#discussion_r367169033
 
 

 ##
 File path: nimble/controller/src/ble_ll_sched.c
 ##
 @@ -961,20 +966,25 @@ ble_ll_sched_adv_reschedule(struct ble_ll_sched_item 
*sch, uint32_t *start,
  * with original duration.
  */
 before = NULL;
-orig_start = sch->start_time;
+sch->start_time = orig_start;
 entry = start_overlap;
 sch->end_time = sch->start_time + duration;
 while (1) {
 next_sch = entry->link.tqe_next;
 if ((int32_t)(sch->end_time - entry->start_time) <= 0) {
-rand_ticks = entry->start_time - sch->end_time;
-before = entry;
-TAILQ_INSERT_BEFORE(before, sch, link);
-break;
-} else {
-sch->start_time = entry->end_time;
-sch->end_time = sch->start_time + duration;
 
 Review comment:
   but there is issue in the handle for the below condition.
   The sch may overlap next_sch if next_sch is not NULL **if (sch->end_time 
>next_sch->start_time)**
   ```
   } else {
   if (next_sch == NULL) {
   TAILQ_INSERT_TAIL(_ble_ll_sched_q, sch, link);
   } else {
   TAILQ_INSERT_BEFORE(next_sch, sch, link);
   }
   }
   ```


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [mynewt-nimble] wnnwoo commented on a change in pull request #731: update ble_ll_sched_adv_reschedule

2020-01-15 Thread GitBox
wnnwoo commented on a change in pull request #731: update 
ble_ll_sched_adv_reschedule
URL: https://github.com/apache/mynewt-nimble/pull/731#discussion_r367168211
 
 

 ##
 File path: nimble/controller/src/ble_ll_sched.c
 ##
 @@ -961,20 +966,25 @@ ble_ll_sched_adv_reschedule(struct ble_ll_sched_item 
*sch, uint32_t *start,
  * with original duration.
  */
 before = NULL;
-orig_start = sch->start_time;
+sch->start_time = orig_start;
 entry = start_overlap;
 sch->end_time = sch->start_time + duration;
 while (1) {
 next_sch = entry->link.tqe_next;
 if ((int32_t)(sch->end_time - entry->start_time) <= 0) {
-rand_ticks = entry->start_time - sch->end_time;
 
 Review comment:
   understood.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services