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


##########
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:
   Done.



##########
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;   \

Review Comment:
   Done.



-- 
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-unsubscr...@nuttx.apache.org

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

Reply via email to