You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2020/11/22 03:38:38 UTC

[incubator-nuttx] branch master updated (a0112ee -> d068713)

This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git.


    from a0112ee  stm32h7: Bug where more than CONFIG_MM_REGIONS would be allocated
     new b48408c  drivers/mtd/ftl.c: Fix syslog formats
     new 042881e  fs/nxffs/nxffs_cache.c: Appease nxstyle
     new 35c30c2  fs/nxffs/nxffs_cache.c: Fix syslog formats
     new e1a8f8a  fs/nxffs/nxffs_open.c: Appease nxstyle
     new 99407f4  fs/nxffs/nxffs_open.c: Fix a syslog format
     new 660db6b  fs/nxffs/nxffs_pack.c: Appease nxstyle
     new 889c332  fs/nxffs/nxffs_pack.c: Fix a syslog format
     new 3f2390e  fs/nxffs/nxffs_read.c: Appease nxstyle
     new d22c8a2  fs/nxffs/nxffs_read.c: Fix a syslog format
     new d28d5a2  fs/nxffs/nxffs_reformat.c: Appease nxstyle
     new 7df9d89  fs/nxffs/nxffs_reformat.c: Fix syslog formats
     new d543f7f  fs/nxffs/nxffs_stat.c: Fix syslog formats
     new ae45a66  fs/nxffs/nxffs_write.c: Fix a syslog format
     new d2d48a1  sched/module/mod_modhandle.c: Fix a syslog format
     new 6bdca69  libs/libc/modlib/modlib_bind.c: Fix syslog formats
     new 34cd44f  libs/libc/modlib/modlib_symbols.c: Fix syslog formats
     new 04f2542  libs/libc/machine/arm/armv7-m/arch_elf.c: Appease nxstyle
     new 42a218d  libs/libc/machine/arm/armv7-m/arch_elf.c: Fix syslog formats
     new 67fbbf9  fs/romfs/fs_romfs.c: Fix syslog formats
     new 13e55ce  fs/romfs/fs_romfsutil.c: Fix syslog formats
     new 148ee15  binfmt/libelf/libelf_bind.c: Fix syslog formats
     new d068713  binfmt/libelf/libelf_symbols.c: Fix syslog formats

The 22 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 binfmt/libelf/libelf_bind.c              |  11 ++-
 binfmt/libelf/libelf_symbols.c           |  14 +--
 drivers/mtd/ftl.c                        |   6 +-
 fs/nxffs/nxffs_cache.c                   |  17 ++--
 fs/nxffs/nxffs_open.c                    |  36 +++++---
 fs/nxffs/nxffs_pack.c                    | 145 +++++++++++++++++--------------
 fs/nxffs/nxffs_read.c                    |  27 ++++--
 fs/nxffs/nxffs_reformat.c                |  26 +++---
 fs/nxffs/nxffs_stat.c                    |   4 +-
 fs/nxffs/nxffs_write.c                   |   3 +-
 fs/romfs/fs_romfs.c                      |  11 +--
 fs/romfs/fs_romfsutil.c                  |   4 +-
 libs/libc/machine/arm/armv7-m/arch_elf.c |  92 +++++++++++++-------
 libs/libc/modlib/modlib_bind.c           |  12 ++-
 libs/libc/modlib/modlib_symbols.c        |  17 ++--
 sched/module/mod_modhandle.c             |   2 +-
 16 files changed, 263 insertions(+), 164 deletions(-)


[incubator-nuttx] 06/22: fs/nxffs/nxffs_pack.c: Appease nxstyle

Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 660db6b248d5ebbb83f87f409ffa74755d2bbbcd
Author: YAMAMOTO Takashi <ya...@midokura.com>
AuthorDate: Sun Nov 22 09:50:13 2020 +0900

    fs/nxffs/nxffs_pack.c: Appease nxstyle
---
 fs/nxffs/nxffs_pack.c | 143 ++++++++++++++++++++++++++++----------------------
 1 file changed, 81 insertions(+), 62 deletions(-)

diff --git a/fs/nxffs/nxffs_pack.c b/fs/nxffs/nxffs_pack.c
index a87a88f..4216d41 100644
--- a/fs/nxffs/nxffs_pack.c
+++ b/fs/nxffs/nxffs_pack.c
@@ -337,7 +337,8 @@ static inline int nxffs_startpos(FAR struct nxffs_volume_s *volume,
            */
 
           nbytes += blkentry.datlen;
-          offset  = blkentry.hoffset + SIZEOF_NXFFS_DATA_HDR + blkentry.datlen;
+          offset  = blkentry.hoffset + SIZEOF_NXFFS_DATA_HDR +
+                    blkentry.datlen;
         }
 
       /* Make sure there is space at this location for an inode header */
@@ -454,10 +455,10 @@ static int nxffs_destsetup(FAR struct nxffs_volume_s *volume,
   /* The destination can be in one of three of states:
    *
    * State 1: The inode position was not yet been found.  This condition can
-   * only occur on initial entry into nxffs_packblock() when there we no space
-   * for the inode header at the end of the previous block.  We must now be
-   * at the beginning of a shiny new I/O block, so we should always have
-   * space for a new inode header right here.
+   * only occur on initial entry into nxffs_packblock() when there we no
+   * space for the inode header at the end of the previous block.  We must
+   * now be at the beginning of a shiny new I/O block, so we should always
+   * have space for a new inode header right here.
    */
 
   if (pack->dest.entry.hoffset == 0)
@@ -528,8 +529,8 @@ static int nxffs_destsetup(FAR struct nxffs_volume_s *volume,
       pack->iooffset += namlen;
     }
 
-  /* State 3: Inode header not-written, inode name written.  Still need the position
-   * of the first data block.
+  /* State 3: Inode header not-written, inode name written.  Still need the
+   * position of the first data block.
    *
    * Deal with the special case where the source inode is a zero length file
    * with no data blocks to be transferred.
@@ -539,16 +540,16 @@ static int nxffs_destsetup(FAR struct nxffs_volume_s *volume,
     {
       if (pack->dest.entry.doffset == 0)
         {
-          /* Will the data block header plus a minimal amount of data fit in this
-           * block? (or the whole file if the file is very small).
+          /* Will the data block header plus a minimal amount of data fit in
+           * this block? (or the whole file if the file is very small).
            */
 
           mindata = MIN(NXFFS_MINDATA, pack->dest.entry.datlen);
           if (pack->iooffset + SIZEOF_NXFFS_DATA_HDR + mindata >
               volume->geo.blocksize)
             {
-              /* No.. return an indication that we are at the end of the block
-               * and try again later.
+              /* No.. return an indication that we are at the end of the
+               * block and try again later.
                */
 
               ret = -ENOSPC;
@@ -560,29 +561,31 @@ static int nxffs_destsetup(FAR struct nxffs_volume_s *volume,
           pack->dest.entry.doffset = nxffs_packtell(volume, pack);
           pack->iooffset          += SIZEOF_NXFFS_DATA_HDR;
 
-          /* Initialize the output data stream to start with the first data block */
+          /* Initialize the output data stream to start with the first data
+           * block
+           */
 
           pack->dest.blkoffset     = pack->dest.entry.doffset;
           pack->dest.blklen        = 0;
           pack->dest.blkpos        = 0;
         }
 
-      /* State 4:  Starting a new block.  Verify that there is space in the current
-       * block for another (minimal sized) block
+      /* State 4:  Starting a new block.  Verify that there is space in the
+       * current block for another (minimal sized) block
        */
 
       if (pack->dest.blkoffset == 0)
         {
-          /* Will the data block header plus a minimal amount of data fit in this
-           * block? (or the whole file if the file is very small).
+          /* Will the data block header plus a minimal amount of data fit in
+           * this block? (or the whole file if the file is very small).
            */
 
           mindata = MIN(NXFFS_MINDATA, pack->dest.entry.datlen);
           if (pack->iooffset + SIZEOF_NXFFS_DATA_HDR + mindata >
               volume->geo.blocksize)
             {
-              /* No.. return an indication that we are at the end of the block
-               * and try again later.
+              /* No.. return an indication that we are at the end of the
+               * block and try again later.
                */
 
               ret = -ENOSPC;
@@ -691,7 +694,8 @@ static int nxffs_wrinodehdr(FAR struct nxffs_volume_s *volume,
       /* Calculate the CRC */
 
       crc = crc32((FAR const uint8_t *)inode, SIZEOF_NXFFS_INODE_HDR);
-      crc = crc32part((FAR const uint8_t *)pack->dest.entry.name, namlen, crc);
+      crc = crc32part((FAR const uint8_t *)pack->dest.entry.name, namlen,
+                      crc);
 
       /* Finish the inode header */
 
@@ -742,9 +746,9 @@ static void nxffs_wrdathdr(FAR struct nxffs_volume_s *volume,
 
   if (pack->dest.blklen > 0)
     {
-      /* Get the offset in the block corresponding to the location of the data
-       * block header.  NOTE:  This must lie in the same block as we currently have
-       * buffered.
+      /* Get the offset in the block corresponding to the location of the
+       * data block header.  NOTE:  This must lie in the same block as we
+       * currently have buffered.
        */
 
       ioblock  = nxffs_getblock(volume, pack->dest.blkoffset);
@@ -928,8 +932,8 @@ static inline int nxffs_packblock(FAR struct nxffs_volume_s *volume,
     }
 
   /* Loop, transferring data from the source block to the destination pack
-   * buffer until either (1) the source stream is exhausted, (2) the destination
-   * block is full, or (3) an error occurs.
+   * buffer until either (1) the source stream is exhausted, (2) the
+   * destination block is full, or (3) an error occurs.
    */
 
   for (; ; )
@@ -962,8 +966,8 @@ static inline int nxffs_packblock(FAR struct nxffs_volume_s *volume,
           ret = nxffs_nextentry(volume, offset, &pack->src.entry);
           if (ret < 0)
             {
-              /* No more valid inode entries.  Just return an end-of-flash error
-               * indication.
+              /* No more valid inode entries.  Just return an end-of-flash
+               * error indication.
                */
 
               return -ENOSPC;
@@ -989,10 +993,11 @@ static inline int nxffs_packblock(FAR struct nxffs_volume_s *volume,
            * the inode header?
            */
 
-          if (pack->iooffset + SIZEOF_NXFFS_INODE_HDR > volume->geo.blocksize)
+          if (pack->iooffset + SIZEOF_NXFFS_INODE_HDR >
+              volume->geo.blocksize)
             {
-              /* No, just return success... we will handle this condition when
-               * this function is called on the next I/O block.
+              /* No, just return success... we will handle this condition
+               * when this function is called on the next I/O block.
                */
 
               return OK;
@@ -1003,9 +1008,9 @@ static inline int nxffs_packblock(FAR struct nxffs_volume_s *volume,
           ret = nxffs_destsetup(volume, pack);
           if (ret < 0)
             {
-              /* -ENOSPC is a special return value which simply means that all of the
-               * has been used up to the end.  We need to return OK in this case and
-               * resume at the next block.
+              /* -ENOSPC is a special return value which simply means that
+               * all of the has been used up to the end.  We need to return
+               * OK in this case and resume at the next block.
                */
 
               if (ret == -ENOSPC)
@@ -1014,7 +1019,8 @@ static inline int nxffs_packblock(FAR struct nxffs_volume_s *volume,
                 }
               else
                 {
-                  ferr("ERROR: Failed to configure the dest stream: %d\n", -ret);
+                  ferr("ERROR: Failed to configure the dest stream: %d\n",
+                       -ret);
                   return ret;
                 }
             }
@@ -1037,7 +1043,9 @@ static inline int nxffs_packblock(FAR struct nxffs_volume_s *volume,
 
       if (pack->iooffset >= volume->geo.blocksize)
         {
-          /* Yes.. Write the destination data block header and return success */
+          /* Yes.. Write the destination data block header and return
+           * success
+           */
 
           nxffs_wrdathdr(volume, pack);
           return OK;
@@ -1081,10 +1089,10 @@ nxffs_setupwriter(FAR struct nxffs_volume_s *volume,
        * this packing activity.  The writer may have failed in one of several
        * different stages:
        *
-       *   hoffset == 0: The write failed early before even FLASH for the inode
-       *     header was set aside.
-       *   noffset == 0: The write failed after the inode header was set aside,
-       *     but before the inode name was written.
+       *   hoffset == 0: The write failed early before even FLASH for the
+       *     inode header was set aside.
+       *   noffset == 0: The write failed after the inode header was set
+       *     aside, but before the inode name was written.
        *   doffset == 0: The write failed after writing the inode name, bue
        *     before any data blocks were written to FLASH.
        *
@@ -1182,8 +1190,8 @@ static inline int nxffs_packwriter(FAR struct nxffs_volume_s *volume,
     }
 
   /* Loop, transferring data from the source block to the destination pack
-   * buffer until either (1) the source stream is exhausted, (2) the destination
-   * block is full, or (3) an error occurs.
+   * buffer until either (1) the source stream is exhausted, (2) the
+   * destination block is full, or (3) an error occurs.
    */
 
   for (; ; )
@@ -1237,7 +1245,9 @@ static inline int nxffs_packwriter(FAR struct nxffs_volume_s *volume,
 
       if (pack->iooffset >= volume->geo.blocksize)
         {
-          /* Yes.. Write the destination data block header and return success */
+          /* Yes.. Write the destination data block header and return
+           * success
+           */
 
           nxffs_wrdathdr(volume, pack);
           return OK;
@@ -1287,10 +1297,10 @@ int nxffs_pack(FAR struct nxffs_volume_s *volume)
   if (iooffset == 0)
     {
       /* Offset zero is only returned if no valid blocks were found on the
-       * FLASH media or if there are no valid inode entries on the FLASH after
-       * the first valid block.  There are two possibilities:  (1) there
-       * really is nothing on the FLASH, or (2) there is a file being written
-       * to the FLASH now.
+       * FLASH media or if there are no valid inode entries on the FLASH
+       * after the first valid block.  There are two possibilities:  (1)
+       * there* really is nothing on the FLASH, or (2) there is a file being
+       * written to the FLASH now.
        */
 
       /* Is there a writer? */
@@ -1350,11 +1360,12 @@ int nxffs_pack(FAR struct nxffs_volume_s *volume)
       if (ret == -ENOSPC)
         {
           /* In the case where the volume is full, nxffs_startpos() will
-           * recalculate the free FLASH offset and store it in iooffset.  There
-           * may be deleted files at the end of FLASH.  In this case, we don't
-           * have to pack any files, we simply have to erase FLASH at the end.
-           * But don't do this unless there is some particularly big FLASH
-           * savings (otherwise, we risk wearing out these final blocks).
+           * recalculate the free FLASH offset and store it in iooffset.
+           * There may be deleted files at the end of FLASH.  In this case,
+           * we don't have to pack any files, we simply have to erase FLASH
+           * at the end. But don't do this unless there is some particularly
+           * big FLASH savings (otherwise, we risk wearing out these final
+           * blocks).
            */
 
           if (iooffset + CONFIG_NXFFS_TAILTHRESHOLD < volume->froffset)
@@ -1419,7 +1430,8 @@ start_pack:
        * previously marked bad blocks.
        */
 
-      ret = MTD_BREAD(volume->mtd, pack.block0, volume->blkper, volume->pack);
+      ret = MTD_BREAD(volume->mtd, pack.block0, volume->blkper,
+                      volume->pack);
       if (ret < 0)
         {
           ferr("ERROR: Failed to read erase block %d: %d\n", eblock, -ret);
@@ -1498,7 +1510,8 @@ start_pack:
                       if (ret < 0)
                         {
                           /* The error -ENOSPC is a special value that simply
-                           * means that there is nothing further to be packed.
+                           * means that there is nothing further to be
+                           * packed.
                            */
 
                           if (ret == -ENOSPC)
@@ -1506,10 +1519,11 @@ start_pack:
                               packed = true;
 
                               /* Writing is performed at the end of the free
-                               * FLASH region and this implementation is restricted
-                               * to a single writer.  The new inode is not
-                               * written to FLASH until the writer is closed
-                               * and so will not be found by nxffs_packblock().
+                               * FLASH region and this implementation is
+                               * restricted to a single writer.  The new
+                               * inode is not written to FLASH until the
+                               * writer is closed and so will not be found
+                               * by nxffs_packblock().
                                */
 
                               wrfile = nxffs_setupwriter(volume, &pack);
@@ -1518,15 +1532,17 @@ start_pack:
                             {
                               /* Otherwise, something really bad happened */
 
-                              ferr("ERROR: Failed to pack into block %d: %d\n",
+                              ferr("ERROR: Failed to pack into block %d: "
+                                   "%d\n",
                                    block, ret);
                               goto errout_with_pack;
                             }
                         }
                     }
 
-                  /* If all of the "normal" inodes have been packed, then check if
-                   * we need to pack the current, in-progress write operation.
+                  /* If all of the "normal" inodes have been packed, then
+                   * check if we need to pack the current, in-progress write
+                   * operation.
                    */
 
                   if (wrfile)
@@ -1539,7 +1555,8 @@ start_pack:
                       if (ret < 0)
                         {
                           /* The error -ENOSPC is a special value that simply
-                           * means that there is nothing further to be packed.
+                           * means that there is nothing further to be
+                           * packed.
                            */
 
                           if (ret == -ENOSPC)
@@ -1550,7 +1567,8 @@ start_pack:
                             {
                               /* Otherwise, something really bad happened */
 
-                              ferr("ERROR: Failed to pack into block %d: %d\n",
+                              ferr("ERROR: Failed to pack into block %d: "
+                                   "%d\n",
                                    block, ret);
                               goto errout_with_pack;
                             }
@@ -1591,7 +1609,8 @@ start_pack:
 
       /* Write the packed I/O block to FLASH */
 
-      ret = MTD_BWRITE(volume->mtd, pack.block0, volume->blkper, volume->pack);
+      ret = MTD_BWRITE(volume->mtd, pack.block0, volume->blkper,
+                       volume->pack);
       if (ret < 0)
         {
           ferr("ERROR: Failed to write erase block %d [%d]: %d\n",


[incubator-nuttx] 04/22: fs/nxffs/nxffs_open.c: Appease nxstyle

Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit e1a8f8a736c8f14cc4901a1d235e4ce4900e9681
Author: YAMAMOTO Takashi <ya...@midokura.com>
AuthorDate: Sun Nov 22 09:43:25 2020 +0900

    fs/nxffs/nxffs_open.c: Appease nxstyle
---
 fs/nxffs/nxffs_open.c | 36 ++++++++++++++++++++++--------------
 1 file changed, 22 insertions(+), 14 deletions(-)

diff --git a/fs/nxffs/nxffs_open.c b/fs/nxffs/nxffs_open.c
index c08a054..80b1e1e 100644
--- a/fs/nxffs/nxffs_open.c
+++ b/fs/nxffs/nxffs_open.c
@@ -99,7 +99,8 @@ static struct nxffs_wrfile_s g_wrfile;
  *
  *   On successful return the following are also valid:
  *
- *     wrfile->ofile.entry.hoffset - FLASH offset to candidate header position
+ *     wrfile->ofile.entry.hoffset - FLASH offset to candidate header
+ *       position
  *     volume->ioblock - Read/write block number of the block containing the
  *       header position
  *     volume->iooffset - The offset in the block to the candidate header
@@ -217,7 +218,8 @@ static inline int nxffs_nampos(FAR struct nxffs_volume_s *volume,
  *
  *   On successful return the following are also valid:
  *
- *     wrfile->ofile.entry.hoffset - FLASH offset to candidate header position
+ *     wrfile->ofile.entry.hoffset - FLASH offset to candidate header
+ *       position
  *     volume->ioblock - Read/write block number of the block containing the
  *       header position
  *     volume->iooffset - The offset in the block to the candidate header
@@ -451,9 +453,10 @@ static inline int nxffs_wropen(FAR struct nxffs_volume_s *volume,
 
       else if ((oflags & (O_CREAT | O_TRUNC)) == (O_CREAT | O_TRUNC))
         {
-          /* Just schedule the removal the file and fall through to re-create it.
-           * Note that the old file of the same name will not actually be removed
-           * until the new file is successfully written.
+          /* Just schedule the removal the file and fall through to re-create
+           * it.
+           * Note that the old file of the same name will not actually be
+           * removed until the new file is successfully written.
            */
 
           truncate = true;
@@ -465,7 +468,8 @@ static inline int nxffs_wropen(FAR struct nxffs_volume_s *volume,
 
       else
         {
-          ferr("ERROR: File %s exists and we were not asked to truncate it\n");
+          ferr("ERROR: File %s exists and we were not asked to "
+               "truncate it\n");
           ret = -ENOSYS;
           goto errout_with_exclsem;
         }
@@ -501,7 +505,8 @@ static inline int nxffs_wropen(FAR struct nxffs_volume_s *volume,
   wrfile = &g_wrfile;
   memset(wrfile, 0, sizeof(struct nxffs_wrfile_s));
 #else
-  wrfile = (FAR struct nxffs_wrfile_s *)kmm_zalloc(sizeof(struct nxffs_wrfile_s));
+  wrfile = (FAR struct nxffs_wrfile_s *)
+           kmm_zalloc(sizeof(struct nxffs_wrfile_s));
   if (!wrfile)
     {
       ret = -ENOMEM;
@@ -736,7 +741,8 @@ static inline int nxffs_rdopen(FAR struct nxffs_volume_s *volume,
     {
       /* Not already open.. create a new open structure */
 
-      ofile = (FAR struct nxffs_ofile_s *)kmm_zalloc(sizeof(struct nxffs_ofile_s));
+      ofile = (FAR struct nxffs_ofile_s *)
+              kmm_zalloc(sizeof(struct nxffs_ofile_s));
       if (!ofile)
         {
           ferr("ERROR: ofile allocation failed\n");
@@ -876,7 +882,8 @@ static inline int nxffs_wrclose(FAR struct nxffs_volume_s *volume,
       ret = nxffs_wrblkhdr(volume, wrfile);
       if (ret < 0)
         {
-          ferr("ERROR: Failed to write the final block of the file: %d\n", -ret);
+          ferr("ERROR: Failed to write the final block of the file: %d\n",
+               -ret);
           goto errout;
         }
     }
@@ -970,7 +977,8 @@ FAR struct nxffs_ofile_s *nxffs_findofile(FAR struct nxffs_volume_s *volume,
  *
  ****************************************************************************/
 
-FAR struct nxffs_wrfile_s *nxffs_findwriter(FAR struct nxffs_volume_s *volume)
+FAR struct nxffs_wrfile_s *nxffs_findwriter(
+                           FAR struct nxffs_volume_s *volume)
 {
   /* We can tell if the write is in-use because it will have an allocated
    * name attached.
@@ -1205,8 +1213,8 @@ errout:
  *   entry  - Describes the inode header to write
  *
  * Returned Value:
- *   Zero is returned on success; Otherwise, a negated errno value is returned
- *   indicating the nature of the failure.
+ *   Zero is returned on success; Otherwise, a negated errno value is
+ *   returned indicating the nature of the failure.
  *
  ****************************************************************************/
 
@@ -1288,8 +1296,8 @@ errout:
  *   entry  - Describes the new inode entry
  *
  * Returned Value:
- *   Zero is returned on success; Otherwise, a negated errno value is returned
- *   indicating the nature of the failure.
+ *   Zero is returned on success; Otherwise, a negated errno value is
+ *   returned indicating the nature of the failure.
  *
  ****************************************************************************/
 


[incubator-nuttx] 19/22: fs/romfs/fs_romfs.c: Fix syslog formats

Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 67fbbf935b3d73f3acd65bca49a5f124972e50d1
Author: YAMAMOTO Takashi <ya...@midokura.com>
AuthorDate: Sun Nov 22 10:52:05 2020 +0900

    fs/romfs/fs_romfs.c: Fix syslog formats
---
 fs/romfs/fs_romfs.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/fs/romfs/fs_romfs.c b/fs/romfs/fs_romfs.c
index d382352..675d075 100644
--- a/fs/romfs/fs_romfs.c
+++ b/fs/romfs/fs_romfs.c
@@ -375,7 +375,7 @@ static ssize_t romfs_read(FAR struct file *filep, FAR char *buffer,
   int                         sectorndx;
   int                         ret;
 
-  finfo("Read %zu bytes from offset %d\n", buflen, filep->f_pos);
+  finfo("Read %zu bytes from offset %jd\n", buflen, (intmax_t)filep->f_pos);
 
   /* Sanity checks */
 
@@ -443,7 +443,8 @@ static ssize_t romfs_read(FAR struct file *filep, FAR char *buffer,
 
           /* Read all of the sectors directly into user memory */
 
-          finfo("Read %d sectors starting with %d\n", nsectors, sector);
+          finfo("Read %d sectors starting with %jd\n", nsectors,
+                (intmax_t)sector);
           ret = romfs_hwread(rm, userbuffer, sector, nsectors);
           if (ret < 0)
             {
@@ -460,7 +461,7 @@ static ssize_t romfs_read(FAR struct file *filep, FAR char *buffer,
            * it is already there then all is well.
            */
 
-          finfo("Read sector %d\n", sector);
+          finfo("Read sector %jd\n", (intmax_t)sector);
           ret = romfs_filecacheread(rm, rf, sector);
           if (ret < 0)
             {
@@ -510,7 +511,7 @@ static off_t romfs_seek(FAR struct file *filep, off_t offset, int whence)
   off_t                       position;
   int                         ret;
 
-  finfo("Seek to offset: %d whence: %d\n", offset, whence);
+  finfo("Seek to offset: %jd whence: %d\n", (intmax_t)offset, whence);
 
   /* Sanity checks */
 
@@ -575,7 +576,7 @@ static off_t romfs_seek(FAR struct file *filep, off_t offset, int whence)
   /* Set file position and return success */
 
   filep->f_pos = position;
-  finfo("New file position: %d\n", filep->f_pos);
+  finfo("New file position: %jd\n", (intmax_t)filep->f_pos);
 
   romfs_semgive(rm);
   return OK;


[incubator-nuttx] 16/22: libs/libc/modlib/modlib_symbols.c: Fix syslog formats

Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 34cd44f8d7df19eece6420babaceda64ae971f06
Author: YAMAMOTO Takashi <ya...@midokura.com>
AuthorDate: Sun Nov 22 10:15:04 2020 +0900

    libs/libc/modlib/modlib_symbols.c: Fix syslog formats
---
 libs/libc/modlib/modlib_symbols.c | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/libs/libc/modlib/modlib_symbols.c b/libs/libc/modlib/modlib_symbols.c
index 3082db2..3d3fd43 100644
--- a/libs/libc/modlib/modlib_symbols.c
+++ b/libs/libc/modlib/modlib_symbols.c
@@ -24,6 +24,8 @@
 
 #include <nuttx/config.h>
 
+#include <inttypes.h>
+#include <stdint.h>
 #include <stdlib.h>
 #include <string.h>
 #include <errno.h>
@@ -366,7 +368,7 @@ int modlib_symvalue(FAR struct module_s *modp,
                                       (FAR void *)&exportinfo);
         if (ret < 0)
           {
-            berr("ERROR: modlib_symcallback failed: \n", ret);
+            berr("ERROR: modlib_symcallback failed: %d\n", ret);
             return ret;
           }
 
@@ -401,9 +403,11 @@ int modlib_symvalue(FAR struct module_s *modp,
          * entry
          */
 
-        binfo("SHN_UNDEF: name=%s %08x+%08x=%08x\n",
-              loadinfo->iobuffer, sym->st_value, symbol->sym_value,
-              sym->st_value + symbol->sym_value);
+        binfo("SHN_UNDEF: name=%s "
+              "%08" PRIxPTR "+%08" PRIxPTR "=%08" PRIxPTR "\n",
+              loadinfo->iobuffer,
+              (uintptr_t)sym->st_value, (uintptr_t)symbol->sym_value,
+              (uintptr_t)(sym->st_value + symbol->sym_value));
 
         sym->st_value += ((uintptr_t)symbol->sym_value);
       }
@@ -413,8 +417,9 @@ int modlib_symvalue(FAR struct module_s *modp,
       {
         secbase = loadinfo->shdr[sym->st_shndx].sh_addr;
 
-        binfo("Other: %08x+%08x=%08x\n",
-              sym->st_value, secbase, sym->st_value + secbase);
+        binfo("Other: %08" PRIxPTR "+%08" PRIxPTR "=%08" PRIxPTR "\n",
+              (uintptr_t)sym->st_value, secbase,
+              (uintptr_t)(sym->st_value + secbase));
 
         sym->st_value += secbase;
       }


[incubator-nuttx] 07/22: fs/nxffs/nxffs_pack.c: Fix a syslog format

Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 889c33277cb2cec3fe6caedf4cdb16cabdf37843
Author: YAMAMOTO Takashi <ya...@midokura.com>
AuthorDate: Sun Nov 22 09:50:48 2020 +0900

    fs/nxffs/nxffs_pack.c: Fix a syslog format
---
 fs/nxffs/nxffs_pack.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/nxffs/nxffs_pack.c b/fs/nxffs/nxffs_pack.c
index 4216d41..aefff87 100644
--- a/fs/nxffs/nxffs_pack.c
+++ b/fs/nxffs/nxffs_pack.c
@@ -709,7 +709,7 @@ static int nxffs_wrinodehdr(FAR struct nxffs_volume_s *volume,
       ret = nxffs_updateinode(volume, &pack->dest.entry);
       if (ret < 0)
         {
-          ferr("ERROR: Failed to update inode info: %s\n", -ret);
+          ferr("ERROR: Failed to update inode info: %d\n", -ret);
         }
     }
 


[incubator-nuttx] 15/22: libs/libc/modlib/modlib_bind.c: Fix syslog formats

Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 6bdca69a32f1f1d4d4e417a127d6e16536602616
Author: YAMAMOTO Takashi <ya...@midokura.com>
AuthorDate: Sun Nov 22 10:05:59 2020 +0900

    libs/libc/modlib/modlib_bind.c: Fix syslog formats
---
 libs/libc/modlib/modlib_bind.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/libs/libc/modlib/modlib_bind.c b/libs/libc/modlib/modlib_bind.c
index 4c1b9e0..b9de73a 100644
--- a/libs/libc/modlib/modlib_bind.c
+++ b/libs/libc/modlib/modlib_bind.c
@@ -301,8 +301,10 @@ static int modlib_relocate(FAR struct module_s *modp,
           rel->r_offset > dstsec->sh_size - sizeof(uint32_t))
         {
           berr("ERROR: Section %d reloc %d: "
-               "Relocation address out of range, offset %d size %d\n",
-               relidx, i, rel->r_offset, dstsec->sh_size);
+               "Relocation address out of range, "
+               "offset %" PRIuPTR " size %ju\n",
+               relidx, i, (uintptr_t)rel->r_offset,
+               (uintmax_t)dstsec->sh_size);
           ret = -EINVAL;
           break;
         }
@@ -487,8 +489,10 @@ static int modlib_relocateadd(FAR struct module_s *modp,
           rela->r_offset > dstsec->sh_size - sizeof(uint32_t))
         {
           berr("ERROR: Section %d reloc %d: "
-               "Relocation address out of range, offset %d size %d\n",
-               relidx, i, rela->r_offset, dstsec->sh_size);
+               "Relocation address out of range, "
+               "offset %" PRIuPTR " size %ju\n",
+               relidx, i, (uintptr_t)rela->r_offset,
+               (uintmax_t)dstsec->sh_size);
           ret = -EINVAL;
           break;
         }


[incubator-nuttx] 01/22: drivers/mtd/ftl.c: Fix syslog formats

Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit b48408cdeb9bfe35312e3eb9fe3bd66d93f38b05
Author: YAMAMOTO Takashi <ya...@midokura.com>
AuthorDate: Sun Nov 22 09:34:19 2020 +0900

    drivers/mtd/ftl.c: Fix syslog formats
---
 drivers/mtd/ftl.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/mtd/ftl.c b/drivers/mtd/ftl.c
index f9350d8..2019e02 100644
--- a/drivers/mtd/ftl.c
+++ b/drivers/mtd/ftl.c
@@ -208,7 +208,7 @@ static ssize_t ftl_read(FAR struct inode *inode, unsigned char *buffer,
 {
   FAR struct ftl_struct_s *dev;
 
-  finfo("sector: %d nsectors: %d\n", start_sector, nsectors);
+  finfo("sector: %zu nsectors: %d\n", start_sector, nsectors);
 
   DEBUGASSERT(inode && inode->i_private);
 
@@ -442,7 +442,7 @@ static ssize_t ftl_write(FAR struct inode *inode,
 {
   struct ftl_struct_s *dev;
 
-  finfo("sector: %d nsectors: %d\n", start_sector, nsectors);
+  finfo("sector: %zu nsectors: %d\n", start_sector, nsectors);
 
   DEBUGASSERT(inode && inode->i_private);
   dev = (struct ftl_struct_s *)inode->i_private;
@@ -479,7 +479,7 @@ static int ftl_geometry(FAR struct inode *inode,
 
       finfo("available: true mediachanged: false writeenabled: %s\n",
             geometry->geo_writeenabled ? "true" : "false");
-      finfo("nsectors: %d sectorsize: %d\n",
+      finfo("nsectors: %zu sectorsize: %zu\n",
             geometry->geo_nsectors, geometry->geo_sectorsize);
 
       return OK;


[incubator-nuttx] 17/22: libs/libc/machine/arm/armv7-m/arch_elf.c: Appease nxstyle

Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 04f2542cc22e17056a895252310b5eb89659676e
Author: YAMAMOTO Takashi <ya...@midokura.com>
AuthorDate: Sun Nov 22 10:39:41 2020 +0900

    libs/libc/machine/arm/armv7-m/arch_elf.c: Appease nxstyle
    
    The following errors are intentionally left.
    They are a part of tables which are not trivial to fix.
    
    libs/libc/machine/arm/armv7-m/arch_elf.c:230:94: error: Long line found
    libs/libc/machine/arm/armv7-m/arch_elf.c:232:89: error: Long line found
    libs/libc/machine/arm/armv7-m/arch_elf.c:240:94: error: Long line found
    libs/libc/machine/arm/armv7-m/arch_elf.c:242:89: error: Long line found
    libs/libc/machine/arm/armv7-m/arch_elf.c:403:94: error: Long line found
    libs/libc/machine/arm/armv7-m/arch_elf.c:405:91: error: Long line found
    libs/libc/machine/arm/armv7-m/arch_elf.c:413:94: error: Long line found
    libs/libc/machine/arm/armv7-m/arch_elf.c:415:91: error: Long line found
---
 libs/libc/machine/arm/armv7-m/arch_elf.c | 75 +++++++++++++++++++++-----------
 1 file changed, 50 insertions(+), 25 deletions(-)

diff --git a/libs/libc/machine/arm/armv7-m/arch_elf.c b/libs/libc/machine/arm/armv7-m/arch_elf.c
index 6715394..3b9596a 100644
--- a/libs/libc/machine/arm/armv7-m/arch_elf.c
+++ b/libs/libc/machine/arm/armv7-m/arch_elf.c
@@ -80,7 +80,8 @@ bool up_checkarch(FAR const Elf32_Ehdr *ehdr)
 
   if (ehdr->e_ident[EI_CLASS] != ELFCLASS32)
     {
-      berr("ERROR: Need 32-bit objects: e_ident[EI_CLASS]=%02x\n", ehdr->e_ident[EI_CLASS]);
+      berr("ERROR: Need 32-bit objects: e_ident[EI_CLASS]=%02x\n",
+           ehdr->e_ident[EI_CLASS]);
       return false;
     }
 
@@ -92,11 +93,13 @@ bool up_checkarch(FAR const Elf32_Ehdr *ehdr)
   if (ehdr->e_ident[EI_DATA] != ELFDATA2LSB)
 #endif
     {
-      berr("ERROR: Wrong endian-ness: e_ident[EI_DATA]=%02x\n", ehdr->e_ident[EI_DATA]);
+      berr("ERROR: Wrong endian-ness: e_ident[EI_DATA]=%02x\n",
+           ehdr->e_ident[EI_DATA]);
       return false;
     }
 
   /* TODO:  Check ABI here. */
+
   return true;
 }
 
@@ -154,8 +157,10 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym,
     case R_ARM_CALL:
     case R_ARM_JUMP24:
       {
-        binfo("Performing PC24 [%d] link at addr %08lx [%08lx] to sym '%p' st_value=%08lx\n",
-              ELF32_R_TYPE(rel->r_info), (long)addr, (long)(*(uint32_t *)addr),
+        binfo("Performing PC24 [%d] link at "
+              "addr %08lx [%08lx] to sym '%p' st_value=%08lx\n",
+              ELF32_R_TYPE(rel->r_info), (long)addr,
+              (long)(*(uint32_t *)addr),
               sym, (long)sym->st_value);
 
         offset = (*(uint32_t *)addr & 0x00ffffff) << 2;
@@ -165,9 +170,11 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym,
           }
 
         offset += sym->st_value - addr;
-        if (offset & 3 || offset < (int32_t) 0xfe000000 || offset >= (int32_t) 0x02000000)
+        if (offset & 3 || offset < (int32_t) 0xfe000000 ||
+            offset >= (int32_t) 0x02000000)
           {
-            berr("ERROR:   ERROR: PC24 [%d] relocation out of range, offset=%08lx\n",
+            berr("ERROR:   ERROR: PC24 [%d] "
+                 "relocation out of range, offset=%08lx\n",
                  ELF32_R_TYPE(rel->r_info), offset);
 
             return -EINVAL;
@@ -183,8 +190,10 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym,
     case R_ARM_ABS32:
     case R_ARM_TARGET1:  /* New ABI:  TARGET1 always treated as ABS32 */
       {
-        binfo("Performing ABS32 link at addr=%08lx [%08lx] to sym=%p st_value=%08lx\n",
-              (long)addr, (long)(*(uint32_t *)addr), sym, (long)sym->st_value);
+        binfo("Performing ABS32 link "
+              "at addr=%08lx [%08lx] to sym=%p st_value=%08lx\n",
+              (long)addr, (long)(*(uint32_t *)addr),
+              sym, (long)sym->st_value);
 
         *(uint32_t *)addr += sym->st_value;
       }
@@ -194,8 +203,10 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym,
     case R_ARM_TARGET2:  /* TARGET2 is a platform-specific relocation: gcc-arm-none-eabi
                           * performs a self relocation */
       {
-        binfo("Performing TARGET2 link at addr=%08lx [%08lx] to sym=%p st_value=%08lx\n",
-              (long)addr, (long)(*(uint32_t *)addr), sym, (long)sym->st_value);
+        binfo("Performing TARGET2 link "
+              "at addr=%08lx [%08lx] to sym=%p st_value=%08lx\n",
+              (long)addr, (long)(*(uint32_t *)addr),
+              sym, (long)sym->st_value);
 
         *(uint32_t *)addr += sym->st_value - addr;
       }
@@ -243,8 +254,10 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym,
         upper_insn = (uint32_t)(*(uint16_t *)addr);
         lower_insn = (uint32_t)(*(uint16_t *)(addr + 2));
 
-        binfo("Performing THM_JUMP24 [%d] link at addr=%08lx [%04x %04x] to sym=%p st_value=%08lx\n",
-              ELF32_R_TYPE(rel->r_info), (long)addr, (int)upper_insn, (int)lower_insn,
+        binfo("Performing THM_JUMP24 [%d] link "
+              "at addr=%08lx [%04x %04x] to sym=%p st_value=%08lx\n",
+              ELF32_R_TYPE(rel->r_info), (long)addr,
+              (int)upper_insn, (int)lower_insn,
               sym, (long)sym->st_value);
 
         /* Extract the 25-bit offset from the 32-bit instruction:
@@ -288,7 +301,8 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym,
 
         if (ELF32_ST_TYPE(sym->st_info) == STT_FUNC && (offset & 1) == 0)
           {
-            berr("ERROR:   ERROR: JUMP24 [%d] requires odd offset, offset=%08lx\n",
+            berr("ERROR:   ERROR: JUMP24 [%d] "
+                 "requires odd offset, offset=%08lx\n",
                  ELF32_R_TYPE(rel->r_info), offset);
 
             return -EINVAL;
@@ -298,7 +312,8 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym,
 
         if (offset < (int32_t)0xff000000 || offset >= (int32_t)0x01000000)
           {
-            berr("ERROR:   ERROR: JUMP24 [%d] relocation out of range, branch target=%08lx\n",
+            berr("ERROR:   ERROR: JUMP24 [%d] "
+                 "relocation out of range, branch target=%08lx\n",
                  ELF32_R_TYPE(rel->r_info), offset);
 
             return -EINVAL;
@@ -312,10 +327,12 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym,
         J1 = S ^ (~(offset >> 23) & 1);
         J2 = S ^ (~(offset >> 22) & 1);
 
-        upper_insn = ((upper_insn & 0xf800) | (S << 10) | ((offset >> 12) & 0x03ff));
+        upper_insn = ((upper_insn & 0xf800) | (S << 10) |
+                      ((offset >> 12) & 0x03ff));
         *(uint16_t *)addr = (uint16_t)upper_insn;
 
-        lower_insn = ((lower_insn & 0xd000) | (J1 << 13) | (J2 << 11) | ((offset >> 1) & 0x07ff));
+        lower_insn = ((lower_insn & 0xd000) | (J1 << 13) | (J2 << 11) |
+                      ((offset >> 1) & 0x07ff));
         *(uint16_t *)(addr + 2) = (uint16_t)lower_insn;
 
         binfo("  S=%d J1=%d J2=%d insn [%04x %04x]\n",
@@ -340,8 +357,10 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym,
 
     case R_ARM_PREL31:
       {
-        binfo("Performing PREL31 link at addr=%08lx [%08lx] to sym=%p st_value=%08lx\n",
-              (long)addr, (long)(*(uint32_t *)addr), sym, (long)sym->st_value);
+        binfo("Performing PREL31 link "
+              "at addr=%08lx [%08lx] to sym=%p st_value=%08lx\n",
+              (long)addr, (long)(*(uint32_t *)addr),
+              sym, (long)sym->st_value);
 
         offset            = *(uint32_t *)addr + sym->st_value - addr;
         *(uint32_t *)addr = offset & 0x7fffffff;
@@ -351,8 +370,10 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym,
     case R_ARM_MOVW_ABS_NC:
     case R_ARM_MOVT_ABS:
       {
-        binfo("Performing MOVx_ABS [%d] link at addr=%08lx [%08lx] to sym=%p st_value=%08lx\n",
-              ELF32_R_TYPE(rel->r_info), (long)addr, (long)(*(uint32_t *)addr),
+        binfo("Performing MOVx_ABS [%d] link "
+              "at addr=%08lx [%08lx] to sym=%p st_value=%08lx\n",
+              ELF32_R_TYPE(rel->r_info), (long)addr,
+              (long)(*(uint32_t *)addr),
               sym, (long)sym->st_value);
 
         offset = *(uint32_t *)addr;
@@ -405,8 +426,10 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym,
         upper_insn = (uint32_t)(*(uint16_t *)addr);
         lower_insn = (uint32_t)(*(uint16_t *)(addr + 2));
 
-        binfo("Performing THM_MOVx [%d] link at addr=%08lx [%04x %04x] to sym=%p st_value=%08lx\n",
-              ELF32_R_TYPE(rel->r_info), (long)addr, (int)upper_insn, (int)lower_insn,
+        binfo("Performing THM_MOVx [%d] link "
+              "at addr=%08lx [%04x %04x] to sym=%p st_value=%08lx\n",
+              ELF32_R_TYPE(rel->r_info), (long)addr,
+              (int)upper_insn, (int)lower_insn,
               sym, (long)sym->st_value);
 
         /* Extract the 16-bit offset from the 32-bit instruction */
@@ -423,8 +446,9 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym,
 
         offset += sym->st_value;
 
-        /* Update the immediate value in the instruction.  For MOVW we want the bottom
-         * 16-bits; for MOVT we want the top 16-bits.
+        /* Update the immediate value in the instruction.
+         * For MOVW we want the bottom 16-bits; for MOVT we want
+         * the top 16-bits.
          */
 
         if (ELF32_R_TYPE(rel->r_info) == R_ARM_THM_MOVT_ABS)
@@ -467,7 +491,8 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym,
 
         if (offset < (int32_t)0xfffff800 || offset >= (int32_t)0x0800)
           {
-            berr("ERROR: JUMP11 [%d] relocation out of range, branch taget=%08lx\n",
+            berr("ERROR: JUMP11 [%d] "
+                 "relocation out of range, branch taget=%08lx\n",
                  ELF32_R_TYPE(rel->r_info), offset);
 
             return -EINVAL;


[incubator-nuttx] 11/22: fs/nxffs/nxffs_reformat.c: Fix syslog formats

Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 7df9d89d54e5ff41a5086d7f591c9f9462a538cf
Author: YAMAMOTO Takashi <ya...@midokura.com>
AuthorDate: Sun Nov 22 09:57:01 2020 +0900

    fs/nxffs/nxffs_reformat.c: Fix syslog formats
---
 fs/nxffs/nxffs_reformat.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/fs/nxffs/nxffs_reformat.c b/fs/nxffs/nxffs_reformat.c
index 9f2d1a7..7b77cd7 100644
--- a/fs/nxffs/nxffs_reformat.c
+++ b/fs/nxffs/nxffs_reformat.c
@@ -41,6 +41,7 @@
 
 #include <nuttx/config.h>
 
+#include <stdint.h>
 #include <string.h>
 #include <errno.h>
 #include <debug.h>
@@ -106,7 +107,8 @@ static int nxffs_format(FAR struct nxffs_volume_s *volume)
       nxfrd = MTD_BWRITE(volume->mtd, lblock, volume->blkper, volume->pack);
       if (nxfrd != volume->blkper)
         {
-          ferr("ERROR: Write erase block %d failed: %d\n", lblock, nxfrd);
+          ferr("ERROR: Write erase block %jd failed: %zd\n",
+               (intmax_t)lblock, nxfrd);
           return -EIO;
         }
     }
@@ -157,7 +159,8 @@ static int nxffs_badblocks(FAR struct nxffs_volume_s *volume)
       nxfrd  = MTD_BREAD(volume->mtd, lblock, volume->blkper, volume->pack);
       if (nxfrd != volume->blkper)
         {
-          ferr("ERROR: Read erase block %d failed: %d\n", lblock, nxfrd);
+          ferr("ERROR: Read erase block %jd failed: %zd\n",
+               (intmax_t)lblock, nxfrd);
           return -EIO;
         }
 #endif
@@ -249,8 +252,8 @@ static int nxffs_badblocks(FAR struct nxffs_volume_s *volume)
                              volume->pack);
           if (nxfrd != volume->blkper)
             {
-              ferr("ERROR: Write erase block %d failed: %d\n",
-                   lblock, nxfrd);
+              ferr("ERROR: Write erase block %jd failed: %zd\n",
+                   (intmax_t)lblock, nxfrd);
               return -EIO;
             }
         }


[incubator-nuttx] 09/22: fs/nxffs/nxffs_read.c: Fix a syslog format

Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit d22c8a2a31bfa44471a22319ca2043cba22123ef
Author: YAMAMOTO Takashi <ya...@midokura.com>
AuthorDate: Sun Nov 22 09:53:35 2020 +0900

    fs/nxffs/nxffs_read.c: Fix a syslog format
---
 fs/nxffs/nxffs_read.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/nxffs/nxffs_read.c b/fs/nxffs/nxffs_read.c
index 1403d24..94bcc9c 100644
--- a/fs/nxffs/nxffs_read.c
+++ b/fs/nxffs/nxffs_read.c
@@ -41,6 +41,7 @@
 
 #include <nuttx/config.h>
 
+#include <stdint.h>
 #include <string.h>
 #include <fcntl.h>
 #include <crc32.h>
@@ -154,7 +155,7 @@ ssize_t nxffs_read(FAR struct file *filep, FAR char *buffer, size_t buflen)
   size_t readsize;
   int ret;
 
-  finfo("Read %d bytes from offset %d\n", buflen, filep->f_pos);
+  finfo("Read %zu bytes from offset %jd\n", buflen, (intmax_t)filep->f_pos);
 
   /* Sanity checks */
 


[incubator-nuttx] 22/22: binfmt/libelf/libelf_symbols.c: Fix syslog formats

Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit d0687137388f91f3c7d584328d3892d49ca59ff9
Author: YAMAMOTO Takashi <ya...@midokura.com>
AuthorDate: Sun Nov 22 10:58:24 2020 +0900

    binfmt/libelf/libelf_symbols.c: Fix syslog formats
---
 binfmt/libelf/libelf_symbols.c | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/binfmt/libelf/libelf_symbols.c b/binfmt/libelf/libelf_symbols.c
index 34a3c0c..bacab25 100644
--- a/binfmt/libelf/libelf_symbols.c
+++ b/binfmt/libelf/libelf_symbols.c
@@ -39,6 +39,7 @@
 
 #include <nuttx/config.h>
 
+#include <inttypes.h>
 #include <stdlib.h>
 #include <string.h>
 #include <errno.h>
@@ -323,9 +324,11 @@ int elf_symvalue(FAR struct elf_loadinfo_s *loadinfo, FAR Elf_Sym *sym,
          * entry
          */
 
-        binfo("SHN_UNDEF: name=%s %08x+%08x=%08x\n",
-              loadinfo->iobuffer, sym->st_value, symbol->sym_value,
-              sym->st_value + symbol->sym_value);
+        binfo("SHN_UNDEF: name=%s "
+              "%08" PRIxPTR "+%08" PRIxPTR "=%08" PRIxPTR "\n",
+              loadinfo->iobuffer, (uintptr_t)sym->st_value,
+              (uintptr_t)symbol->sym_value,
+              (uintptr_t)(sym->st_value + symbol->sym_value));
 
         sym->st_value += ((uintptr_t)symbol->sym_value);
       }
@@ -335,8 +338,9 @@ int elf_symvalue(FAR struct elf_loadinfo_s *loadinfo, FAR Elf_Sym *sym,
       {
         secbase = loadinfo->shdr[sym->st_shndx].sh_addr;
 
-        binfo("Other: %08x+%08x=%08x\n",
-              sym->st_value, secbase, sym->st_value + secbase);
+        binfo("Other: %08" PRIxPTR "+%08" PRIxPTR "=%08" PRIxPTR "\n",
+              (uintptr_t)sym->st_value, secbase,
+              (uintptr_t)(sym->st_value + secbase));
 
         sym->st_value += secbase;
       }


[incubator-nuttx] 18/22: libs/libc/machine/arm/armv7-m/arch_elf.c: Fix syslog formats

Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 42a218dabb671072f1c102032a41071360fef08f
Author: YAMAMOTO Takashi <ya...@midokura.com>
AuthorDate: Sun Nov 22 10:50:59 2020 +0900

    libs/libc/machine/arm/armv7-m/arch_elf.c: Fix syslog formats
---
 libs/libc/machine/arm/armv7-m/arch_elf.c | 33 ++++++++++++++++++--------------
 1 file changed, 19 insertions(+), 14 deletions(-)

diff --git a/libs/libc/machine/arm/armv7-m/arch_elf.c b/libs/libc/machine/arm/armv7-m/arch_elf.c
index 3b9596a..e96af64 100644
--- a/libs/libc/machine/arm/armv7-m/arch_elf.c
+++ b/libs/libc/machine/arm/armv7-m/arch_elf.c
@@ -39,6 +39,7 @@
 
 #include <nuttx/config.h>
 
+#include <inttypes.h>
 #include <stdlib.h>
 #include <errno.h>
 #include <debug.h>
@@ -157,7 +158,7 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym,
     case R_ARM_CALL:
     case R_ARM_JUMP24:
       {
-        binfo("Performing PC24 [%d] link at "
+        binfo("Performing PC24 [%" PRId32 "] link at "
               "addr %08lx [%08lx] to sym '%p' st_value=%08lx\n",
               ELF32_R_TYPE(rel->r_info), (long)addr,
               (long)(*(uint32_t *)addr),
@@ -173,7 +174,7 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym,
         if (offset & 3 || offset < (int32_t) 0xfe000000 ||
             offset >= (int32_t) 0x02000000)
           {
-            berr("ERROR:   ERROR: PC24 [%d] "
+            berr("ERROR:   ERROR: PC24 [%" PRId32 "] "
                  "relocation out of range, offset=%08lx\n",
                  ELF32_R_TYPE(rel->r_info), offset);
 
@@ -254,7 +255,7 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym,
         upper_insn = (uint32_t)(*(uint16_t *)addr);
         lower_insn = (uint32_t)(*(uint16_t *)(addr + 2));
 
-        binfo("Performing THM_JUMP24 [%d] link "
+        binfo("Performing THM_JUMP24 [%" PRId32 "] link "
               "at addr=%08lx [%04x %04x] to sym=%p st_value=%08lx\n",
               ELF32_R_TYPE(rel->r_info), (long)addr,
               (int)upper_insn, (int)lower_insn,
@@ -290,8 +291,9 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym,
 
         /* And perform the relocation */
 
-        binfo("  S=%d J1=%d J2=%d offset=%08lx branch target=%08lx\n",
-              S, J1, J2, (long)offset, offset + sym->st_value - addr);
+        binfo("  S=%" PRId32 " J1=%" PRId32 " J2=%" PRId32
+              " offset=%08" PRIx32 " branch target=%08lx\n",
+              S, J1, J2, offset, offset + sym->st_value - addr);
 
         offset += sym->st_value - addr;
 
@@ -301,7 +303,7 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym,
 
         if (ELF32_ST_TYPE(sym->st_info) == STT_FUNC && (offset & 1) == 0)
           {
-            berr("ERROR:   ERROR: JUMP24 [%d] "
+            berr("ERROR:   ERROR: JUMP24 [%" PRId32 "] "
                  "requires odd offset, offset=%08lx\n",
                  ELF32_R_TYPE(rel->r_info), offset);
 
@@ -312,7 +314,7 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym,
 
         if (offset < (int32_t)0xff000000 || offset >= (int32_t)0x01000000)
           {
-            berr("ERROR:   ERROR: JUMP24 [%d] "
+            berr("ERROR:   ERROR: JUMP24 [%" PRId32 "] "
                  "relocation out of range, branch target=%08lx\n",
                  ELF32_R_TYPE(rel->r_info), offset);
 
@@ -335,8 +337,9 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym,
                       ((offset >> 1) & 0x07ff));
         *(uint16_t *)(addr + 2) = (uint16_t)lower_insn;
 
-        binfo("  S=%d J1=%d J2=%d insn [%04x %04x]\n",
-              S, J1, J2, (int)upper_insn, (int)lower_insn);
+        binfo("  S=%" PRId32 " J1=%" PRId32 " J2=%" PRId32
+              " insn [%04" PRIx32 " %04" PRIx32 "]\n",
+              S, J1, J2, upper_insn, lower_insn);
       }
       break;
 
@@ -370,7 +373,7 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym,
     case R_ARM_MOVW_ABS_NC:
     case R_ARM_MOVT_ABS:
       {
-        binfo("Performing MOVx_ABS [%d] link "
+        binfo("Performing MOVx_ABS [%" PRId32 "] link "
               "at addr=%08lx [%08lx] to sym=%p st_value=%08lx\n",
               ELF32_R_TYPE(rel->r_info), (long)addr,
               (long)(*(uint32_t *)addr),
@@ -426,7 +429,7 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym,
         upper_insn = (uint32_t)(*(uint16_t *)addr);
         lower_insn = (uint32_t)(*(uint16_t *)(addr + 2));
 
-        binfo("Performing THM_MOVx [%d] link "
+        binfo("Performing THM_MOVx [%" PRId32 "] link "
               "at addr=%08lx [%04x %04x] to sym=%p st_value=%08lx\n",
               ELF32_R_TYPE(rel->r_info), (long)addr,
               (int)upper_insn, (int)lower_insn,
@@ -481,7 +484,8 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym,
 
         if (ELF32_ST_TYPE(sym->st_info) == STT_FUNC && (offset & 1) == 0)
           {
-            berr("ERROR: JUMP11 [%d] requires odd offset, offset=%08lx\n",
+            berr("ERROR: JUMP11 [%" PRId32 "] "
+                 "requires odd offset, offset=%08lx\n",
                  ELF32_R_TYPE(rel->r_info), offset);
 
             return -EINVAL;
@@ -491,7 +495,7 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym,
 
         if (offset < (int32_t)0xfffff800 || offset >= (int32_t)0x0800)
           {
-            berr("ERROR: JUMP11 [%d] "
+            berr("ERROR: JUMP11 [%" PRId32 "] "
                  "relocation out of range, branch taget=%08lx\n",
                  ELF32_R_TYPE(rel->r_info), offset);
 
@@ -506,7 +510,8 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym,
       break;
 
     default:
-      berr("ERROR: Unsupported relocation: %d\n", ELF32_R_TYPE(rel->r_info));
+      berr("ERROR: Unsupported relocation: %" PRId32 "\n",
+           ELF32_R_TYPE(rel->r_info));
       return -EINVAL;
     }
 


[incubator-nuttx] 03/22: fs/nxffs/nxffs_cache.c: Fix syslog formats

Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 35c30c2c4a45829bc035625c8b18d8494340c956
Author: YAMAMOTO Takashi <ya...@midokura.com>
AuthorDate: Sun Nov 22 09:41:25 2020 +0900

    fs/nxffs/nxffs_cache.c: Fix syslog formats
---
 fs/nxffs/nxffs_cache.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/fs/nxffs/nxffs_cache.c b/fs/nxffs/nxffs_cache.c
index 2995b9d..9581d66 100644
--- a/fs/nxffs/nxffs_cache.c
+++ b/fs/nxffs/nxffs_cache.c
@@ -44,6 +44,8 @@
 #include <assert.h>
 #include <errno.h>
 #include <debug.h>
+#include <inttypes.h>
+#include <stdint.h>
 
 #include <nuttx/mtd/mtd.h>
 
@@ -82,7 +84,8 @@ int nxffs_rdcache(FAR struct nxffs_volume_s *volume, off_t block)
       nxfrd = MTD_BREAD(volume->mtd, block, 1, volume->cache);
       if (nxfrd != 1)
         {
-          ferr("ERROR: Read block %d failed: %d\n", block, nxfrd);
+          ferr("ERROR: Read block %jd failed: %zu\n",
+               (intmax_t)block, nxfrd);
           return -EIO;
         }
 
@@ -117,7 +120,8 @@ int nxffs_wrcache(FAR struct nxffs_volume_s *volume)
   nxfrd = MTD_BWRITE(volume->mtd, volume->cblock, 1, volume->cache);
   if (nxfrd != 1)
     {
-      ferr("ERROR: Write block %d failed: %d\n", volume->cblock, nxfrd);
+      ferr("ERROR: Write block %jd failed: %zu\n",
+           (intmax_t)volume->cblock, nxfrd);
       return -EIO;
     }
 


[incubator-nuttx] 05/22: fs/nxffs/nxffs_open.c: Fix a syslog format

Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 99407f4ab91588700fafbcbaf124aaf7d6deb71e
Author: YAMAMOTO Takashi <ya...@midokura.com>
AuthorDate: Sun Nov 22 09:44:18 2020 +0900

    fs/nxffs/nxffs_open.c: Fix a syslog format
---
 fs/nxffs/nxffs_open.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/nxffs/nxffs_open.c b/fs/nxffs/nxffs_open.c
index 80b1e1e..b060ebc 100644
--- a/fs/nxffs/nxffs_open.c
+++ b/fs/nxffs/nxffs_open.c
@@ -469,7 +469,7 @@ static inline int nxffs_wropen(FAR struct nxffs_volume_s *volume,
       else
         {
           ferr("ERROR: File %s exists and we were not asked to "
-               "truncate it\n");
+               "truncate it\n", name);
           ret = -ENOSYS;
           goto errout_with_exclsem;
         }


[incubator-nuttx] 10/22: fs/nxffs/nxffs_reformat.c: Appease nxstyle

Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit d28d5a29c28246652201e63c45ecf531b2ce8b46
Author: YAMAMOTO Takashi <ya...@midokura.com>
AuthorDate: Sun Nov 22 09:54:57 2020 +0900

    fs/nxffs/nxffs_reformat.c: Appease nxstyle
---
 fs/nxffs/nxffs_reformat.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/fs/nxffs/nxffs_reformat.c b/fs/nxffs/nxffs_reformat.c
index 338efa9..9f2d1a7 100644
--- a/fs/nxffs/nxffs_reformat.c
+++ b/fs/nxffs/nxffs_reformat.c
@@ -178,7 +178,8 @@ static int nxffs_badblocks(FAR struct nxffs_volume_s *volume)
            i++, block++, blkptr += volume->geo.blocksize)
 #endif
         {
-          FAR struct nxffs_block_s *blkhdr = (FAR struct nxffs_block_s *)blkptr;
+          FAR struct nxffs_block_s *blkhdr =
+            (FAR struct nxffs_block_s *)blkptr;
 
           /* Assume that this is a good block until we learn otherwise */
 
@@ -207,8 +208,8 @@ static int nxffs_badblocks(FAR struct nxffs_volume_s *volume)
           if (memcmp(blkhdr->magic, g_blockmagic, NXFFS_MAGICSIZE) != 0 ||
               blkhdr->state != BLOCK_STATE_GOOD)
             {
-              /* The block is not formatted with the NXFFS magic bytes or else
-               * the block is specifically marked bad.
+              /* The block is not formatted with the NXFFS magic bytes or
+               * else the block is specifically marked bad.
                */
 
               good = false;
@@ -220,9 +221,11 @@ static int nxffs_badblocks(FAR struct nxffs_volume_s *volume)
 
           else
             {
-              size_t blocksize = volume->geo.blocksize - SIZEOF_NXFFS_BLOCK_HDR;
-              size_t erasesize = nxffs_erased(&blkptr[SIZEOF_NXFFS_BLOCK_HDR],
-                                              blocksize);
+              size_t blocksize = volume->geo.blocksize -
+                                 SIZEOF_NXFFS_BLOCK_HDR;
+              size_t erasesize = nxffs_erased(
+                                     &blkptr[SIZEOF_NXFFS_BLOCK_HDR],
+                                     blocksize);
               good = (blocksize == erasesize);
             }
 


[incubator-nuttx] 13/22: fs/nxffs/nxffs_write.c: Fix a syslog format

Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit ae45a66d709215e20367ece0e39412d63e2d924b
Author: YAMAMOTO Takashi <ya...@midokura.com>
AuthorDate: Sun Nov 22 09:59:38 2020 +0900

    fs/nxffs/nxffs_write.c: Fix a syslog format
---
 fs/nxffs/nxffs_write.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/nxffs/nxffs_write.c b/fs/nxffs/nxffs_write.c
index 31b72f1..d59e787 100644
--- a/fs/nxffs/nxffs_write.c
+++ b/fs/nxffs/nxffs_write.c
@@ -41,6 +41,7 @@
 
 #include <nuttx/config.h>
 
+#include <stdint.h>
 #include <string.h>
 #include <fcntl.h>
 #include <crc32.h>
@@ -531,7 +532,7 @@ ssize_t nxffs_write(FAR struct file *filep, FAR const char *buffer,
   ssize_t total;
   int ret;
 
-  finfo("Write %d bytes to offset %d\n", buflen, filep->f_pos);
+  finfo("Write %zd bytes to offset %jd\n", buflen, (intmax_t)filep->f_pos);
 
   /* Sanity checks */
 


[incubator-nuttx] 20/22: fs/romfs/fs_romfsutil.c: Fix syslog formats

Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 13e55ce0d4ca67d95f7ec4c2104e951a58b972d1
Author: YAMAMOTO Takashi <ya...@midokura.com>
AuthorDate: Sun Nov 22 10:53:11 2020 +0900

    fs/romfs/fs_romfsutil.c: Fix syslog formats
---
 fs/romfs/fs_romfsutil.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/fs/romfs/fs_romfsutil.c b/fs/romfs/fs_romfsutil.c
index 608b417..dc15cc5 100644
--- a/fs/romfs/fs_romfsutil.c
+++ b/fs/romfs/fs_romfsutil.c
@@ -27,6 +27,7 @@
 #include <nuttx/config.h>
 #include <sys/types.h>
 
+#include <inttypes.h>
 #include <stdint.h>
 #include <stdbool.h>
 #include <stdlib.h>
@@ -416,7 +417,8 @@ int romfs_filecacheread(struct romfs_mountpt_s *rm, struct romfs_file_s *rf,
 {
   int ret;
 
-  finfo("sector: %d cached: %d sectorsize: %d XIP base: %p buffer: %p\n",
+  finfo("sector: %" PRId32 " cached: %" PRId32
+        " sectorsize: %d XIP base: %p buffer: %p\n",
         sector, rf->rf_cachesector, rm->rm_hwsectorsize,
         rm->rm_xipbase, rf->rf_buffer);
 


[incubator-nuttx] 02/22: fs/nxffs/nxffs_cache.c: Appease nxstyle

Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 042881eed33e21f1345d7eec355de79150fea174
Author: YAMAMOTO Takashi <ya...@midokura.com>
AuthorDate: Sun Nov 22 09:38:55 2020 +0900

    fs/nxffs/nxffs_cache.c: Appease nxstyle
---
 fs/nxffs/nxffs_cache.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/fs/nxffs/nxffs_cache.c b/fs/nxffs/nxffs_cache.c
index 63bf071..2995b9d 100644
--- a/fs/nxffs/nxffs_cache.c
+++ b/fs/nxffs/nxffs_cache.c
@@ -179,8 +179,9 @@ off_t nxffs_iotell(FAR struct nxffs_volume_s *volume)
  *   over bad blocks and block headers as necessary.
  *
  * Input Parameters:
- *   volume - Describes the NXFFS volume.  The parameters ioblock and iooffset
- *     in the volume structure determine the behavior of nxffs_getc().
+ *   volume - Describes the NXFFS volume.  The parameters ioblock and
+ *     iooffset in the volume structure determine the behavior of
+ *     nxffs_getc().
  *   reserve - If less than this much space is available at the end of the
  *     block, then skip to the next block.
  *
@@ -200,7 +201,9 @@ int nxffs_getc(FAR struct nxffs_volume_s *volume, uint16_t reserve)
 
   do
     {
-      /* Check if we have the reserve amount at the end of the current block */
+      /* Check if we have the reserve amount at the end of the current
+       * block
+       */
 
       if (volume->iooffset + reserve > volume->geo.blocksize)
         {


[incubator-nuttx] 08/22: fs/nxffs/nxffs_read.c: Appease nxstyle

Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 3f2390e7814e3fb9d2e35c554702890374622aa1
Author: YAMAMOTO Takashi <ya...@midokura.com>
AuthorDate: Sun Nov 22 09:52:26 2020 +0900

    fs/nxffs/nxffs_read.c: Appease nxstyle
---
 fs/nxffs/nxffs_read.c | 24 ++++++++++++++++--------
 1 file changed, 16 insertions(+), 8 deletions(-)

diff --git a/fs/nxffs/nxffs_read.c b/fs/nxffs/nxffs_read.c
index f7333c2..1403d24 100644
--- a/fs/nxffs/nxffs_read.c
+++ b/fs/nxffs/nxffs_read.c
@@ -101,7 +101,9 @@ static ssize_t nxffs_rdseek(FAR struct nxffs_volume_s *volume,
   datend = 0;
   do
     {
-      /* Check if the next data block contains the sought after file position */
+      /* Check if the next data block contains the sought after file
+       * position
+       */
 
       ret = nxffs_nextblock(volume, offset, blkentry);
       if (ret < 0)
@@ -124,7 +126,8 @@ static ssize_t nxffs_rdseek(FAR struct nxffs_volume_s *volume,
   /* Return the offset to the data within the current data block */
 
   blkentry->foffset = fpos - datstart;
-  nxffs_ioseek(volume, blkentry->hoffset + SIZEOF_NXFFS_DATA_HDR + blkentry->foffset);
+  nxffs_ioseek(volume, blkentry->hoffset + SIZEOF_NXFFS_DATA_HDR +
+               blkentry->foffset);
   return OK;
 }
 
@@ -322,7 +325,8 @@ int nxffs_nextblock(FAR struct nxffs_volume_s *volume, off_t offset,
           if (ch != g_datamagic[nmagic])
             {
               /* Ooops... this is the not the right character for the magic
-               * Sequence.  Check if we need to restart or to cancel the sequence:
+               * Sequence.  Check if we need to restart or to cancel the
+               * sequence:
                */
 
               if (ch == g_datamagic[0])
@@ -355,7 +359,8 @@ int nxffs_nextblock(FAR struct nxffs_volume_s *volume, off_t offset,
 
               /* Read the block header and verify the block at that address */
 
-              ret = nxffs_rdblkhdr(volume, blkentry->hoffset, &blkentry->datlen);
+              ret = nxffs_rdblkhdr(volume, blkentry->hoffset,
+                                   &blkentry->datlen);
               if (ret == OK)
                 {
                   finfo("Found a valid data block, offset: %d datlen: %d\n",
@@ -386,8 +391,8 @@ int nxffs_nextblock(FAR struct nxffs_volume_s *volume, off_t offset,
  *
  * Input Parameters:
  *   volume - Describes the current volume.
- *   offset - The byte offset from the beginning of FLASH where the data block
- *     header is expected.
+ *   offset - The byte offset from the beginning of FLASH where the data
+ *     block header is expected.
  *   datlen  - A memory location to return the data block length.
  *
  * Returned Value:
@@ -406,7 +411,9 @@ int nxffs_rdblkhdr(FAR struct nxffs_volume_s *volume, off_t offset,
   uint16_t dlen;
   int ret;
 
-  /* Make sure that the block containing the data block header is in the cache */
+  /* Make sure that the block containing the data block header is in the
+   * cache
+   */
 
   nxffs_ioseek(volume, offset);
   ret = nxffs_rdcache(volume, volume->ioblock);
@@ -433,7 +440,8 @@ int nxffs_rdblkhdr(FAR struct nxffs_volume_s *volume, off_t offset,
 
   if ((uint32_t)doffset + (uint32_t)dlen > (uint32_t)volume->geo.blocksize)
     {
-      ferr("ERROR: Data length=%d is unreasonable at offset=%d\n", dlen, doffset);
+      ferr("ERROR: Data length=%d is unreasonable at offset=%d\n", dlen,
+           doffset);
       return -EIO;
     }
 


[incubator-nuttx] 12/22: fs/nxffs/nxffs_stat.c: Fix syslog formats

Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit d543f7f16fbb99cd949145617e2c05c9c88f58ba
Author: YAMAMOTO Takashi <ya...@midokura.com>
AuthorDate: Sun Nov 22 09:58:50 2020 +0900

    fs/nxffs/nxffs_stat.c: Fix syslog formats
---
 fs/nxffs/nxffs_stat.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/nxffs/nxffs_stat.c b/fs/nxffs/nxffs_stat.c
index 9ac3bea1..96c9fd7 100644
--- a/fs/nxffs/nxffs_stat.c
+++ b/fs/nxffs/nxffs_stat.c
@@ -148,7 +148,7 @@ int nxffs_stat(FAR struct inode *mountpt, FAR const char *relpath,
       ret = nxffs_findinode(volume, relpath, &entry);
       if (ret < 0)
         {
-          ferr("ERROR: Inode '%s' not found: %d\n", -ret);
+          ferr("ERROR: Inode '%s' not found: %d\n", relpath, -ret);
           goto errout_with_semaphore;
         }
 
@@ -198,7 +198,7 @@ int nxffs_fstat(FAR const struct file *filep, FAR struct stat *buf)
   FAR struct nxffs_ofile_s *ofile;
   int ret;
 
-  finfo("Buf %s\n", buf);
+  finfo("Buf %p\n", buf);
   DEBUGASSERT(filep != NULL && buf != NULL);
 
   /* Recover the open file state from the struct file instance */


[incubator-nuttx] 14/22: sched/module/mod_modhandle.c: Fix a syslog format

Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit d2d48a1b9ba644e01b4c49c04a8cefb6a0602245
Author: YAMAMOTO Takashi <ya...@midokura.com>
AuthorDate: Sun Nov 22 10:01:56 2020 +0900

    sched/module/mod_modhandle.c: Fix a syslog format
---
 sched/module/mod_modhandle.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sched/module/mod_modhandle.c b/sched/module/mod_modhandle.c
index a612d38..81a83f3 100644
--- a/sched/module/mod_modhandle.c
+++ b/sched/module/mod_modhandle.c
@@ -85,7 +85,7 @@ FAR void *modhandle(FAR const char *name)
   modp = modlib_registry_find(name);
   if (modp == NULL)
     {
-      berr("ERROR: Failed to find module %s: %d\n", name, modp);
+      berr("ERROR: Failed to find module %s\n", name);
       set_errno(ENOENT);
     }
 


[incubator-nuttx] 21/22: binfmt/libelf/libelf_bind.c: Fix syslog formats

Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 148ee150f0a4dafc2935dc8e39083a3c996992da
Author: YAMAMOTO Takashi <ya...@midokura.com>
AuthorDate: Sun Nov 22 10:56:05 2020 +0900

    binfmt/libelf/libelf_bind.c: Fix syslog formats
---
 binfmt/libelf/libelf_bind.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/binfmt/libelf/libelf_bind.c b/binfmt/libelf/libelf_bind.c
index 4daac9a..ef42a4f 100644
--- a/binfmt/libelf/libelf_bind.c
+++ b/binfmt/libelf/libelf_bind.c
@@ -39,6 +39,7 @@
 
 #include <nuttx/config.h>
 
+#include <inttypes.h>
 #include <stdint.h>
 #include <string.h>
 #include <errno.h>
@@ -338,8 +339,9 @@ static int elf_relocate(FAR struct elf_loadinfo_s *loadinfo, int relidx,
           rel->r_offset > dstsec->sh_size - sizeof(uint32_t))
         {
           berr("Section %d reloc %d: Relocation address out of range, "
-               "offset %d size %d\n",
-               relidx, i, rel->r_offset, dstsec->sh_size);
+               "offset %" PRIdPTR " size %jd\n",
+               relidx, i, (uintptr_t)rel->r_offset,
+               (uintmax_t)dstsec->sh_size);
           ret = -EINVAL;
           break;
         }
@@ -522,8 +524,9 @@ static int elf_relocateadd(FAR struct elf_loadinfo_s *loadinfo, int relidx,
           rela->r_offset > dstsec->sh_size)
         {
           berr("Section %d reloc %d: Relocation address out of range, "
-               "offset %d size %d\n",
-               relidx, i, rela->r_offset, dstsec->sh_size);
+               "offset %" PRIdPTR " size %jd\n",
+               relidx, i, (uintptr_t)rela->r_offset,
+               (uintmax_t)dstsec->sh_size);
           ret = -EINVAL;
           break;
         }