pkarashchenko commented on code in PR #5992:
URL: https://github.com/apache/incubator-nuttx/pull/5992#discussion_r844309610
##########
sched/sched/sched_note.c:
##########
@@ -116,24 +117,35 @@ static unsigned int
g_note_disabled_irq_nest[CONFIG_SMP_NCPUS];
****************************************************************************/
static inline void sched_note_flatten(FAR uint8_t *dst,
- FAR void *src, size_t len)
+ FAR void *src_, size_t len)
{
+ FAR uint8_t *src = src_;
+
switch (len)
Review Comment:
Code is fine, but I was just thinking why just not to:
```
switch (len)
{
case 8:
case 4:
case 2:
case 1:
#ifdef CONFIG_ENDIAN_BIG
{
FAR uint8_t *end = (FAR uint8_t *)src + len - 1;
while (len-- > 0)
{
*dst++ = *end--;
}
}
#else
memcpy(dst, src, len);
#endif
break;
default:
DEBUGASSERT(FALSE);
break;
}
```
Seems to be more clear.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]