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 11:38:28 UTC

[GitHub] [incubator-nuttx] SPRESENSE opened a new pull request, #7358: mtd/smart: Fix a compile error in smart_fsck

SPRESENSE opened a new pull request, #7358:
URL: https://github.com/apache/incubator-nuttx/pull/7358

   ## Summary
   Fix a compile error caused by below commit.
   9ad75fd95d Added SMART flash filesystem to RP2040
   Add some macro functions for smartfs driver.
   Fix Issue https://github.com/apache/incubator-nuttx/issues/7233
   
   ## Impact
   None
   
   ## Testing
   Compile check when CONFIG_MTD_SMART_FSCK is enabled
   


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


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

Posted by GitBox <gi...@apache.org>.
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-unsubscribe@nuttx.apache.org

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


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

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on code in PR #7358:
URL: https://github.com/apache/incubator-nuttx/pull/7358#discussion_r999584148


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

Review Comment:
   ```suggestion
     (uint16_t)((FAR const uint8_t *)(h)->nextsector)[1] << 8 | \
     (uint16_t)((FAR const uint8_t *)(h)->nextsector)[0]
   ```



##########
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:
   ```suggestion
       ((FAR uint8_t *)(h)->nextsector)[0] = (v) & 0xff; \
       ((FAR uint8_t *)(h)->nextsector)[1] = (v) >> 8;   \
   ```



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


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

Posted by GitBox <gi...@apache.org>.
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


[GitHub] [incubator-nuttx] xiaoxiang781216 merged pull request #7358: mtd/smart: Fix a compile error in smart_fsck

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 merged PR #7358:
URL: https://github.com/apache/incubator-nuttx/pull/7358


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