[GitHub] [mynewt-mcumgr] sjanc commented on pull request #108: mgmt: Add support for un-registering a group along with the same support in img_mgmt

2021-02-11 Thread GitBox


sjanc commented on pull request #108:
URL: https://github.com/apache/mynewt-mcumgr/pull/108#issuecomment-777418259


   https://travis-ci.org/github/apache/mynewt-nimble/jobs/758517372
   
   this breaks build...



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




[GitHub] [mynewt-mcumgr] utzig commented on pull request #108: mgmt: Add support for un-registering a group along with the same support in img_mgmt

2021-02-11 Thread GitBox


utzig commented on pull request #108:
URL: https://github.com/apache/mynewt-mcumgr/pull/108#issuecomment-777423490


   > https://travis-ci.org/github/apache/mynewt-nimble/jobs/758517372
   > 
   > this breaks build...
   
   About time CI is added to this repo...



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




[GitHub] [mynewt-mcumgr] utzig commented on a change in pull request #108: mgmt: Add support for un-registering a group along with the same support in img_mgmt

2021-02-11 Thread GitBox


utzig commented on a change in pull request #108:
URL: https://github.com/apache/mynewt-mcumgr/pull/108#discussion_r574476913



##
File path: mgmt/src/mgmt.c
##
@@ -71,6 +71,31 @@ mgmt_streamer_free_buf(struct mgmt_streamer *streamer, void 
*buf)
 streamer->cfg->free_buf(buf, streamer->cb_arg);
 }
 
+void
+mgmt_unregister_group(struct mgmt_group *group)
+{
+struct mgmt_group *curr = mgmt_group_list, *prev;
+
+if (curr && curr == group) {

Review comment:
   There is no need to test `curr` here because if it is NULL it won't be 
equal to `group`

##
File path: mgmt/src/mgmt.c
##
@@ -71,6 +71,31 @@ mgmt_streamer_free_buf(struct mgmt_streamer *streamer, void 
*buf)
 streamer->cfg->free_buf(buf, streamer->cb_arg);
 }
 
+void
+mgmt_unregister_group(struct mgmt_group *group)
+{
+struct mgmt_group *curr = mgmt_group_list, *prev;

Review comment:
   Please check that `group` is not NULL

##
File path: mgmt/src/mgmt.c
##
@@ -71,6 +71,31 @@ mgmt_streamer_free_buf(struct mgmt_streamer *streamer, void 
*buf)
 streamer->cfg->free_buf(buf, streamer->cb_arg);
 }
 
+void
+mgmt_unregister_group(struct mgmt_group *group)
+{
+struct mgmt_group *curr = mgmt_group_list, *prev;
+
+if (curr && curr == group) {
+mgmt_group_list = curr->mg_next;
+return;
+}
+
+while (curr && curr != group) {
+prev = curr;

Review comment:
   If `curr` is valid and equal to `group`, `prev` will remain 
uninitialized.





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




[GitHub] [mynewt-mcumgr] de-nordic opened a new pull request #109: mgmt: Uninitialized prev pointer may cause compilation warnings

2021-02-11 Thread GitBox


de-nordic opened a new pull request #109:
URL: https://github.com/apache/mynewt-mcumgr/pull/109


   Seen while compiling mcumgr with Zephyr: compilation claims possible
   dereferencing of uninitialized prev pointer.
   This is not possible situation as the dereferencing of prev depends on
   curr pointer not being null, otherwise the code will exit prior to "faulty"
   dereference.
   
   Signed-off-by: Dominik Ermel 



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




[GitHub] [mynewt-mcumgr] utzig commented on a change in pull request #109: mgmt: Uninitialized prev pointer may cause compilation warnings

2021-02-11 Thread GitBox


utzig commented on a change in pull request #109:
URL: https://github.com/apache/mynewt-mcumgr/pull/109#discussion_r574487942



##
File path: mgmt/src/mgmt.c
##
@@ -74,7 +74,7 @@ mgmt_streamer_free_buf(struct mgmt_streamer *streamer, void 
*buf)
 void
 mgmt_unregister_group(struct mgmt_group *group)
 {
-struct mgmt_group *curr = mgmt_group_list, *prev;
+struct mgmt_group *curr = mgmt_group_list, *prev = NULL;

Review comment:
   This might fix the warning but it still could break when doing the 
`prev->mg_next = curr->mg_next;` below. I submitted a review for the original 
PR and would prefer a fix like suggested.





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




[GitHub] [mynewt-mcumgr] de-nordic opened a new pull request #110: Use img_mgmt_find_best_area_id to select upload slot instead of FLASH_AREA_ID

2021-02-11 Thread GitBox


de-nordic opened a new pull request #110:
URL: https://github.com/apache/mynewt-mcumgr/pull/110


   The mcumgr should relay on single decision point for upload flash area 
selection; instead the `img_mgmt_find_best_area_id` and FLASH_AREA_ID macros 
were used for similar purpose through the code, even though 
`img_mgmt_find_best_area_id` is more restrictive and may not agree with 
`FLASH_AREA_ID`.
   



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




[GitHub] [mynewt-nimble] KKopyscinski commented on pull request #829: nimble/host: check read permission in ble_att_svr_build_read_mult_rsp

2021-02-11 Thread GitBox


KKopyscinski commented on pull request #829:
URL: https://github.com/apache/mynewt-nimble/pull/829#issuecomment-777464604


   @rymanluk Could you review this?



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




[GitHub] [mynewt-nimble] KKopyscinski commented on pull request #900: ble_gatt: Add subscribing helper functions

2021-02-11 Thread GitBox


KKopyscinski commented on pull request #900:
URL: https://github.com/apache/mynewt-nimble/pull/900#issuecomment-777464546


   @rymanluk Could you review this?



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




[GitHub] [mynewt-mcumgr] de-nordic closed pull request #109: mgmt: Uninitialized prev pointer may cause compilation warnings

2021-02-11 Thread GitBox


de-nordic closed pull request #109:
URL: https://github.com/apache/mynewt-mcumgr/pull/109


   



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




[GitHub] [mynewt-mcumgr] de-nordic commented on pull request #109: mgmt: Uninitialized prev pointer may cause compilation warnings

2021-02-11 Thread GitBox


de-nordic commented on pull request #109:
URL: https://github.com/apache/mynewt-mcumgr/pull/109#issuecomment-777474514


   @utzig I am leaving that to you as you have alread reported your concerns 
with the original code.



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




[GitHub] [mynewt-mcumgr] utzig opened a new pull request #111: Fix unitialized variable warning

2021-02-11 Thread GitBox


utzig opened a new pull request #111:
URL: https://github.com/apache/mynewt-mcumgr/pull/111


   Fix usage of prev when curr==group, and add checking for invalid parameter. 
Fix issues found after #108 



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




[GitHub] [mynewt-core] utzig opened a new pull request #2477: Enable Mbed TLS self-tests which were not running

2021-02-11 Thread GitBox


utzig opened a new pull request #2477:
URL: https://github.com/apache/mynewt-core/pull/2477


   Enable extra self-tests from Mbed TLS. Added ARIA, CMAC, MD2, MD4 and J-PAKE 
tests. The test order was sorted for easier reading.



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




[GitHub] [mynewt-core] apache-mynewt-bot commented on pull request #2477: Enable Mbed TLS self-tests which were not running

2021-02-11 Thread GitBox


apache-mynewt-bot commented on pull request #2477:
URL: https://github.com/apache/mynewt-core/pull/2477#issuecomment-777511455


   
   
   
   ## Style check summary
   
    No suggestions at this time!
   



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




[GitHub] [mynewt-core] utzig opened a new pull request #2478: Allow Mbed TLS ECP code to use alt implementations

2021-02-11 Thread GitBox


utzig opened a new pull request #2478:
URL: https://github.com/apache/mynewt-core/pull/2478


   ECP code can be accelerated when proper short-weierstrass and bignum HW 
acceleration are present. This adds extra flags to toggle enabling such HW to 
take over the EC point operations.
   
   Must be rebased over #2477 



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




[GitHub] [mynewt-core] apache-mynewt-bot commented on pull request #2478: Allow Mbed TLS ECP code to use alt implementations

2021-02-11 Thread GitBox


apache-mynewt-bot commented on pull request #2478:
URL: https://github.com/apache/mynewt-core/pull/2478#issuecomment-777529332


   
   
   
   ## Style check summary
   
    No suggestions at this time!
   



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




[GitHub] [mynewt-mcumgr] de-nordic commented on pull request #110: Use img_mgmt_find_best_area_id to select upload slot instead of FLASH_AREA_ID

2021-02-11 Thread GitBox


de-nordic commented on pull request #110:
URL: https://github.com/apache/mynewt-mcumgr/pull/110#issuecomment-777544482


   @nvlsianpu , @utzig Please check.
   The Zephyr test commit is here: 
https://github.com/zephyrproject-rtos/zephyr/pull/32215



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




[GitHub] [mynewt-nimble] apache-mynewt-bot commented on pull request #872: nimble/porting: sync with core

2021-02-11 Thread GitBox


apache-mynewt-bot commented on pull request #872:
URL: https://github.com/apache/mynewt-nimble/pull/872#issuecomment-777297740


   
   
   
   ## Style check summary
   
   ### Our coding style is 
[here!](https://github.com/apache/mynewt-core/blob/master/CODING_STANDARDS.md)
   
   
    porting/nimble/include/os/queue.h
   
   
   ```diff
   @@ -111,18 +111,18 @@
/*
 * Singly-linked List declarations.
 */
   -#define SLIST_HEAD(name, type)  \
   -struct name {   \
   -struct type *slh_first; /* first element */ \
   -}
   -
   -#define SLIST_HEAD_INITIALIZER(head)\
   +#define SLIST_HEAD(name, type)  \
   +struct name {   \
   +struct type *slh_first; /* first element */ \
   +}
   +
   +#define SLIST_HEAD_INITIALIZER(head)\
{ NULL }

   -#define SLIST_ENTRY(type)   \
   -struct {\
   -struct type *sle_next;  /* next element */  \
   -}
   +#define SLIST_ENTRY(type)   \
   +struct {\
   +struct type *sle_next; /* next element */  \
   +}

/*
 * Singly-linked List functions.
   ```
   
   
   
    porting/nimble/src/hal_timer.c
   
   
   ```diff
   @@ -74,34 +74,34 @@

static const struct nrf52_hal_timer *nrf52_hal_timers[NRF52_HAL_TIMER_MAX] 
= {
#if MYNEWT_VAL(TIMER_0)
   -_hal_timer0,
   +_hal_timer0,
#else
   -NULL,
   +NULL,
#endif
#if MYNEWT_VAL(TIMER_1)
   -_hal_timer1,
   +_hal_timer1,
#else
   -NULL,
   +NULL,
#endif
#if MYNEWT_VAL(TIMER_2)
   -_hal_timer2,
   +_hal_timer2,
#else
   -NULL,
   +NULL,
#endif
#if MYNEWT_VAL(TIMER_3)
   -_hal_timer3,
   +_hal_timer3,
#else
   -NULL,
   +NULL,
#endif
#if MYNEWT_VAL(TIMER_4)
   -_hal_timer4,
   +_hal_timer4,
#else
   -NULL,
   +NULL,
#endif
#if MYNEWT_VAL(TIMER_5)
   -_hal_timer5
   +_hal_timer5
#else
   -NULL
   +NULL
#endif
};

   @@ -480,51 +480,51 @@

switch (timer_num) {
#if MYNEWT_VAL(TIMER_0)
   -case 0:
   +case 0:
irq_num = TIMER0_IRQn;
hwtimer = NRF_TIMER0;
irq_isr = nrf52_timer0_irq_handler;
break;
#endif
#if MYNEWT_VAL(TIMER_1)
   -case 1:
   +case 1:
irq_num = TIMER1_IRQn;
hwtimer = NRF_TIMER1;
irq_isr = nrf52_timer1_irq_handler;
break;
#endif
#if MYNEWT_VAL(TIMER_2)
   -case 2:
   +case 2:
irq_num = TIMER2_IRQn;
hwtimer = NRF_TIMER2;
irq_isr = nrf52_timer2_irq_handler;
break;
#endif
#if MYNEWT_VAL(TIMER_3)
   -case 3:
   +case 3:
irq_num = TIMER3_IRQn;
hwtimer = NRF_TIMER3;
irq_isr = nrf52_timer3_irq_handler;
break;
#endif
#if MYNEWT_VAL(TIMER_4)
   -case 4:
   +case 4:
irq_num = TIMER4_IRQn;
hwtimer = NRF_TIMER4;
irq_isr = nrf52_timer4_irq_handler;
break;
#endif
#if MYNEWT_VAL(TIMER_5)
   -case 5:
   -irq_num = RTC0_IRQn;
   -hwtimer = NRF_RTC0;
   -irq_isr = nrf52_timer5_irq_handler;
   -bsptimer->tmr_rtc = 1;
   -break;
   -#endif
   -default:
   -hwtimer = NULL;
   -break;
   +case 5:
   +irq_num = RTC0_IRQn;
   +hwtimer = NRF_RTC0;
   +irq_isr = nrf52_timer5_irq_handler;
   +bsptimer->tmr_rtc = 1;
   +break;
   +#endif
   +default:
   +hwtimer = NULL;
   +break;
}

if (hwtimer == NULL) {
   @@ -542,7 +542,7 @@

return 0;

   -err:
   +err:
return rc;
}

   @@ -674,7 +674,7 @@

return 0;

   -err:
   +err:
return rc;
}

   @@ -719,7 +719,7 @@
#endif
__HAL_ENABLE_INTERRUPTS(ctx);

   -err:
   +err:
return rc;
}

   @@ -744,7 +744,7 @@
resolution = 10 / bsptimer->tmr_freq;
return resolution;

   -err:
   +err:
rc = 0;
return rc;
}
   @@ -775,7 +775,7 @@
return tcntr;

/* Assert here since there is no invalid return code */
   -err:
   +err:
assert(0);
rc = 0;
return rc;
   @@ -829,7 +829,7 @@

rc = 0;

   -err:
   +err:
return rc;
}

   ```
   
   



[GitHub] [mynewt-nimble] apache-mynewt-bot removed a comment on pull request #872: nimble/porting: sync with core

2021-02-11 Thread GitBox


apache-mynewt-bot removed a comment on pull request #872:
URL: https://github.com/apache/mynewt-nimble/pull/872#issuecomment-777244550


   
   
   
   ## Style check summary
   
    No suggestions at this time!
   



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




[GitHub] [mynewt-nimble] apache-mynewt-bot commented on pull request #872: nimble/porting: sync with core

2021-02-11 Thread GitBox


apache-mynewt-bot commented on pull request #872:
URL: https://github.com/apache/mynewt-nimble/pull/872#issuecomment-777304771


   
   
   
   ## Style check summary
   
   ### Our coding style is 
[here!](https://github.com/apache/mynewt-core/blob/master/CODING_STANDARDS.md)
   
   
    porting/nimble/include/os/queue.h
   
   
   ```diff
   @@ -111,18 +111,18 @@
/*
 * Singly-linked List declarations.
 */
   -#define SLIST_HEAD(name, type)  \
   -struct name {   \
   -struct type *slh_first; /* first element */ \
   -}
   -
   -#define SLIST_HEAD_INITIALIZER(head)\
   +#define SLIST_HEAD(name, type)  \
   +struct name {   \
   +struct type *slh_first; /* first element */ \
   +}
   +
   +#define SLIST_HEAD_INITIALIZER(head)\
{ NULL }

   -#define SLIST_ENTRY(type)   \
   -struct {\
   -struct type *sle_next;  /* next element */  \
   -}
   +#define SLIST_ENTRY(type)   \
   +struct {\
   +struct type *sle_next; /* next element */  \
   +}

/*
 * Singly-linked List functions.
   ```
   
   
   
    porting/nimble/src/hal_timer.c
   
   
   ```diff
   @@ -74,34 +74,34 @@

static const struct nrf52_hal_timer *nrf52_hal_timers[NRF52_HAL_TIMER_MAX] 
= {
#if MYNEWT_VAL(TIMER_0)
   -_hal_timer0,
   +_hal_timer0,
#else
   -NULL,
   +NULL,
#endif
#if MYNEWT_VAL(TIMER_1)
   -_hal_timer1,
   +_hal_timer1,
#else
   -NULL,
   +NULL,
#endif
#if MYNEWT_VAL(TIMER_2)
   -_hal_timer2,
   +_hal_timer2,
#else
   -NULL,
   +NULL,
#endif
#if MYNEWT_VAL(TIMER_3)
   -_hal_timer3,
   +_hal_timer3,
#else
   -NULL,
   +NULL,
#endif
#if MYNEWT_VAL(TIMER_4)
   -_hal_timer4,
   +_hal_timer4,
#else
   -NULL,
   +NULL,
#endif
#if MYNEWT_VAL(TIMER_5)
   -_hal_timer5
   +_hal_timer5
#else
   -NULL
   +NULL
#endif
};

   @@ -480,51 +480,51 @@

switch (timer_num) {
#if MYNEWT_VAL(TIMER_0)
   -case 0:
   +case 0:
irq_num = TIMER0_IRQn;
hwtimer = NRF_TIMER0;
irq_isr = nrf52_timer0_irq_handler;
break;
#endif
#if MYNEWT_VAL(TIMER_1)
   -case 1:
   +case 1:
irq_num = TIMER1_IRQn;
hwtimer = NRF_TIMER1;
irq_isr = nrf52_timer1_irq_handler;
break;
#endif
#if MYNEWT_VAL(TIMER_2)
   -case 2:
   +case 2:
irq_num = TIMER2_IRQn;
hwtimer = NRF_TIMER2;
irq_isr = nrf52_timer2_irq_handler;
break;
#endif
#if MYNEWT_VAL(TIMER_3)
   -case 3:
   +case 3:
irq_num = TIMER3_IRQn;
hwtimer = NRF_TIMER3;
irq_isr = nrf52_timer3_irq_handler;
break;
#endif
#if MYNEWT_VAL(TIMER_4)
   -case 4:
   +case 4:
irq_num = TIMER4_IRQn;
hwtimer = NRF_TIMER4;
irq_isr = nrf52_timer4_irq_handler;
break;
#endif
#if MYNEWT_VAL(TIMER_5)
   -case 5:
   -irq_num = RTC0_IRQn;
   -hwtimer = NRF_RTC0;
   -irq_isr = nrf52_timer5_irq_handler;
   -bsptimer->tmr_rtc = 1;
   -break;
   -#endif
   -default:
   -hwtimer = NULL;
   -break;
   +case 5:
   +irq_num = RTC0_IRQn;
   +hwtimer = NRF_RTC0;
   +irq_isr = nrf52_timer5_irq_handler;
   +bsptimer->tmr_rtc = 1;
   +break;
   +#endif
   +default:
   +hwtimer = NULL;
   +break;
}

if (hwtimer == NULL) {
   @@ -542,7 +542,7 @@

return 0;

   -err:
   +err:
return rc;
}

   @@ -674,7 +674,7 @@

return 0;

   -err:
   +err:
return rc;
}

   @@ -719,7 +719,7 @@
#endif
__HAL_ENABLE_INTERRUPTS(ctx);

   -err:
   +err:
return rc;
}

   @@ -744,7 +744,7 @@
resolution = 10 / bsptimer->tmr_freq;
return resolution;

   -err:
   +err:
rc = 0;
return rc;
}
   @@ -775,7 +775,7 @@
return tcntr;

/* Assert here since there is no invalid return code */
   -err:
   +err:
assert(0);
rc = 0;
return rc;
   @@ -829,7 +829,7 @@

rc = 0;

   -err:
   +err:
return rc;
}

   ```
   
   



[GitHub] [mynewt-nimble] apache-mynewt-bot removed a comment on pull request #872: nimble/porting: sync with core

2021-02-11 Thread GitBox


apache-mynewt-bot removed a comment on pull request #872:
URL: https://github.com/apache/mynewt-nimble/pull/872#issuecomment-777297740


   
   
   
   ## Style check summary
   
   ### Our coding style is 
[here!](https://github.com/apache/mynewt-core/blob/master/CODING_STANDARDS.md)
   
   
    porting/nimble/include/os/queue.h
   
   
   ```diff
   @@ -111,18 +111,18 @@
/*
 * Singly-linked List declarations.
 */
   -#define SLIST_HEAD(name, type)  \
   -struct name {   \
   -struct type *slh_first; /* first element */ \
   -}
   -
   -#define SLIST_HEAD_INITIALIZER(head)\
   +#define SLIST_HEAD(name, type)  \
   +struct name {   \
   +struct type *slh_first; /* first element */ \
   +}
   +
   +#define SLIST_HEAD_INITIALIZER(head)\
{ NULL }

   -#define SLIST_ENTRY(type)   \
   -struct {\
   -struct type *sle_next;  /* next element */  \
   -}
   +#define SLIST_ENTRY(type)   \
   +struct {\
   +struct type *sle_next; /* next element */  \
   +}

/*
 * Singly-linked List functions.
   ```
   
   
   
    porting/nimble/src/hal_timer.c
   
   
   ```diff
   @@ -74,34 +74,34 @@

static const struct nrf52_hal_timer *nrf52_hal_timers[NRF52_HAL_TIMER_MAX] 
= {
#if MYNEWT_VAL(TIMER_0)
   -_hal_timer0,
   +_hal_timer0,
#else
   -NULL,
   +NULL,
#endif
#if MYNEWT_VAL(TIMER_1)
   -_hal_timer1,
   +_hal_timer1,
#else
   -NULL,
   +NULL,
#endif
#if MYNEWT_VAL(TIMER_2)
   -_hal_timer2,
   +_hal_timer2,
#else
   -NULL,
   +NULL,
#endif
#if MYNEWT_VAL(TIMER_3)
   -_hal_timer3,
   +_hal_timer3,
#else
   -NULL,
   +NULL,
#endif
#if MYNEWT_VAL(TIMER_4)
   -_hal_timer4,
   +_hal_timer4,
#else
   -NULL,
   +NULL,
#endif
#if MYNEWT_VAL(TIMER_5)
   -_hal_timer5
   +_hal_timer5
#else
   -NULL
   +NULL
#endif
};

   @@ -480,51 +480,51 @@

switch (timer_num) {
#if MYNEWT_VAL(TIMER_0)
   -case 0:
   +case 0:
irq_num = TIMER0_IRQn;
hwtimer = NRF_TIMER0;
irq_isr = nrf52_timer0_irq_handler;
break;
#endif
#if MYNEWT_VAL(TIMER_1)
   -case 1:
   +case 1:
irq_num = TIMER1_IRQn;
hwtimer = NRF_TIMER1;
irq_isr = nrf52_timer1_irq_handler;
break;
#endif
#if MYNEWT_VAL(TIMER_2)
   -case 2:
   +case 2:
irq_num = TIMER2_IRQn;
hwtimer = NRF_TIMER2;
irq_isr = nrf52_timer2_irq_handler;
break;
#endif
#if MYNEWT_VAL(TIMER_3)
   -case 3:
   +case 3:
irq_num = TIMER3_IRQn;
hwtimer = NRF_TIMER3;
irq_isr = nrf52_timer3_irq_handler;
break;
#endif
#if MYNEWT_VAL(TIMER_4)
   -case 4:
   +case 4:
irq_num = TIMER4_IRQn;
hwtimer = NRF_TIMER4;
irq_isr = nrf52_timer4_irq_handler;
break;
#endif
#if MYNEWT_VAL(TIMER_5)
   -case 5:
   -irq_num = RTC0_IRQn;
   -hwtimer = NRF_RTC0;
   -irq_isr = nrf52_timer5_irq_handler;
   -bsptimer->tmr_rtc = 1;
   -break;
   -#endif
   -default:
   -hwtimer = NULL;
   -break;
   +case 5:
   +irq_num = RTC0_IRQn;
   +hwtimer = NRF_RTC0;
   +irq_isr = nrf52_timer5_irq_handler;
   +bsptimer->tmr_rtc = 1;
   +break;
   +#endif
   +default:
   +hwtimer = NULL;
   +break;
}

if (hwtimer == NULL) {
   @@ -542,7 +542,7 @@

return 0;

   -err:
   +err:
return rc;
}

   @@ -674,7 +674,7 @@

return 0;

   -err:
   +err:
return rc;
}

   @@ -719,7 +719,7 @@
#endif
__HAL_ENABLE_INTERRUPTS(ctx);

   -err:
   +err:
return rc;
}

   @@ -744,7 +744,7 @@
resolution = 10 / bsptimer->tmr_freq;
return resolution;

   -err:
   +err:
rc = 0;
return rc;
}
   @@ -775,7 +775,7 @@
return tcntr;

/* Assert here since there is no invalid return code */
   -err:
   +err:
assert(0);
rc = 0;
return rc;
   @@ -829,7 +829,7 @@

rc = 0;

   -err:
   +err:
return rc;
}

   ```
   
   



[GitHub] [mynewt-core] KKopyscinski commented on pull request #2457: [RFC] coap: negation in tcp check in coap_receive()

2021-02-11 Thread GitBox


KKopyscinski commented on pull request #2457:
URL: https://github.com/apache/mynewt-core/pull/2457#issuecomment-777272213


   Closed because the issue was not in the code. We have CoAP ported from 
ContikiOS, which follows RFC 7959 and received messages came from system 
following RFC 8323. Between these versions were introduced new message type - 
CSM, which is sent at the beginning of every connection. If device following 
newer spec doesn't receive response for CSM message (and it doesn't, because we 
do not handle these), it disconnects.



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




[mynewt-newt] branch master updated: docs: Update Windows installation instruction to 1.8

2021-02-11 Thread jerzy
This is an automated email from the ASF dual-hosted git repository.

jerzy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-newt.git


The following commit(s) were added to refs/heads/master by this push:
 new 5da6e2f  docs: Update Windows installation instruction to 1.8
5da6e2f is described below

commit 5da6e2f5005754542b543ce6fbbcb8ff450010df
Author: Jerzy Kasenberg 
AuthorDate: Tue Feb 9 13:29:15 2021 +0100

docs: Update Windows installation instruction to 1.8

Instruction was outdated mostly for version 1.6.
---
 docs/install/newt_windows.rst | 80 +++
 1 file changed, 51 insertions(+), 29 deletions(-)

diff --git a/docs/install/newt_windows.rst b/docs/install/newt_windows.rst
index 74ab207..30cb2ec 100644
--- a/docs/install/newt_windows.rst
+++ b/docs/install/newt_windows.rst
@@ -13,8 +13,9 @@ This guide shows you how to perform the following:
 
 1. Install MSYS2/MinGW.
 2. Install Git.
-3. Install latest release (1.6.0) of newt from binary.
-4. Install latest release of newt from source.
+3. Install latest release (1.8.0) of newt from binary.
+4. Install go for building newt from source.
+5. Install latest release of newt from source.
 
 See :doc:`prev_releases` to install an earlier version of newt. You still need
 to set up your MinGW development environment.
@@ -38,12 +39,13 @@ will use the MinGW subsystem.
 installation), but you must list the **bin** path for your installation in 
your Windows Path. For example: if you installed
 MSYS2/MinGW in the **C:\\msys64** directory, add **C:\\msys64\\usr\\bin**
 to your Windows Path. If you are using Windows 10 WSL, ensure that you use the
-**C:\\msys64\\usr\\bin\\base.exe** and not the Windows 10 WSL bash.
+**C:\\msys64\\usr\\bin\\bash.exe** and not the Windows 10 WSL bash.
 
 To install and setup MSYS2 and MinGW:
 
 1. Download and run the `MSYS2 installer `__. Select the 
64 bit version if you are running on a 64 bit
platform. Follow the prompts and check the ``Run MSYS2 now`` checkbox on 
the ``Installation Complete`` dialog.
+
 2. In the MSYS2 terminal, run the ``pacman -Syuu`` command. If you get a 
message to run the update again, close the terminal and
run the ``pacman -Syuu`` command in a new terminal.
 
@@ -58,7 +60,7 @@ To install and setup MSYS2 and MinGW:
directory, add **C:\\msys64\\usr\\bin** to your Windows Path.
 
**Note:** If you are using Windows 10 WSL, ensure that you use the
-   **C:\\msys64\\usr\\bin\\base.exe** and not the Windows 10 WSL bash.
+   **C:\\msys64\\usr\\bin\\bash.exe** and not the Windows 10 WSL bash.
 
 5. Run the ``pacman -Su vim`` command to install the vim editor.
 
@@ -73,10 +75,16 @@ You will need to start a MinGW terminal to run the commands 
specified in the Myn
 terminal, select the "MSYS2 Mingw" application from the start Menu (you can 
use either MinGW32 or MinGW64). In Windows, we use the
 MinGW subsystem to build Mynewt tools and applications.
 
-Installing Git for Windows
+Installing Git
 ~~
 
-Download and install `Git for Windows `__ 
if it is not already installed.
+Git can be installed as MinGW package from MinGW terminal:
+
+.. code-block:: console
+
+ $ pacman -S git
+
+Alternatively download and install `Git for Windows 
`__.
 
 Installing the Latest Release of the Newt Tool from Binary
 ~~
@@ -85,11 +93,7 @@ You can install the latest release of newt from binary. It 
has been tested on Wi
 
 1. Start a MinGW terminal.
 
-2. Download the newt binary tar file. The link suggested below should direct 
you to the nearest mirror automatically. If it does not, go to 
http://www.apache.org/dyn/closer.lua/mynewt/apache-mynewt-1.6.0/ and manually 
choose the specific mirror site suggested for you.
-
-   .. code-block:: console
-
-$ wget -P /tmp 
http://www.apache.org/dyn/closer.lua/mynewt/apache-mynewt-1.6.0/apache-mynewt-newt-bin-windows-1.6.0.tgz
+2. Download the newt binary tar file `apache-mynewt-newt-bin-windows-1.8.0.tgz 
`__.
 
 3. Extract the file:
 
@@ -98,43 +102,56 @@ You can install the latest release of newt from binary. It 
has been tested on Wi
 
   .. code-block:: console
 
-tar -xzf /tmp/apache-mynewt-newt-bin-windows-1.6.0.tgz -C $GOPATH/bin
+$ tar -xzf apache-mynewt-newt-bin-windows-1.8.0.tgz -C $GOPATH/bin 
--strip-components=1 apache-mynewt-newt-bin-windows-1.8.0/newt.exe
 
-  If you are installing newt for the first time and do not have a Go 
workspace setup, you can extract into /usr/bin directory:
 
   .. code-block:: console
 
-tar -xzf /tmp/apache-mynewt-newt-bin-windows-1.6.0.tgz -C /usr/bin
+$ tar -xzf apache-mynewt-newt-bin-windows-1.8.0.tgz -C 

[GitHub] [mynewt-newt] kasjer merged pull request #427: docs: Update Windows installation instruction to 1.8

2021-02-11 Thread GitBox


kasjer merged pull request #427:
URL: https://github.com/apache/mynewt-newt/pull/427


   



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




[GitHub] [mynewt-nimble] apache-mynewt-bot removed a comment on pull request #872: nimble/porting: sync with core

2021-02-11 Thread GitBox


apache-mynewt-bot removed a comment on pull request #872:
URL: https://github.com/apache/mynewt-nimble/pull/872#issuecomment-777304771


   
   
   
   ## Style check summary
   
   ### Our coding style is 
[here!](https://github.com/apache/mynewt-core/blob/master/CODING_STANDARDS.md)
   
   
    porting/nimble/include/os/queue.h
   
   
   ```diff
   @@ -111,18 +111,18 @@
/*
 * Singly-linked List declarations.
 */
   -#define SLIST_HEAD(name, type)  \
   -struct name {   \
   -struct type *slh_first; /* first element */ \
   -}
   -
   -#define SLIST_HEAD_INITIALIZER(head)\
   +#define SLIST_HEAD(name, type)  \
   +struct name {   \
   +struct type *slh_first; /* first element */ \
   +}
   +
   +#define SLIST_HEAD_INITIALIZER(head)\
{ NULL }

   -#define SLIST_ENTRY(type)   \
   -struct {\
   -struct type *sle_next;  /* next element */  \
   -}
   +#define SLIST_ENTRY(type)   \
   +struct {\
   +struct type *sle_next; /* next element */  \
   +}

/*
 * Singly-linked List functions.
   ```
   
   
   
    porting/nimble/src/hal_timer.c
   
   
   ```diff
   @@ -74,34 +74,34 @@

static const struct nrf52_hal_timer *nrf52_hal_timers[NRF52_HAL_TIMER_MAX] 
= {
#if MYNEWT_VAL(TIMER_0)
   -_hal_timer0,
   +_hal_timer0,
#else
   -NULL,
   +NULL,
#endif
#if MYNEWT_VAL(TIMER_1)
   -_hal_timer1,
   +_hal_timer1,
#else
   -NULL,
   +NULL,
#endif
#if MYNEWT_VAL(TIMER_2)
   -_hal_timer2,
   +_hal_timer2,
#else
   -NULL,
   +NULL,
#endif
#if MYNEWT_VAL(TIMER_3)
   -_hal_timer3,
   +_hal_timer3,
#else
   -NULL,
   +NULL,
#endif
#if MYNEWT_VAL(TIMER_4)
   -_hal_timer4,
   +_hal_timer4,
#else
   -NULL,
   +NULL,
#endif
#if MYNEWT_VAL(TIMER_5)
   -_hal_timer5
   +_hal_timer5
#else
   -NULL
   +NULL
#endif
};

   @@ -480,51 +480,51 @@

switch (timer_num) {
#if MYNEWT_VAL(TIMER_0)
   -case 0:
   +case 0:
irq_num = TIMER0_IRQn;
hwtimer = NRF_TIMER0;
irq_isr = nrf52_timer0_irq_handler;
break;
#endif
#if MYNEWT_VAL(TIMER_1)
   -case 1:
   +case 1:
irq_num = TIMER1_IRQn;
hwtimer = NRF_TIMER1;
irq_isr = nrf52_timer1_irq_handler;
break;
#endif
#if MYNEWT_VAL(TIMER_2)
   -case 2:
   +case 2:
irq_num = TIMER2_IRQn;
hwtimer = NRF_TIMER2;
irq_isr = nrf52_timer2_irq_handler;
break;
#endif
#if MYNEWT_VAL(TIMER_3)
   -case 3:
   +case 3:
irq_num = TIMER3_IRQn;
hwtimer = NRF_TIMER3;
irq_isr = nrf52_timer3_irq_handler;
break;
#endif
#if MYNEWT_VAL(TIMER_4)
   -case 4:
   +case 4:
irq_num = TIMER4_IRQn;
hwtimer = NRF_TIMER4;
irq_isr = nrf52_timer4_irq_handler;
break;
#endif
#if MYNEWT_VAL(TIMER_5)
   -case 5:
   -irq_num = RTC0_IRQn;
   -hwtimer = NRF_RTC0;
   -irq_isr = nrf52_timer5_irq_handler;
   -bsptimer->tmr_rtc = 1;
   -break;
   -#endif
   -default:
   -hwtimer = NULL;
   -break;
   +case 5:
   +irq_num = RTC0_IRQn;
   +hwtimer = NRF_RTC0;
   +irq_isr = nrf52_timer5_irq_handler;
   +bsptimer->tmr_rtc = 1;
   +break;
   +#endif
   +default:
   +hwtimer = NULL;
   +break;
}

if (hwtimer == NULL) {
   @@ -542,7 +542,7 @@

return 0;

   -err:
   +err:
return rc;
}

   @@ -674,7 +674,7 @@

return 0;

   -err:
   +err:
return rc;
}

   @@ -719,7 +719,7 @@
#endif
__HAL_ENABLE_INTERRUPTS(ctx);

   -err:
   +err:
return rc;
}

   @@ -744,7 +744,7 @@
resolution = 10 / bsptimer->tmr_freq;
return resolution;

   -err:
   +err:
rc = 0;
return rc;
}
   @@ -775,7 +775,7 @@
return tcntr;

/* Assert here since there is no invalid return code */
   -err:
   +err:
assert(0);
rc = 0;
return rc;
   @@ -829,7 +829,7 @@

rc = 0;

   -err:
   +err:
return rc;
}

   ```
   
   



[GitHub] [mynewt-nimble] apache-mynewt-bot commented on pull request #872: nimble/porting: sync with core

2021-02-11 Thread GitBox


apache-mynewt-bot commented on pull request #872:
URL: https://github.com/apache/mynewt-nimble/pull/872#issuecomment-777313608


   
   
   
   ## Style check summary
   
   ### Our coding style is 
[here!](https://github.com/apache/mynewt-core/blob/master/CODING_STANDARDS.md)
   
   
    porting/nimble/include/os/queue.h
   
   
   ```diff
   @@ -111,18 +111,18 @@
/*
 * Singly-linked List declarations.
 */
   -#define SLIST_HEAD(name, type)  \
   -struct name {   \
   -struct type *slh_first; /* first element */ \
   -}
   -
   -#define SLIST_HEAD_INITIALIZER(head)\
   +#define SLIST_HEAD(name, type)  \
   +struct name {   \
   +struct type *slh_first; /* first element */ \
   +}
   +
   +#define SLIST_HEAD_INITIALIZER(head)\
{ NULL }

   -#define SLIST_ENTRY(type)   \
   -struct {\
   -struct type *sle_next;  /* next element */  \
   -}
   +#define SLIST_ENTRY(type)   \
   +struct {\
   +struct type *sle_next; /* next element */  \
   +}

/*
 * Singly-linked List functions.
   ```
   
   
   
    porting/nimble/src/hal_timer.c
   
   
   ```diff
   @@ -74,34 +74,34 @@

static const struct nrf52_hal_timer *nrf52_hal_timers[NRF52_HAL_TIMER_MAX] 
= {
#if MYNEWT_VAL(TIMER_0)
   -_hal_timer0,
   +_hal_timer0,
#else
   -NULL,
   +NULL,
#endif
#if MYNEWT_VAL(TIMER_1)
   -_hal_timer1,
   +_hal_timer1,
#else
   -NULL,
   +NULL,
#endif
#if MYNEWT_VAL(TIMER_2)
   -_hal_timer2,
   +_hal_timer2,
#else
   -NULL,
   +NULL,
#endif
#if MYNEWT_VAL(TIMER_3)
   -_hal_timer3,
   +_hal_timer3,
#else
   -NULL,
   +NULL,
#endif
#if MYNEWT_VAL(TIMER_4)
   -_hal_timer4,
   +_hal_timer4,
#else
   -NULL,
   +NULL,
#endif
#if MYNEWT_VAL(TIMER_5)
   -_hal_timer5
   +_hal_timer5
#else
   -NULL
   +NULL
#endif
};

   @@ -480,51 +480,51 @@

switch (timer_num) {
#if MYNEWT_VAL(TIMER_0)
   -case 0:
   +case 0:
irq_num = TIMER0_IRQn;
hwtimer = NRF_TIMER0;
irq_isr = nrf52_timer0_irq_handler;
break;
#endif
#if MYNEWT_VAL(TIMER_1)
   -case 1:
   +case 1:
irq_num = TIMER1_IRQn;
hwtimer = NRF_TIMER1;
irq_isr = nrf52_timer1_irq_handler;
break;
#endif
#if MYNEWT_VAL(TIMER_2)
   -case 2:
   +case 2:
irq_num = TIMER2_IRQn;
hwtimer = NRF_TIMER2;
irq_isr = nrf52_timer2_irq_handler;
break;
#endif
#if MYNEWT_VAL(TIMER_3)
   -case 3:
   +case 3:
irq_num = TIMER3_IRQn;
hwtimer = NRF_TIMER3;
irq_isr = nrf52_timer3_irq_handler;
break;
#endif
#if MYNEWT_VAL(TIMER_4)
   -case 4:
   +case 4:
irq_num = TIMER4_IRQn;
hwtimer = NRF_TIMER4;
irq_isr = nrf52_timer4_irq_handler;
break;
#endif
#if MYNEWT_VAL(TIMER_5)
   -case 5:
   -irq_num = RTC0_IRQn;
   -hwtimer = NRF_RTC0;
   -irq_isr = nrf52_timer5_irq_handler;
   -bsptimer->tmr_rtc = 1;
   -break;
   -#endif
   -default:
   -hwtimer = NULL;
   -break;
   +case 5:
   +irq_num = RTC0_IRQn;
   +hwtimer = NRF_RTC0;
   +irq_isr = nrf52_timer5_irq_handler;
   +bsptimer->tmr_rtc = 1;
   +break;
   +#endif
   +default:
   +hwtimer = NULL;
   +break;
}

if (hwtimer == NULL) {
   @@ -542,7 +542,7 @@

return 0;

   -err:
   +err:
return rc;
}

   @@ -674,7 +674,7 @@

return 0;

   -err:
   +err:
return rc;
}

   @@ -719,7 +719,7 @@
#endif
__HAL_ENABLE_INTERRUPTS(ctx);

   -err:
   +err:
return rc;
}

   @@ -744,7 +744,7 @@
resolution = 10 / bsptimer->tmr_freq;
return resolution;

   -err:
   +err:
rc = 0;
return rc;
}
   @@ -775,7 +775,7 @@
return tcntr;

/* Assert here since there is no invalid return code */
   -err:
   +err:
assert(0);
rc = 0;
return rc;
   @@ -829,7 +829,7 @@

rc = 0;

   -err:
   +err:
return rc;
}

   ```
   
   



[GitHub] [mynewt-nimble] apache-mynewt-bot commented on pull request #872: nimble/porting: sync with core

2021-02-11 Thread GitBox


apache-mynewt-bot commented on pull request #872:
URL: https://github.com/apache/mynewt-nimble/pull/872#issuecomment-777320198


   
   
   
   ## Style check summary
   
   ### Our coding style is 
[here!](https://github.com/apache/mynewt-core/blob/master/CODING_STANDARDS.md)
   
   
    porting/nimble/include/os/queue.h
   
   
   ```diff
   @@ -111,18 +111,18 @@
/*
 * Singly-linked List declarations.
 */
   -#define SLIST_HEAD(name, type)  \
   -struct name {   \
   -struct type *slh_first; /* first element */ \
   -}
   -
   -#define SLIST_HEAD_INITIALIZER(head)\
   +#define SLIST_HEAD(name, type)  \
   +struct name {   \
   +struct type *slh_first; /* first element */ \
   +}
   +
   +#define SLIST_HEAD_INITIALIZER(head)\
{ NULL }

   -#define SLIST_ENTRY(type)   \
   -struct {\
   -struct type *sle_next;  /* next element */  \
   -}
   +#define SLIST_ENTRY(type)   \
   +struct {\
   +struct type *sle_next; /* next element */  \
   +}

/*
 * Singly-linked List functions.
   ```
   
   
   
    porting/nimble/src/hal_timer.c
   
   
   ```diff
   @@ -74,34 +74,34 @@

static const struct nrf52_hal_timer *nrf52_hal_timers[NRF52_HAL_TIMER_MAX] 
= {
#if MYNEWT_VAL(TIMER_0)
   -_hal_timer0,
   +_hal_timer0,
#else
   -NULL,
   +NULL,
#endif
#if MYNEWT_VAL(TIMER_1)
   -_hal_timer1,
   +_hal_timer1,
#else
   -NULL,
   +NULL,
#endif
#if MYNEWT_VAL(TIMER_2)
   -_hal_timer2,
   +_hal_timer2,
#else
   -NULL,
   +NULL,
#endif
#if MYNEWT_VAL(TIMER_3)
   -_hal_timer3,
   +_hal_timer3,
#else
   -NULL,
   +NULL,
#endif
#if MYNEWT_VAL(TIMER_4)
   -_hal_timer4,
   +_hal_timer4,
#else
   -NULL,
   +NULL,
#endif
#if MYNEWT_VAL(TIMER_5)
   -_hal_timer5
   +_hal_timer5
#else
   -NULL
   +NULL
#endif
};

   @@ -480,51 +480,51 @@

switch (timer_num) {
#if MYNEWT_VAL(TIMER_0)
   -case 0:
   +case 0:
irq_num = TIMER0_IRQn;
hwtimer = NRF_TIMER0;
irq_isr = nrf52_timer0_irq_handler;
break;
#endif
#if MYNEWT_VAL(TIMER_1)
   -case 1:
   +case 1:
irq_num = TIMER1_IRQn;
hwtimer = NRF_TIMER1;
irq_isr = nrf52_timer1_irq_handler;
break;
#endif
#if MYNEWT_VAL(TIMER_2)
   -case 2:
   +case 2:
irq_num = TIMER2_IRQn;
hwtimer = NRF_TIMER2;
irq_isr = nrf52_timer2_irq_handler;
break;
#endif
#if MYNEWT_VAL(TIMER_3)
   -case 3:
   +case 3:
irq_num = TIMER3_IRQn;
hwtimer = NRF_TIMER3;
irq_isr = nrf52_timer3_irq_handler;
break;
#endif
#if MYNEWT_VAL(TIMER_4)
   -case 4:
   +case 4:
irq_num = TIMER4_IRQn;
hwtimer = NRF_TIMER4;
irq_isr = nrf52_timer4_irq_handler;
break;
#endif
#if MYNEWT_VAL(TIMER_5)
   -case 5:
   -irq_num = RTC0_IRQn;
   -hwtimer = NRF_RTC0;
   -irq_isr = nrf52_timer5_irq_handler;
   -bsptimer->tmr_rtc = 1;
   -break;
   -#endif
   -default:
   -hwtimer = NULL;
   -break;
   +case 5:
   +irq_num = RTC0_IRQn;
   +hwtimer = NRF_RTC0;
   +irq_isr = nrf52_timer5_irq_handler;
   +bsptimer->tmr_rtc = 1;
   +break;
   +#endif
   +default:
   +hwtimer = NULL;
   +break;
}

if (hwtimer == NULL) {
   @@ -542,7 +542,7 @@

return 0;

   -err:
   +err:
return rc;
}

   @@ -674,7 +674,7 @@

return 0;

   -err:
   +err:
return rc;
}

   @@ -719,7 +719,7 @@
#endif
OS_EXIT_CRITICAL(sr);

   -err:
   +err:
return rc;
}

   @@ -744,7 +744,7 @@
resolution = 10 / bsptimer->tmr_freq;
return resolution;

   -err:
   +err:
rc = 0;
return rc;
}
   @@ -775,7 +775,7 @@
return tcntr;

/* Assert here since there is no invalid return code */
   -err:
   +err:
assert(0);
rc = 0;
return rc;
   @@ -829,7 +829,7 @@

rc = 0;

   -err:
   +err:
return rc;
}

   ```
   
   



[GitHub] [mynewt-nimble] apache-mynewt-bot removed a comment on pull request #872: nimble/porting: sync with core

2021-02-11 Thread GitBox


apache-mynewt-bot removed a comment on pull request #872:
URL: https://github.com/apache/mynewt-nimble/pull/872#issuecomment-777313608


   
   
   
   ## Style check summary
   
   ### Our coding style is 
[here!](https://github.com/apache/mynewt-core/blob/master/CODING_STANDARDS.md)
   
   
    porting/nimble/include/os/queue.h
   
   
   ```diff
   @@ -111,18 +111,18 @@
/*
 * Singly-linked List declarations.
 */
   -#define SLIST_HEAD(name, type)  \
   -struct name {   \
   -struct type *slh_first; /* first element */ \
   -}
   -
   -#define SLIST_HEAD_INITIALIZER(head)\
   +#define SLIST_HEAD(name, type)  \
   +struct name {   \
   +struct type *slh_first; /* first element */ \
   +}
   +
   +#define SLIST_HEAD_INITIALIZER(head)\
{ NULL }

   -#define SLIST_ENTRY(type)   \
   -struct {\
   -struct type *sle_next;  /* next element */  \
   -}
   +#define SLIST_ENTRY(type)   \
   +struct {\
   +struct type *sle_next; /* next element */  \
   +}

/*
 * Singly-linked List functions.
   ```
   
   
   
    porting/nimble/src/hal_timer.c
   
   
   ```diff
   @@ -74,34 +74,34 @@

static const struct nrf52_hal_timer *nrf52_hal_timers[NRF52_HAL_TIMER_MAX] 
= {
#if MYNEWT_VAL(TIMER_0)
   -_hal_timer0,
   +_hal_timer0,
#else
   -NULL,
   +NULL,
#endif
#if MYNEWT_VAL(TIMER_1)
   -_hal_timer1,
   +_hal_timer1,
#else
   -NULL,
   +NULL,
#endif
#if MYNEWT_VAL(TIMER_2)
   -_hal_timer2,
   +_hal_timer2,
#else
   -NULL,
   +NULL,
#endif
#if MYNEWT_VAL(TIMER_3)
   -_hal_timer3,
   +_hal_timer3,
#else
   -NULL,
   +NULL,
#endif
#if MYNEWT_VAL(TIMER_4)
   -_hal_timer4,
   +_hal_timer4,
#else
   -NULL,
   +NULL,
#endif
#if MYNEWT_VAL(TIMER_5)
   -_hal_timer5
   +_hal_timer5
#else
   -NULL
   +NULL
#endif
};

   @@ -480,51 +480,51 @@

switch (timer_num) {
#if MYNEWT_VAL(TIMER_0)
   -case 0:
   +case 0:
irq_num = TIMER0_IRQn;
hwtimer = NRF_TIMER0;
irq_isr = nrf52_timer0_irq_handler;
break;
#endif
#if MYNEWT_VAL(TIMER_1)
   -case 1:
   +case 1:
irq_num = TIMER1_IRQn;
hwtimer = NRF_TIMER1;
irq_isr = nrf52_timer1_irq_handler;
break;
#endif
#if MYNEWT_VAL(TIMER_2)
   -case 2:
   +case 2:
irq_num = TIMER2_IRQn;
hwtimer = NRF_TIMER2;
irq_isr = nrf52_timer2_irq_handler;
break;
#endif
#if MYNEWT_VAL(TIMER_3)
   -case 3:
   +case 3:
irq_num = TIMER3_IRQn;
hwtimer = NRF_TIMER3;
irq_isr = nrf52_timer3_irq_handler;
break;
#endif
#if MYNEWT_VAL(TIMER_4)
   -case 4:
   +case 4:
irq_num = TIMER4_IRQn;
hwtimer = NRF_TIMER4;
irq_isr = nrf52_timer4_irq_handler;
break;
#endif
#if MYNEWT_VAL(TIMER_5)
   -case 5:
   -irq_num = RTC0_IRQn;
   -hwtimer = NRF_RTC0;
   -irq_isr = nrf52_timer5_irq_handler;
   -bsptimer->tmr_rtc = 1;
   -break;
   -#endif
   -default:
   -hwtimer = NULL;
   -break;
   +case 5:
   +irq_num = RTC0_IRQn;
   +hwtimer = NRF_RTC0;
   +irq_isr = nrf52_timer5_irq_handler;
   +bsptimer->tmr_rtc = 1;
   +break;
   +#endif
   +default:
   +hwtimer = NULL;
   +break;
}

if (hwtimer == NULL) {
   @@ -542,7 +542,7 @@

return 0;

   -err:
   +err:
return rc;
}

   @@ -674,7 +674,7 @@

return 0;

   -err:
   +err:
return rc;
}

   @@ -719,7 +719,7 @@
#endif
__HAL_ENABLE_INTERRUPTS(ctx);

   -err:
   +err:
return rc;
}

   @@ -744,7 +744,7 @@
resolution = 10 / bsptimer->tmr_freq;
return resolution;

   -err:
   +err:
rc = 0;
return rc;
}
   @@ -775,7 +775,7 @@
return tcntr;

/* Assert here since there is no invalid return code */
   -err:
   +err:
assert(0);
rc = 0;
return rc;
   @@ -829,7 +829,7 @@

rc = 0;

   -err:
   +err:
return rc;
}

   ```
   
   



[GitHub] [mynewt-nimble] apache-mynewt-bot commented on pull request #872: nimble/porting: sync with core

2021-02-11 Thread GitBox


apache-mynewt-bot commented on pull request #872:
URL: https://github.com/apache/mynewt-nimble/pull/872#issuecomment-777379872


   
   
   
   ## Style check summary
   
   ### Our coding style is 
[here!](https://github.com/apache/mynewt-core/blob/master/CODING_STANDARDS.md)
   
   
    porting/nimble/include/os/queue.h
   
   
   ```diff
   @@ -111,18 +111,18 @@
/*
 * Singly-linked List declarations.
 */
   -#define SLIST_HEAD(name, type)  \
   -struct name {   \
   -struct type *slh_first; /* first element */ \
   -}
   -
   -#define SLIST_HEAD_INITIALIZER(head)\
   +#define SLIST_HEAD(name, type)  \
   +struct name {   \
   +struct type *slh_first; /* first element */ \
   +}
   +
   +#define SLIST_HEAD_INITIALIZER(head)\
{ NULL }

   -#define SLIST_ENTRY(type)   \
   -struct {\
   -struct type *sle_next;  /* next element */  \
   -}
   +#define SLIST_ENTRY(type)   \
   +struct {\
   +struct type *sle_next; /* next element */  \
   +}

/*
 * Singly-linked List functions.
   ```
   
   
   
    porting/nimble/src/hal_timer.c
   
   
   ```diff
   @@ -75,34 +75,34 @@

static const struct nrf52_hal_timer *nrf52_hal_timers[NRF52_HAL_TIMER_MAX] 
= {
#if MYNEWT_VAL(TIMER_0)
   -_hal_timer0,
   +_hal_timer0,
#else
   -NULL,
   +NULL,
#endif
#if MYNEWT_VAL(TIMER_1)
   -_hal_timer1,
   +_hal_timer1,
#else
   -NULL,
   +NULL,
#endif
#if MYNEWT_VAL(TIMER_2)
   -_hal_timer2,
   +_hal_timer2,
#else
   -NULL,
   +NULL,
#endif
#if MYNEWT_VAL(TIMER_3)
   -_hal_timer3,
   +_hal_timer3,
#else
   -NULL,
   +NULL,
#endif
#if MYNEWT_VAL(TIMER_4)
   -_hal_timer4,
   +_hal_timer4,
#else
   -NULL,
   +NULL,
#endif
#if MYNEWT_VAL(TIMER_5)
   -_hal_timer5
   +_hal_timer5
#else
   -NULL
   +NULL
#endif
};

   @@ -481,51 +481,51 @@

switch (timer_num) {
#if MYNEWT_VAL(TIMER_0)
   -case 0:
   +case 0:
irq_num = TIMER0_IRQn;
hwtimer = NRF_TIMER0;
irq_isr = nrf52_timer0_irq_handler;
break;
#endif
#if MYNEWT_VAL(TIMER_1)
   -case 1:
   +case 1:
irq_num = TIMER1_IRQn;
hwtimer = NRF_TIMER1;
irq_isr = nrf52_timer1_irq_handler;
break;
#endif
#if MYNEWT_VAL(TIMER_2)
   -case 2:
   +case 2:
irq_num = TIMER2_IRQn;
hwtimer = NRF_TIMER2;
irq_isr = nrf52_timer2_irq_handler;
break;
#endif
#if MYNEWT_VAL(TIMER_3)
   -case 3:
   +case 3:
irq_num = TIMER3_IRQn;
hwtimer = NRF_TIMER3;
irq_isr = nrf52_timer3_irq_handler;
break;
#endif
#if MYNEWT_VAL(TIMER_4)
   -case 4:
   +case 4:
irq_num = TIMER4_IRQn;
hwtimer = NRF_TIMER4;
irq_isr = nrf52_timer4_irq_handler;
break;
#endif
#if MYNEWT_VAL(TIMER_5)
   -case 5:
   -irq_num = RTC0_IRQn;
   -hwtimer = NRF_RTC0;
   -irq_isr = nrf52_timer5_irq_handler;
   -bsptimer->tmr_rtc = 1;
   -break;
   -#endif
   -default:
   -hwtimer = NULL;
   -break;
   +case 5:
   +irq_num = RTC0_IRQn;
   +hwtimer = NRF_RTC0;
   +irq_isr = nrf52_timer5_irq_handler;
   +bsptimer->tmr_rtc = 1;
   +break;
   +#endif
   +default:
   +hwtimer = NULL;
   +break;
}

if (hwtimer == NULL) {
   @@ -543,7 +543,7 @@

return 0;

   -err:
   +err:
return rc;
}

   @@ -675,7 +675,7 @@

return 0;

   -err:
   +err:
return rc;
}

   @@ -720,7 +720,7 @@
#endif
OS_EXIT_CRITICAL(sr);

   -err:
   +err:
return rc;
}

   @@ -745,7 +745,7 @@
resolution = 10 / bsptimer->tmr_freq;
return resolution;

   -err:
   +err:
rc = 0;
return rc;
}
   @@ -776,7 +776,7 @@
return tcntr;

/* Assert here since there is no invalid return code */
   -err:
   +err:
assert(0);
rc = 0;
return rc;
   @@ -830,7 +830,7 @@

rc = 0;

   -err:
   +err:
return rc;
}

   ```
   
   



[GitHub] [mynewt-nimble] apache-mynewt-bot removed a comment on pull request #872: nimble/porting: sync with core

2021-02-11 Thread GitBox


apache-mynewt-bot removed a comment on pull request #872:
URL: https://github.com/apache/mynewt-nimble/pull/872#issuecomment-777369628


   
   
   
   ## Style check summary
   
   ### Our coding style is 
[here!](https://github.com/apache/mynewt-core/blob/master/CODING_STANDARDS.md)
   
   
    porting/nimble/include/os/queue.h
   
   
   ```diff
   @@ -111,18 +111,18 @@
/*
 * Singly-linked List declarations.
 */
   -#define SLIST_HEAD(name, type)  \
   -struct name {   \
   -struct type *slh_first; /* first element */ \
   -}
   -
   -#define SLIST_HEAD_INITIALIZER(head)\
   +#define SLIST_HEAD(name, type)  \
   +struct name {   \
   +struct type *slh_first; /* first element */ \
   +}
   +
   +#define SLIST_HEAD_INITIALIZER(head)\
{ NULL }

   -#define SLIST_ENTRY(type)   \
   -struct {\
   -struct type *sle_next;  /* next element */  \
   -}
   +#define SLIST_ENTRY(type)   \
   +struct {\
   +struct type *sle_next; /* next element */  \
   +}

/*
 * Singly-linked List functions.
   ```
   
   
   
    porting/nimble/src/hal_timer.c
   
   
   ```diff
   @@ -75,34 +75,34 @@

static const struct nrf52_hal_timer *nrf52_hal_timers[NRF52_HAL_TIMER_MAX] 
= {
#if MYNEWT_VAL(TIMER_0)
   -_hal_timer0,
   +_hal_timer0,
#else
   -NULL,
   +NULL,
#endif
#if MYNEWT_VAL(TIMER_1)
   -_hal_timer1,
   +_hal_timer1,
#else
   -NULL,
   +NULL,
#endif
#if MYNEWT_VAL(TIMER_2)
   -_hal_timer2,
   +_hal_timer2,
#else
   -NULL,
   +NULL,
#endif
#if MYNEWT_VAL(TIMER_3)
   -_hal_timer3,
   +_hal_timer3,
#else
   -NULL,
   +NULL,
#endif
#if MYNEWT_VAL(TIMER_4)
   -_hal_timer4,
   +_hal_timer4,
#else
   -NULL,
   +NULL,
#endif
#if MYNEWT_VAL(TIMER_5)
   -_hal_timer5
   +_hal_timer5
#else
   -NULL
   +NULL
#endif
};

   @@ -481,51 +481,51 @@

switch (timer_num) {
#if MYNEWT_VAL(TIMER_0)
   -case 0:
   +case 0:
irq_num = TIMER0_IRQn;
hwtimer = NRF_TIMER0;
irq_isr = nrf52_timer0_irq_handler;
break;
#endif
#if MYNEWT_VAL(TIMER_1)
   -case 1:
   +case 1:
irq_num = TIMER1_IRQn;
hwtimer = NRF_TIMER1;
irq_isr = nrf52_timer1_irq_handler;
break;
#endif
#if MYNEWT_VAL(TIMER_2)
   -case 2:
   +case 2:
irq_num = TIMER2_IRQn;
hwtimer = NRF_TIMER2;
irq_isr = nrf52_timer2_irq_handler;
break;
#endif
#if MYNEWT_VAL(TIMER_3)
   -case 3:
   +case 3:
irq_num = TIMER3_IRQn;
hwtimer = NRF_TIMER3;
irq_isr = nrf52_timer3_irq_handler;
break;
#endif
#if MYNEWT_VAL(TIMER_4)
   -case 4:
   +case 4:
irq_num = TIMER4_IRQn;
hwtimer = NRF_TIMER4;
irq_isr = nrf52_timer4_irq_handler;
break;
#endif
#if MYNEWT_VAL(TIMER_5)
   -case 5:
   -irq_num = RTC0_IRQn;
   -hwtimer = NRF_RTC0;
   -irq_isr = nrf52_timer5_irq_handler;
   -bsptimer->tmr_rtc = 1;
   -break;
   -#endif
   -default:
   -hwtimer = NULL;
   -break;
   +case 5:
   +irq_num = RTC0_IRQn;
   +hwtimer = NRF_RTC0;
   +irq_isr = nrf52_timer5_irq_handler;
   +bsptimer->tmr_rtc = 1;
   +break;
   +#endif
   +default:
   +hwtimer = NULL;
   +break;
}

if (hwtimer == NULL) {
   @@ -543,7 +543,7 @@

return 0;

   -err:
   +err:
return rc;
}

   @@ -675,7 +675,7 @@

return 0;

   -err:
   +err:
return rc;
}

   @@ -720,7 +720,7 @@
#endif
OS_EXIT_CRITICAL(sr);

   -err:
   +err:
return rc;
}

   @@ -745,7 +745,7 @@
resolution = 10 / bsptimer->tmr_freq;
return resolution;

   -err:
   +err:
rc = 0;
return rc;
}
   @@ -776,7 +776,7 @@
return tcntr;

/* Assert here since there is no invalid return code */
   -err:
   +err:
assert(0);
rc = 0;
return rc;
   @@ -830,7 +830,7 @@

rc = 0;

   -err:
   +err:
return rc;
}

   ```
   
   



[GitHub] [mynewt-nimble] apache-mynewt-bot removed a comment on pull request #872: nimble/porting: sync with core

2021-02-11 Thread GitBox


apache-mynewt-bot removed a comment on pull request #872:
URL: https://github.com/apache/mynewt-nimble/pull/872#issuecomment-777320198


   
   
   
   ## Style check summary
   
   ### Our coding style is 
[here!](https://github.com/apache/mynewt-core/blob/master/CODING_STANDARDS.md)
   
   
    porting/nimble/include/os/queue.h
   
   
   ```diff
   @@ -111,18 +111,18 @@
/*
 * Singly-linked List declarations.
 */
   -#define SLIST_HEAD(name, type)  \
   -struct name {   \
   -struct type *slh_first; /* first element */ \
   -}
   -
   -#define SLIST_HEAD_INITIALIZER(head)\
   +#define SLIST_HEAD(name, type)  \
   +struct name {   \
   +struct type *slh_first; /* first element */ \
   +}
   +
   +#define SLIST_HEAD_INITIALIZER(head)\
{ NULL }

   -#define SLIST_ENTRY(type)   \
   -struct {\
   -struct type *sle_next;  /* next element */  \
   -}
   +#define SLIST_ENTRY(type)   \
   +struct {\
   +struct type *sle_next; /* next element */  \
   +}

/*
 * Singly-linked List functions.
   ```
   
   
   
    porting/nimble/src/hal_timer.c
   
   
   ```diff
   @@ -74,34 +74,34 @@

static const struct nrf52_hal_timer *nrf52_hal_timers[NRF52_HAL_TIMER_MAX] 
= {
#if MYNEWT_VAL(TIMER_0)
   -_hal_timer0,
   +_hal_timer0,
#else
   -NULL,
   +NULL,
#endif
#if MYNEWT_VAL(TIMER_1)
   -_hal_timer1,
   +_hal_timer1,
#else
   -NULL,
   +NULL,
#endif
#if MYNEWT_VAL(TIMER_2)
   -_hal_timer2,
   +_hal_timer2,
#else
   -NULL,
   +NULL,
#endif
#if MYNEWT_VAL(TIMER_3)
   -_hal_timer3,
   +_hal_timer3,
#else
   -NULL,
   +NULL,
#endif
#if MYNEWT_VAL(TIMER_4)
   -_hal_timer4,
   +_hal_timer4,
#else
   -NULL,
   +NULL,
#endif
#if MYNEWT_VAL(TIMER_5)
   -_hal_timer5
   +_hal_timer5
#else
   -NULL
   +NULL
#endif
};

   @@ -480,51 +480,51 @@

switch (timer_num) {
#if MYNEWT_VAL(TIMER_0)
   -case 0:
   +case 0:
irq_num = TIMER0_IRQn;
hwtimer = NRF_TIMER0;
irq_isr = nrf52_timer0_irq_handler;
break;
#endif
#if MYNEWT_VAL(TIMER_1)
   -case 1:
   +case 1:
irq_num = TIMER1_IRQn;
hwtimer = NRF_TIMER1;
irq_isr = nrf52_timer1_irq_handler;
break;
#endif
#if MYNEWT_VAL(TIMER_2)
   -case 2:
   +case 2:
irq_num = TIMER2_IRQn;
hwtimer = NRF_TIMER2;
irq_isr = nrf52_timer2_irq_handler;
break;
#endif
#if MYNEWT_VAL(TIMER_3)
   -case 3:
   +case 3:
irq_num = TIMER3_IRQn;
hwtimer = NRF_TIMER3;
irq_isr = nrf52_timer3_irq_handler;
break;
#endif
#if MYNEWT_VAL(TIMER_4)
   -case 4:
   +case 4:
irq_num = TIMER4_IRQn;
hwtimer = NRF_TIMER4;
irq_isr = nrf52_timer4_irq_handler;
break;
#endif
#if MYNEWT_VAL(TIMER_5)
   -case 5:
   -irq_num = RTC0_IRQn;
   -hwtimer = NRF_RTC0;
   -irq_isr = nrf52_timer5_irq_handler;
   -bsptimer->tmr_rtc = 1;
   -break;
   -#endif
   -default:
   -hwtimer = NULL;
   -break;
   +case 5:
   +irq_num = RTC0_IRQn;
   +hwtimer = NRF_RTC0;
   +irq_isr = nrf52_timer5_irq_handler;
   +bsptimer->tmr_rtc = 1;
   +break;
   +#endif
   +default:
   +hwtimer = NULL;
   +break;
}

if (hwtimer == NULL) {
   @@ -542,7 +542,7 @@

return 0;

   -err:
   +err:
return rc;
}

   @@ -674,7 +674,7 @@

return 0;

   -err:
   +err:
return rc;
}

   @@ -719,7 +719,7 @@
#endif
OS_EXIT_CRITICAL(sr);

   -err:
   +err:
return rc;
}

   @@ -744,7 +744,7 @@
resolution = 10 / bsptimer->tmr_freq;
return resolution;

   -err:
   +err:
rc = 0;
return rc;
}
   @@ -775,7 +775,7 @@
return tcntr;

/* Assert here since there is no invalid return code */
   -err:
   +err:
assert(0);
rc = 0;
return rc;
   @@ -829,7 +829,7 @@

rc = 0;

   -err:
   +err:
return rc;
}

   ```
   
   



[GitHub] [mynewt-nimble] apache-mynewt-bot commented on pull request #872: nimble/porting: sync with core

2021-02-11 Thread GitBox


apache-mynewt-bot commented on pull request #872:
URL: https://github.com/apache/mynewt-nimble/pull/872#issuecomment-777365354


   
   
   
   ## Style check summary
   
   ### Our coding style is 
[here!](https://github.com/apache/mynewt-core/blob/master/CODING_STANDARDS.md)
   
   
    porting/nimble/include/os/queue.h
   
   
   ```diff
   @@ -111,18 +111,18 @@
/*
 * Singly-linked List declarations.
 */
   -#define SLIST_HEAD(name, type)  \
   -struct name {   \
   -struct type *slh_first; /* first element */ \
   -}
   -
   -#define SLIST_HEAD_INITIALIZER(head)\
   +#define SLIST_HEAD(name, type)  \
   +struct name {   \
   +struct type *slh_first; /* first element */ \
   +}
   +
   +#define SLIST_HEAD_INITIALIZER(head)\
{ NULL }

   -#define SLIST_ENTRY(type)   \
   -struct {\
   -struct type *sle_next;  /* next element */  \
   -}
   +#define SLIST_ENTRY(type)   \
   +struct {\
   +struct type *sle_next; /* next element */  \
   +}

/*
 * Singly-linked List functions.
   ```
   
   
   
    porting/nimble/src/hal_timer.c
   
   
   ```diff
   @@ -75,34 +75,34 @@

static const struct nrf52_hal_timer *nrf52_hal_timers[NRF52_HAL_TIMER_MAX] 
= {
#if MYNEWT_VAL(TIMER_0)
   -_hal_timer0,
   +_hal_timer0,
#else
   -NULL,
   +NULL,
#endif
#if MYNEWT_VAL(TIMER_1)
   -_hal_timer1,
   +_hal_timer1,
#else
   -NULL,
   +NULL,
#endif
#if MYNEWT_VAL(TIMER_2)
   -_hal_timer2,
   +_hal_timer2,
#else
   -NULL,
   +NULL,
#endif
#if MYNEWT_VAL(TIMER_3)
   -_hal_timer3,
   +_hal_timer3,
#else
   -NULL,
   +NULL,
#endif
#if MYNEWT_VAL(TIMER_4)
   -_hal_timer4,
   +_hal_timer4,
#else
   -NULL,
   +NULL,
#endif
#if MYNEWT_VAL(TIMER_5)
   -_hal_timer5
   +_hal_timer5
#else
   -NULL
   +NULL
#endif
};

   @@ -481,51 +481,51 @@

switch (timer_num) {
#if MYNEWT_VAL(TIMER_0)
   -case 0:
   +case 0:
irq_num = TIMER0_IRQn;
hwtimer = NRF_TIMER0;
irq_isr = nrf52_timer0_irq_handler;
break;
#endif
#if MYNEWT_VAL(TIMER_1)
   -case 1:
   +case 1:
irq_num = TIMER1_IRQn;
hwtimer = NRF_TIMER1;
irq_isr = nrf52_timer1_irq_handler;
break;
#endif
#if MYNEWT_VAL(TIMER_2)
   -case 2:
   +case 2:
irq_num = TIMER2_IRQn;
hwtimer = NRF_TIMER2;
irq_isr = nrf52_timer2_irq_handler;
break;
#endif
#if MYNEWT_VAL(TIMER_3)
   -case 3:
   +case 3:
irq_num = TIMER3_IRQn;
hwtimer = NRF_TIMER3;
irq_isr = nrf52_timer3_irq_handler;
break;
#endif
#if MYNEWT_VAL(TIMER_4)
   -case 4:
   +case 4:
irq_num = TIMER4_IRQn;
hwtimer = NRF_TIMER4;
irq_isr = nrf52_timer4_irq_handler;
break;
#endif
#if MYNEWT_VAL(TIMER_5)
   -case 5:
   -irq_num = RTC0_IRQn;
   -hwtimer = NRF_RTC0;
   -irq_isr = nrf52_timer5_irq_handler;
   -bsptimer->tmr_rtc = 1;
   -break;
   -#endif
   -default:
   -hwtimer = NULL;
   -break;
   +case 5:
   +irq_num = RTC0_IRQn;
   +hwtimer = NRF_RTC0;
   +irq_isr = nrf52_timer5_irq_handler;
   +bsptimer->tmr_rtc = 1;
   +break;
   +#endif
   +default:
   +hwtimer = NULL;
   +break;
}

if (hwtimer == NULL) {
   @@ -543,7 +543,7 @@

return 0;

   -err:
   +err:
return rc;
}

   @@ -675,7 +675,7 @@

return 0;

   -err:
   +err:
return rc;
}

   @@ -720,7 +720,7 @@
#endif
OS_EXIT_CRITICAL(sr);

   -err:
   +err:
return rc;
}

   @@ -745,7 +745,7 @@
resolution = 10 / bsptimer->tmr_freq;
return resolution;

   -err:
   +err:
rc = 0;
return rc;
}
   @@ -776,7 +776,7 @@
return tcntr;

/* Assert here since there is no invalid return code */
   -err:
   +err:
assert(0);
rc = 0;
return rc;
   @@ -830,7 +830,7 @@

rc = 0;

   -err:
   +err:
return rc;
}

   ```
   
   



[GitHub] [mynewt-nimble] KKopyscinski commented on pull request #872: nimble/porting: sync with core

2021-02-11 Thread GitBox


KKopyscinski commented on pull request #872:
URL: https://github.com/apache/mynewt-nimble/pull/872#issuecomment-777391778


   @sjanc Could you review this? I rebased it onto master, copied the files 
again and checked for confilcts, all travis checks for porting are passing now



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




[GitHub] [mynewt-nimble] apache-mynewt-bot commented on pull request #872: nimble/porting: sync with core

2021-02-11 Thread GitBox


apache-mynewt-bot commented on pull request #872:
URL: https://github.com/apache/mynewt-nimble/pull/872#issuecomment-777369628


   
   
   
   ## Style check summary
   
   ### Our coding style is 
[here!](https://github.com/apache/mynewt-core/blob/master/CODING_STANDARDS.md)
   
   
    porting/nimble/include/os/queue.h
   
   
   ```diff
   @@ -111,18 +111,18 @@
/*
 * Singly-linked List declarations.
 */
   -#define SLIST_HEAD(name, type)  \
   -struct name {   \
   -struct type *slh_first; /* first element */ \
   -}
   -
   -#define SLIST_HEAD_INITIALIZER(head)\
   +#define SLIST_HEAD(name, type)  \
   +struct name {   \
   +struct type *slh_first; /* first element */ \
   +}
   +
   +#define SLIST_HEAD_INITIALIZER(head)\
{ NULL }

   -#define SLIST_ENTRY(type)   \
   -struct {\
   -struct type *sle_next;  /* next element */  \
   -}
   +#define SLIST_ENTRY(type)   \
   +struct {\
   +struct type *sle_next; /* next element */  \
   +}

/*
 * Singly-linked List functions.
   ```
   
   
   
    porting/nimble/src/hal_timer.c
   
   
   ```diff
   @@ -75,34 +75,34 @@

static const struct nrf52_hal_timer *nrf52_hal_timers[NRF52_HAL_TIMER_MAX] 
= {
#if MYNEWT_VAL(TIMER_0)
   -_hal_timer0,
   +_hal_timer0,
#else
   -NULL,
   +NULL,
#endif
#if MYNEWT_VAL(TIMER_1)
   -_hal_timer1,
   +_hal_timer1,
#else
   -NULL,
   +NULL,
#endif
#if MYNEWT_VAL(TIMER_2)
   -_hal_timer2,
   +_hal_timer2,
#else
   -NULL,
   +NULL,
#endif
#if MYNEWT_VAL(TIMER_3)
   -_hal_timer3,
   +_hal_timer3,
#else
   -NULL,
   +NULL,
#endif
#if MYNEWT_VAL(TIMER_4)
   -_hal_timer4,
   +_hal_timer4,
#else
   -NULL,
   +NULL,
#endif
#if MYNEWT_VAL(TIMER_5)
   -_hal_timer5
   +_hal_timer5
#else
   -NULL
   +NULL
#endif
};

   @@ -481,51 +481,51 @@

switch (timer_num) {
#if MYNEWT_VAL(TIMER_0)
   -case 0:
   +case 0:
irq_num = TIMER0_IRQn;
hwtimer = NRF_TIMER0;
irq_isr = nrf52_timer0_irq_handler;
break;
#endif
#if MYNEWT_VAL(TIMER_1)
   -case 1:
   +case 1:
irq_num = TIMER1_IRQn;
hwtimer = NRF_TIMER1;
irq_isr = nrf52_timer1_irq_handler;
break;
#endif
#if MYNEWT_VAL(TIMER_2)
   -case 2:
   +case 2:
irq_num = TIMER2_IRQn;
hwtimer = NRF_TIMER2;
irq_isr = nrf52_timer2_irq_handler;
break;
#endif
#if MYNEWT_VAL(TIMER_3)
   -case 3:
   +case 3:
irq_num = TIMER3_IRQn;
hwtimer = NRF_TIMER3;
irq_isr = nrf52_timer3_irq_handler;
break;
#endif
#if MYNEWT_VAL(TIMER_4)
   -case 4:
   +case 4:
irq_num = TIMER4_IRQn;
hwtimer = NRF_TIMER4;
irq_isr = nrf52_timer4_irq_handler;
break;
#endif
#if MYNEWT_VAL(TIMER_5)
   -case 5:
   -irq_num = RTC0_IRQn;
   -hwtimer = NRF_RTC0;
   -irq_isr = nrf52_timer5_irq_handler;
   -bsptimer->tmr_rtc = 1;
   -break;
   -#endif
   -default:
   -hwtimer = NULL;
   -break;
   +case 5:
   +irq_num = RTC0_IRQn;
   +hwtimer = NRF_RTC0;
   +irq_isr = nrf52_timer5_irq_handler;
   +bsptimer->tmr_rtc = 1;
   +break;
   +#endif
   +default:
   +hwtimer = NULL;
   +break;
}

if (hwtimer == NULL) {
   @@ -543,7 +543,7 @@

return 0;

   -err:
   +err:
return rc;
}

   @@ -675,7 +675,7 @@

return 0;

   -err:
   +err:
return rc;
}

   @@ -720,7 +720,7 @@
#endif
OS_EXIT_CRITICAL(sr);

   -err:
   +err:
return rc;
}

   @@ -745,7 +745,7 @@
resolution = 10 / bsptimer->tmr_freq;
return resolution;

   -err:
   +err:
rc = 0;
return rc;
}
   @@ -776,7 +776,7 @@
return tcntr;

/* Assert here since there is no invalid return code */
   -err:
   +err:
assert(0);
rc = 0;
return rc;
   @@ -830,7 +830,7 @@

rc = 0;

   -err:
   +err:
return rc;
}

   ```
   
   



[GitHub] [mynewt-nimble] apache-mynewt-bot removed a comment on pull request #872: nimble/porting: sync with core

2021-02-11 Thread GitBox


apache-mynewt-bot removed a comment on pull request #872:
URL: https://github.com/apache/mynewt-nimble/pull/872#issuecomment-777365354


   
   
   
   ## Style check summary
   
   ### Our coding style is 
[here!](https://github.com/apache/mynewt-core/blob/master/CODING_STANDARDS.md)
   
   
    porting/nimble/include/os/queue.h
   
   
   ```diff
   @@ -111,18 +111,18 @@
/*
 * Singly-linked List declarations.
 */
   -#define SLIST_HEAD(name, type)  \
   -struct name {   \
   -struct type *slh_first; /* first element */ \
   -}
   -
   -#define SLIST_HEAD_INITIALIZER(head)\
   +#define SLIST_HEAD(name, type)  \
   +struct name {   \
   +struct type *slh_first; /* first element */ \
   +}
   +
   +#define SLIST_HEAD_INITIALIZER(head)\
{ NULL }

   -#define SLIST_ENTRY(type)   \
   -struct {\
   -struct type *sle_next;  /* next element */  \
   -}
   +#define SLIST_ENTRY(type)   \
   +struct {\
   +struct type *sle_next; /* next element */  \
   +}

/*
 * Singly-linked List functions.
   ```
   
   
   
    porting/nimble/src/hal_timer.c
   
   
   ```diff
   @@ -75,34 +75,34 @@

static const struct nrf52_hal_timer *nrf52_hal_timers[NRF52_HAL_TIMER_MAX] 
= {
#if MYNEWT_VAL(TIMER_0)
   -_hal_timer0,
   +_hal_timer0,
#else
   -NULL,
   +NULL,
#endif
#if MYNEWT_VAL(TIMER_1)
   -_hal_timer1,
   +_hal_timer1,
#else
   -NULL,
   +NULL,
#endif
#if MYNEWT_VAL(TIMER_2)
   -_hal_timer2,
   +_hal_timer2,
#else
   -NULL,
   +NULL,
#endif
#if MYNEWT_VAL(TIMER_3)
   -_hal_timer3,
   +_hal_timer3,
#else
   -NULL,
   +NULL,
#endif
#if MYNEWT_VAL(TIMER_4)
   -_hal_timer4,
   +_hal_timer4,
#else
   -NULL,
   +NULL,
#endif
#if MYNEWT_VAL(TIMER_5)
   -_hal_timer5
   +_hal_timer5
#else
   -NULL
   +NULL
#endif
};

   @@ -481,51 +481,51 @@

switch (timer_num) {
#if MYNEWT_VAL(TIMER_0)
   -case 0:
   +case 0:
irq_num = TIMER0_IRQn;
hwtimer = NRF_TIMER0;
irq_isr = nrf52_timer0_irq_handler;
break;
#endif
#if MYNEWT_VAL(TIMER_1)
   -case 1:
   +case 1:
irq_num = TIMER1_IRQn;
hwtimer = NRF_TIMER1;
irq_isr = nrf52_timer1_irq_handler;
break;
#endif
#if MYNEWT_VAL(TIMER_2)
   -case 2:
   +case 2:
irq_num = TIMER2_IRQn;
hwtimer = NRF_TIMER2;
irq_isr = nrf52_timer2_irq_handler;
break;
#endif
#if MYNEWT_VAL(TIMER_3)
   -case 3:
   +case 3:
irq_num = TIMER3_IRQn;
hwtimer = NRF_TIMER3;
irq_isr = nrf52_timer3_irq_handler;
break;
#endif
#if MYNEWT_VAL(TIMER_4)
   -case 4:
   +case 4:
irq_num = TIMER4_IRQn;
hwtimer = NRF_TIMER4;
irq_isr = nrf52_timer4_irq_handler;
break;
#endif
#if MYNEWT_VAL(TIMER_5)
   -case 5:
   -irq_num = RTC0_IRQn;
   -hwtimer = NRF_RTC0;
   -irq_isr = nrf52_timer5_irq_handler;
   -bsptimer->tmr_rtc = 1;
   -break;
   -#endif
   -default:
   -hwtimer = NULL;
   -break;
   +case 5:
   +irq_num = RTC0_IRQn;
   +hwtimer = NRF_RTC0;
   +irq_isr = nrf52_timer5_irq_handler;
   +bsptimer->tmr_rtc = 1;
   +break;
   +#endif
   +default:
   +hwtimer = NULL;
   +break;
}

if (hwtimer == NULL) {
   @@ -543,7 +543,7 @@

return 0;

   -err:
   +err:
return rc;
}

   @@ -675,7 +675,7 @@

return 0;

   -err:
   +err:
return rc;
}

   @@ -720,7 +720,7 @@
#endif
OS_EXIT_CRITICAL(sr);

   -err:
   +err:
return rc;
}

   @@ -745,7 +745,7 @@
resolution = 10 / bsptimer->tmr_freq;
return resolution;

   -err:
   +err:
rc = 0;
return rc;
}
   @@ -776,7 +776,7 @@
return tcntr;

/* Assert here since there is no invalid return code */
   -err:
   +err:
assert(0);
rc = 0;
return rc;
   @@ -830,7 +830,7 @@

rc = 0;

   -err:
   +err:
return rc;
}

   ```
   
   



[mynewt-mcumgr] branch master updated: Fix unitialized variable warning

2021-02-11 Thread vipulrahane
This is an automated email from the ASF dual-hosted git repository.

vipulrahane pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-mcumgr.git


The following commit(s) were added to refs/heads/master by this push:
 new 7be5e26  Fix unitialized variable warning
 new 130ae98  Merge pull request #111 from utzig/fix-linked-list
7be5e26 is described below

commit 7be5e2628331bdcc91b95e7ade1ee46d349e09bd
Author: Fabio Utzig 
AuthorDate: Thu Feb 11 11:12:24 2021 -0300

Fix unitialized variable warning

Fix usage of prev when curr==group, and add checking for invalid
parameter.

Signed-off-by: Fabio Utzig 
---
 mgmt/src/mgmt.c | 10 +++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/mgmt/src/mgmt.c b/mgmt/src/mgmt.c
index 77aa631..361211a 100644
--- a/mgmt/src/mgmt.c
+++ b/mgmt/src/mgmt.c
@@ -74,9 +74,13 @@ mgmt_streamer_free_buf(struct mgmt_streamer *streamer, void 
*buf)
 void
 mgmt_unregister_group(struct mgmt_group *group)
 {
-struct mgmt_group *curr = mgmt_group_list, *prev;
+struct mgmt_group *curr = mgmt_group_list, *prev = NULL;
 
-if (curr && curr == group) {
+if (!group) {
+return;
+}
+
+if (curr == group) {
 mgmt_group_list = curr->mg_next;
 return;
 }
@@ -86,7 +90,7 @@ mgmt_unregister_group(struct mgmt_group *group)
 curr = curr->mg_next;
 }
 
-if (!curr) {
+if (!prev || !curr) {
 return;
 }
 



[GitHub] [mynewt-mcumgr] vrahane merged pull request #111: Fix unitialized variable warning

2021-02-11 Thread GitBox


vrahane merged pull request #111:
URL: https://github.com/apache/mynewt-mcumgr/pull/111


   



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




[GitHub] [mynewt-mcumgr] vrahane commented on a change in pull request #108: mgmt: Add support for un-registering a group along with the same support in img_mgmt

2021-02-11 Thread GitBox


vrahane commented on a change in pull request #108:
URL: https://github.com/apache/mynewt-mcumgr/pull/108#discussion_r574680306



##
File path: mgmt/src/mgmt.c
##
@@ -71,6 +71,31 @@ mgmt_streamer_free_buf(struct mgmt_streamer *streamer, void 
*buf)
 streamer->cfg->free_buf(buf, streamer->cb_arg);
 }
 
+void
+mgmt_unregister_group(struct mgmt_group *group)
+{
+struct mgmt_group *curr = mgmt_group_list, *prev;
+
+if (curr && curr == group) {

Review comment:
   The only reason I keep checking current everywhere is just to be safe 
since there was no NULL check for group.





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




[GitHub] [mynewt-mcumgr] vrahane commented on a change in pull request #108: mgmt: Add support for un-registering a group along with the same support in img_mgmt

2021-02-11 Thread GitBox


vrahane commented on a change in pull request #108:
URL: https://github.com/apache/mynewt-mcumgr/pull/108#discussion_r574681140



##
File path: mgmt/src/mgmt.c
##
@@ -71,6 +71,31 @@ mgmt_streamer_free_buf(struct mgmt_streamer *streamer, void 
*buf)
 streamer->cfg->free_buf(buf, streamer->cb_arg);
 }
 
+void
+mgmt_unregister_group(struct mgmt_group *group)
+{
+struct mgmt_group *curr = mgmt_group_list, *prev;
+
+if (curr && curr == group) {
+mgmt_group_list = curr->mg_next;
+return;
+}
+
+while (curr && curr != group) {
+prev = curr;

Review comment:
   Agreed, this needs a fix.





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




[GitHub] [mynewt-mcumgr] vrahane commented on a change in pull request #108: mgmt: Add support for un-registering a group along with the same support in img_mgmt

2021-02-11 Thread GitBox


vrahane commented on a change in pull request #108:
URL: https://github.com/apache/mynewt-mcumgr/pull/108#discussion_r574706150



##
File path: mgmt/src/mgmt.c
##
@@ -71,6 +71,31 @@ mgmt_streamer_free_buf(struct mgmt_streamer *streamer, void 
*buf)
 streamer->cfg->free_buf(buf, streamer->cb_arg);
 }
 
+void
+mgmt_unregister_group(struct mgmt_group *group)
+{
+struct mgmt_group *curr = mgmt_group_list, *prev;

Review comment:
   I think I know the reason why the NULL check is not there, it’s because 
memory for the groups is not allocated here, it is a structure defined in the 
static memory that does not change. Nonetheless, does not hurt to add the check 
here.





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




[GitHub] [mynewt-mcumgr] vrahane commented on a change in pull request #108: mgmt: Add support for un-registering a group along with the same support in img_mgmt

2021-02-11 Thread GitBox


vrahane commented on a change in pull request #108:
URL: https://github.com/apache/mynewt-mcumgr/pull/108#discussion_r574676640



##
File path: mgmt/src/mgmt.c
##
@@ -71,6 +71,31 @@ mgmt_streamer_free_buf(struct mgmt_streamer *streamer, void 
*buf)
 streamer->cfg->free_buf(buf, streamer->cb_arg);
 }
 
+void
+mgmt_unregister_group(struct mgmt_group *group)
+{
+struct mgmt_group *curr = mgmt_group_list, *prev;

Review comment:
mgmt_reguster_group() does not do it either.





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




[GitHub] [mynewt-mcumgr] vrahane commented on a change in pull request #108: mgmt: Add support for un-registering a group along with the same support in img_mgmt

2021-02-11 Thread GitBox


vrahane commented on a change in pull request #108:
URL: https://github.com/apache/mynewt-mcumgr/pull/108#discussion_r574676640



##
File path: mgmt/src/mgmt.c
##
@@ -71,6 +71,31 @@ mgmt_streamer_free_buf(struct mgmt_streamer *streamer, void 
*buf)
 streamer->cfg->free_buf(buf, streamer->cb_arg);
 }
 
+void
+mgmt_unregister_group(struct mgmt_group *group)
+{
+struct mgmt_group *curr = mgmt_group_list, *prev;

Review comment:
   Happy to do that, the only reason I did not add that is because 
mgmt_reguster_group() does not do it either.





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




[GitHub] [mynewt-mcumgr] vrahane commented on a change in pull request #108: mgmt: Add support for un-registering a group along with the same support in img_mgmt

2021-02-11 Thread GitBox


vrahane commented on a change in pull request #108:
URL: https://github.com/apache/mynewt-mcumgr/pull/108#discussion_r574677976



##
File path: mgmt/src/mgmt.c
##
@@ -71,6 +71,31 @@ mgmt_streamer_free_buf(struct mgmt_streamer *streamer, void 
*buf)
 streamer->cfg->free_buf(buf, streamer->cb_arg);
 }
 
+void
+mgmt_unregister_group(struct mgmt_group *group)
+{
+struct mgmt_group *curr = mgmt_group_list, *prev;
+
+if (curr && curr == group) {

Review comment:
   Yes, agreed.





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




[GitHub] [mynewt-mcumgr] vrahane edited a comment on pull request #108: mgmt: Add support for un-registering a group along with the same support in img_mgmt

2021-02-11 Thread GitBox


vrahane edited a comment on pull request #108:
URL: https://github.com/apache/mynewt-mcumgr/pull/108#issuecomment-777666374


   > https://travis-ci.org/github/apache/mynewt-nimble/jobs/758517372
   > 
   > this breaks build...
   
   Thank you @sjanc, somehow, I did not see any build issues on the zephyr 
build locally. @utzig ’s PR will fix it.



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




[GitHub] [mynewt-mcumgr] vrahane commented on a change in pull request #108: mgmt: Add support for un-registering a group along with the same support in img_mgmt

2021-02-11 Thread GitBox


vrahane commented on a change in pull request #108:
URL: https://github.com/apache/mynewt-mcumgr/pull/108#discussion_r574702947



##
File path: mgmt/src/mgmt.c
##
@@ -71,6 +71,31 @@ mgmt_streamer_free_buf(struct mgmt_streamer *streamer, void 
*buf)
 streamer->cfg->free_buf(buf, streamer->cb_arg);
 }
 
+void
+mgmt_unregister_group(struct mgmt_group *group)
+{
+struct mgmt_group *curr = mgmt_group_list, *prev;
+
+if (curr && curr == group) {
+mgmt_group_list = curr->mg_next;
+return;
+}
+
+while (curr && curr != group) {
+prev = curr;

Review comment:
   curr will never be equal to group here because we take care of that 
condition above.





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




[GitHub] [mynewt-mcumgr] vrahane commented on a change in pull request #108: mgmt: Add support for un-registering a group along with the same support in img_mgmt

2021-02-11 Thread GitBox


vrahane commented on a change in pull request #108:
URL: https://github.com/apache/mynewt-mcumgr/pull/108#discussion_r574681140



##
File path: mgmt/src/mgmt.c
##
@@ -71,6 +71,31 @@ mgmt_streamer_free_buf(struct mgmt_streamer *streamer, void 
*buf)
 streamer->cfg->free_buf(buf, streamer->cb_arg);
 }
 
+void
+mgmt_unregister_group(struct mgmt_group *group)
+{
+struct mgmt_group *curr = mgmt_group_list, *prev;
+
+if (curr && curr == group) {
+mgmt_group_list = curr->mg_next;
+return;
+}
+
+while (curr && curr != group) {
+prev = curr;

Review comment:
   Agreed, this needs a fix.





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




[GitHub] [mynewt-mcumgr] vrahane commented on pull request #108: mgmt: Add support for un-registering a group along with the same support in img_mgmt

2021-02-11 Thread GitBox


vrahane commented on pull request #108:
URL: https://github.com/apache/mynewt-mcumgr/pull/108#issuecomment-777666374


   > https://travis-ci.org/github/apache/mynewt-nimble/jobs/758517372
   > 
   > this breaks build...
   
   Thank you @sjanc, I did not see any build issues on the zephyr build 
locally. @utzig ’s PR will fix it.



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




[GitHub] [mynewt-mcumgr] vrahane commented on a change in pull request #108: mgmt: Add support for un-registering a group along with the same support in img_mgmt

2021-02-11 Thread GitBox


vrahane commented on a change in pull request #108:
URL: https://github.com/apache/mynewt-mcumgr/pull/108#discussion_r574677976



##
File path: mgmt/src/mgmt.c
##
@@ -71,6 +71,31 @@ mgmt_streamer_free_buf(struct mgmt_streamer *streamer, void 
*buf)
 streamer->cfg->free_buf(buf, streamer->cb_arg);
 }
 
+void
+mgmt_unregister_group(struct mgmt_group *group)
+{
+struct mgmt_group *curr = mgmt_group_list, *prev;
+
+if (curr && curr == group) {

Review comment:
   Yes, agreed.





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




[GitHub] [mynewt-mcumgr] vrahane commented on a change in pull request #108: mgmt: Add support for un-registering a group along with the same support in img_mgmt

2021-02-11 Thread GitBox


vrahane commented on a change in pull request #108:
URL: https://github.com/apache/mynewt-mcumgr/pull/108#discussion_r574702947



##
File path: mgmt/src/mgmt.c
##
@@ -71,6 +71,31 @@ mgmt_streamer_free_buf(struct mgmt_streamer *streamer, void 
*buf)
 streamer->cfg->free_buf(buf, streamer->cb_arg);
 }
 
+void
+mgmt_unregister_group(struct mgmt_group *group)
+{
+struct mgmt_group *curr = mgmt_group_list, *prev;
+
+if (curr && curr == group) {
+mgmt_group_list = curr->mg_next;
+return;
+}
+
+while (curr && curr != group) {
+prev = curr;

Review comment:
   curr will never be equal to group initially here because we take care of 
that condition above.





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




[GitHub] [mynewt-core] utzig merged pull request #2477: Enable Mbed TLS self-tests which were not running

2021-02-11 Thread GitBox


utzig merged pull request #2477:
URL: https://github.com/apache/mynewt-core/pull/2477


   



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




[mynewt-core] branch master updated: Enable Mbed TLS self-tests which were not running

2021-02-11 Thread utzig
This is an automated email from the ASF dual-hosted git repository.

utzig pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git


The following commit(s) were added to refs/heads/master by this push:
 new 461f880  Enable Mbed TLS self-tests which were not running
461f880 is described below

commit 461f8808954c9fcd4b13e0098232cc4913b020c3
Author: Fabio Utzig 
AuthorDate: Thu Feb 11 11:35:53 2021 -0300

Enable Mbed TLS self-tests which were not running

Enable extra self-tests from Mbed TLS. Added ARIA, CMAC, MD2, MD4 and
J-PAKE tests. The test order was sorted for easier reading.

Signed-off-by: Fabio Utzig 
---
 crypto/mbedtls/include/mbedtls/config.h   | 10 ++--
 crypto/mbedtls/include/mbedtls/config_mynewt.h| 17 +++
 crypto/mbedtls/selftest/pkg.yml   |  2 +-
 crypto/mbedtls/selftest/src/mbedtls_test.c| 59 ++-
 crypto/mbedtls/selftest/src/mbedtls_test.h| 29 ++-
 crypto/mbedtls/selftest/src/testcases/aria_test.c | 27 +++
 crypto/mbedtls/selftest/src/testcases/cmac.c  | 27 +++
 crypto/mbedtls/selftest/src/testcases/ecjpake.c   | 27 +++
 crypto/mbedtls/selftest/src/testcases/md2_test.c  | 27 +++
 crypto/mbedtls/selftest/src/testcases/md4_test.c  | 27 +++
 crypto/mbedtls/selftest/syscfg.yml|  5 ++
 crypto/mbedtls/syscfg.yml | 10 
 12 files changed, 225 insertions(+), 42 deletions(-)

diff --git a/crypto/mbedtls/include/mbedtls/config.h 
b/crypto/mbedtls/include/mbedtls/config.h
index ad0fa6a..9d5dbfa 100644
--- a/crypto/mbedtls/include/mbedtls/config.h
+++ b/crypto/mbedtls/include/mbedtls/config.h
@@ -2161,7 +2161,7 @@
  *  MBEDTLS_TLS_ECDHE_PSK_WITH_ARIA_128_CBC_SHA256
  *  MBEDTLS_TLS_ECDHE_PSK_WITH_ARIA_256_CBC_SHA384
  */
-//#define MBEDTLS_ARIA_C
+#define MBEDTLS_ARIA_C
 
 /**
  * \def MBEDTLS_CCM_C
@@ -2232,7 +2232,7 @@
  * Requires: MBEDTLS_AES_C or MBEDTLS_DES_C
  *
  */
-//#define MBEDTLS_CMAC_C
+#define MBEDTLS_CMAC_C
 
 /**
  * \def MBEDTLS_CTR_DRBG_C
@@ -2366,7 +2366,7 @@
  *
  * Requires: MBEDTLS_ECP_C, MBEDTLS_MD_C
  */
-//#define MBEDTLS_ECJPAKE_C
+#define MBEDTLS_ECJPAKE_C
 
 /**
  * \def MBEDTLS_ECP_C
@@ -2514,7 +2514,7 @@
  *it, and considering stronger message digests instead.
  *
  */
-//#define MBEDTLS_MD2_C
+#define MBEDTLS_MD2_C
 
 /**
  * \def MBEDTLS_MD4_C
@@ -2531,7 +2531,7 @@
  *it, and considering stronger message digests instead.
  *
  */
-//#define MBEDTLS_MD4_C
+#define MBEDTLS_MD4_C
 
 /**
  * \def MBEDTLS_MD5_C
diff --git a/crypto/mbedtls/include/mbedtls/config_mynewt.h 
b/crypto/mbedtls/include/mbedtls/config_mynewt.h
index 1d2ed0a..9620b9d 100644
--- a/crypto/mbedtls/include/mbedtls/config_mynewt.h
+++ b/crypto/mbedtls/include/mbedtls/config_mynewt.h
@@ -183,6 +183,10 @@ extern "C" {
 #undef MBEDTLS_ECP_DP_CURVE25519_ENABLED
 #endif
 
+#if MYNEWT_VAL(MBEDTLS_ECJPAKE_C) == 0
+#undef MBEDTLS_ECJPAKE_C
+#endif
+
 #if MYNEWT_VAL(MBEDTLS_AES_ALT) == 0
 #undef MBEDTLS_AES_ALT
 #endif
@@ -202,6 +206,9 @@ extern "C" {
 #if MYNEWT_VAL(MBEDTLS_ARC4_C) == 0
 #undef MBEDTLS_ARC4_C
 #endif
+#if MYNEWT_VAL(MBEDTLS_ARIA_C) == 0
+#undef MBEDTLS_ARIA_C
+#endif
 #if MYNEWT_VAL(MBEDTLS_BLOWFISH_C) == 0
 #undef MBEDTLS_BLOWFISH_C
 #endif
@@ -227,6 +234,10 @@ extern "C" {
 #undef MBEDTLS_POLY1305_C
 #endif
 
+#if MYNEWT_VAL(MBEDTLS_CMAC_C) == 0
+#undef MBEDTLS_CMAC_C
+#endif
+
 #if MYNEWT_VAL(MBEDTLS_CIPHER_MODE_CBC) == 0
 #undef MBEDTLS_CIPHER_MODE_CBC
 #endif
@@ -258,6 +269,12 @@ extern "C" {
 #if MYNEWT_VAL(MBEDTLS_SHA256_C) == 0
 #undef MBEDTLS_SHA256_C
 #endif
+#if MYNEWT_VAL(MBEDTLS_MD2_C) == 0
+#undef MBEDTLS_MD2_C
+#endif
+#if MYNEWT_VAL(MBEDTLS_MD4_C) == 0
+#undef MBEDTLS_MD4_C
+#endif
 #if MYNEWT_VAL(MBEDTLS_MD5_C) == 0
 #undef MBEDTLS_MD5_C
 #endif
diff --git a/crypto/mbedtls/selftest/pkg.yml b/crypto/mbedtls/selftest/pkg.yml
index daf3e83..b84ebc1 100644
--- a/crypto/mbedtls/selftest/pkg.yml
+++ b/crypto/mbedtls/selftest/pkg.yml
@@ -17,7 +17,7 @@
 #
 pkg.name: crypto/mbedtls/selftest
 pkg.type: unittest
-pkg.description: "mbedtls unit tests."
+pkg.description: "Mbed TLS unit tests."
 pkg.author: "Apache Mynewt "
 pkg.homepage: "http://mynewt.apache.org/;
 pkg.keywords:
diff --git a/crypto/mbedtls/selftest/src/mbedtls_test.c 
b/crypto/mbedtls/selftest/src/mbedtls_test.c
index 77b0903..a8941cc 100644
--- a/crypto/mbedtls/selftest/src/mbedtls_test.c
+++ b/crypto/mbedtls/selftest/src/mbedtls_test.c
@@ -52,63 +52,74 @@
 #include "mbedtls/base64.h"
 #include "mbedtls/timing.h"
 
-TEST_CASE_DECL(sha1_test)
-TEST_CASE_DECL(sha256_test)
-TEST_CASE_DECL(sha512_test)
 TEST_CASE_DECL(aes_test)
 TEST_CASE_DECL(arc4_test)
+TEST_CASE_DECL(aria_test)
+TEST_CASE_DECL(base64_test)
 TEST_CASE_DECL(bignum_test)
+TEST_CASE_DECL(camellia_test)
 TEST_CASE_DECL(ccm_test)
+TEST_CASE_DECL(chacha20_test)
+TEST_CASE_DECL(chachapoly_test)

[GitHub] [mynewt-mcumgr] vrahane commented on a change in pull request #108: mgmt: Add support for un-registering a group along with the same support in img_mgmt

2021-02-11 Thread GitBox


vrahane commented on a change in pull request #108:
URL: https://github.com/apache/mynewt-mcumgr/pull/108#discussion_r574676640



##
File path: mgmt/src/mgmt.c
##
@@ -71,6 +71,31 @@ mgmt_streamer_free_buf(struct mgmt_streamer *streamer, void 
*buf)
 streamer->cfg->free_buf(buf, streamer->cb_arg);
 }
 
+void
+mgmt_unregister_group(struct mgmt_group *group)
+{
+struct mgmt_group *curr = mgmt_group_list, *prev;

Review comment:
mgmt_register_group() does not do it either.





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




[GitHub] [mynewt-core] utzig commented on pull request #2461: stm32 spi bus driver

2021-02-11 Thread GitBox


utzig commented on pull request #2461:
URL: https://github.com/apache/mynewt-core/pull/2461#issuecomment-43696


   @kasjer Please rebase.



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