You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/04/06 12:07:13 UTC

[GitHub] [incubator-nuttx] pkarashchenko commented on a diff in pull request #5992: sched/note: correct flatten format

pkarashchenko commented on code in PR #5992:
URL: https://github.com/apache/incubator-nuttx/pull/5992#discussion_r843867339


##########
sched/sched/sched_note.c:
##########
@@ -122,18 +123,17 @@ static inline void sched_note_flatten(FAR uint8_t *dst,
     {
 #ifdef CONFIG_HAVE_LONG_LONG
       case 8:
-        dst[7] = (uint8_t)((*(uint64_t *)src >> 56) & 0xff);
-        dst[6] = (uint8_t)((*(uint64_t *)src >> 48) & 0xff);
-        dst[5] = (uint8_t)((*(uint64_t *)src >> 40) & 0xff);
-        dst[4] = (uint8_t)((*(uint64_t *)src >> 32) & 0xff);
+        *(uint64_t *)dst = htole64(*(uint64_t *)src);

Review Comment:
   Are we sure that `dst` points to properly aligned memory?



-- 
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: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org