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/10/19 14:58:00 UTC

[GitHub] [incubator-nuttx] pkarashchenko commented on a diff in pull request #7358: mtd/smart: Fix a compile error in smart_fsck

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


##########
drivers/mtd/smart.c:
##########
@@ -146,6 +146,22 @@
 #define CLR_BITMAP(m, n) do { (m)[(n) / 8] &= ~(1 << ((n) % 8)); } while (0)
 #define ISSET_BITMAP(m, n) ((m)[(n) / 8] & (1 << ((n) % 8)))
 
+#ifdef CONFIG_SMARTFS_ALIGNED_ACCESS
+#  define SMARTFS_NEXTSECTOR(h) \
+  (uint16_t)((FAR const uint8_t *)h->nextsector)[1] << 8 | \
+  (uint16_t)((FAR const uint8_t *)h->nextsector)[0]
+
+#  define SMARTFS_SET_NEXTSECTOR(h, v) do { \
+    ((FAR uint8_t *)h->nextsector)[0] = v & 0xff; \
+    ((FAR uint8_t *)h->nextsector)[1] = v >> 8;   \
+  } while (0)
+
+#else
+#  define SMARTFS_NEXTSECTOR(h)        (*((uint16_t *)h->nextsector))
+#  define SMARTFS_SET_NEXTSECTOR(h, v) ((*((uint16_t *)h->nextsector)) = \

Review Comment:
   ```suggestion
   #  define SMARTFS_NEXTSECTOR(h)        (*((FAR uint16_t *)h->nextsector))
   #  define SMARTFS_SET_NEXTSECTOR(h, v) ((*((FAR uint16_t *)h->nextsector)) = \
   ```



-- 
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