wangtao13 opened a new issue, #19424:
URL: https://github.com/apache/nuttx/issues/19424

   ### Description
   
   I am testing NAND MTD partition in MIPS32 system, and after I created 4 
partitions, I ran `cat /proc/partitions`, and got followings,
   
   ```
   Name             Start    Size   MTD
   (noname)       34359738368 9230062565109792768
   (noname)       274877906944 9230062565109792768
   (noname)       274877906944 9230062565109792768
   (noname)       274877906944 9230062565109792768
   ```
   
   This is wrong, my partition table should be
   ```
   Name             Start    Size   MTD
   (noname)             0       8   tstnand
   (noname)             8      64   tstnand
   (noname)            72      64   tstnand
   (noname)           136      64   tstnand
   ```
   The info is from following codes of `part_procfs_read()`,
   ```
   #ifdef CONFIG_MTD_PARTITION_NAMES
             ptr = attr->nextpart->name;
             for (x = 0; x < sizeof(partname) - 1; x++)
               {
                 /* Test for end of partition name */
   
                 if (*ptr == ',' || *ptr == '\0')
                   {
                     /* Perform space fill for alignment */
   
                     partname[x] = ' ';
                   }
                 else
                   {
                     /* Copy next byte of partition name */
   
                     partname[x] = *ptr++;
                   }
               }
   
             partname[x] = '\0';
   
             /* Terminate the partition name and add to output buffer */
   
             ret = snprintf(&buffer[total], buflen - total,
                            "%s%7ju %7ju   %s\n",
                            partname,
                            (uintmax_t)attr->nextpart->firstblock / blkpererase,
                            (uintmax_t)attr->nextpart->geo.neraseblocks,
                            attr->nextpart->parent->name);
   #else
             ret = snprintf(&buffer[total], buflen - total, "%7ju %7ju   %s\n",
                            (uintmax_t)attr->nextpart->firstblock / blkpererase,
                            (uintmax_t)attr->nextpart->geo.neraseblocks,
                            attr->nextpart->parent->name);
   #endif
   ```
   What is the right format should be used to print partition info across 32 
and 64bit platform?
   
   ### Verification
   
   - [x] I have verified before submitting the report.


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to