Fix the printf warning after off_t change
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com> Change-Id: Id46daa2ee690a73d3187b479f0e7ab0e2e361764
This commit is contained in:
parent
319474b1b1
commit
6a396eb224
15 changed files with 119 additions and 105 deletions
|
@ -82,7 +82,8 @@ static int cxd56_erase(FAR struct mtd_dev_s *dev, off_t startblock,
|
|||
int ret;
|
||||
size_t i;
|
||||
|
||||
finfo("erase: %08lx (%u blocks)\n", startblock << PAGE_SHIFT, nblocks);
|
||||
finfo("erase: %" PRIxOFF " (%u blocks)\n",
|
||||
startblock << PAGE_SHIFT, nblocks);
|
||||
|
||||
for (i = 0; i < nblocks; i++)
|
||||
{
|
||||
|
@ -101,7 +102,8 @@ static ssize_t cxd56_bread(FAR struct mtd_dev_s *dev, off_t startblock,
|
|||
{
|
||||
int ret;
|
||||
|
||||
finfo("bread: %08lx (%u blocks)\n", startblock << PAGE_SHIFT, nblocks);
|
||||
finfo("bread: %" PRIxOFF " (%u blocks)\n",
|
||||
startblock << PAGE_SHIFT, nblocks);
|
||||
|
||||
ret = fw_fm_rawread(startblock << PAGE_SHIFT, buffer,
|
||||
nblocks << PAGE_SHIFT);
|
||||
|
@ -118,7 +120,8 @@ static ssize_t cxd56_bwrite(FAR struct mtd_dev_s *dev, off_t startblock,
|
|||
{
|
||||
int ret;
|
||||
|
||||
finfo("bwrite: %08lx (%u blocks)\n", startblock << PAGE_SHIFT, nblocks);
|
||||
finfo("bwrite: %" PRIxOFF " (%u blocks)\n",
|
||||
startblock << PAGE_SHIFT, nblocks);
|
||||
|
||||
#ifdef CONFIG_CXD56_SFC_VERIFY_WRITE
|
||||
ret = fw_fm_rawverifywrite(startblock << PAGE_SHIFT, buffer,
|
||||
|
@ -140,7 +143,7 @@ static ssize_t cxd56_read(FAR struct mtd_dev_s *dev, off_t offset,
|
|||
{
|
||||
int ret;
|
||||
|
||||
finfo("read: %08lx (%u bytes)\n", offset, nbytes);
|
||||
finfo("read: %" PRIxOFF " (%u bytes)\n", offset, nbytes);
|
||||
|
||||
ret = fw_fm_rawread(offset, buffer, nbytes);
|
||||
if (ret < 0)
|
||||
|
@ -157,7 +160,7 @@ static ssize_t cxd56_write(FAR struct mtd_dev_s *dev, off_t offset,
|
|||
{
|
||||
int ret;
|
||||
|
||||
finfo("write: %08lx (%u bytes)\n", offset, nbytes);
|
||||
finfo("write: %" PRIxOFF " (%u bytes)\n", offset, nbytes);
|
||||
|
||||
#ifdef CONFIG_CXD56_SFC_VERIFY_WRITE
|
||||
ret = fw_fm_rawverifywrite(offset, buffer, nbytes);
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
|
||||
#include <sys/types.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <inttypes.h>
|
||||
#include <stdio.h>
|
||||
#include <assert.h>
|
||||
#include <debug.h>
|
||||
|
@ -128,7 +129,7 @@ static ssize_t mmcl_read(FAR struct inode *inode, unsigned char *buffer,
|
|||
ssize_t nread;
|
||||
struct mmcl_dev_s *dev;
|
||||
|
||||
finfo("sector: %" PRIu32 " nsectors: %u\n", start_sector, nsectors);
|
||||
finfo("sector: %" PRIuOFF " nsectors: %u\n", start_sector, nsectors);
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
dev = (struct mmcl_dev_s *)inode->i_private;
|
||||
|
@ -136,7 +137,7 @@ static ssize_t mmcl_read(FAR struct inode *inode, unsigned char *buffer,
|
|||
nread = MTD_BREAD(dev->mtd, start_sector, nsectors, buffer);
|
||||
if (nread != nsectors)
|
||||
{
|
||||
finfo("Read %u blocks starting at block %" PRIu32 " failed: %d\n",
|
||||
finfo("Read %u blocks starting at block %" PRIuOFF " failed: %d\n",
|
||||
nsectors, start_sector, nread);
|
||||
return -EIO;
|
||||
}
|
||||
|
@ -158,7 +159,7 @@ static ssize_t mmcl_write(FAR struct inode *inode,
|
|||
ssize_t nwrite;
|
||||
struct mmcl_dev_s *dev;
|
||||
|
||||
finfo("sector: %" PRIu32 " nsectors: %u\n", start_sector, nsectors);
|
||||
finfo("sector: %" PRIuOFF " nsectors: %u\n", start_sector, nsectors);
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
dev = (struct mmcl_dev_s *)inode->i_private;
|
||||
|
@ -166,7 +167,7 @@ static ssize_t mmcl_write(FAR struct inode *inode,
|
|||
nwrite = MTD_BWRITE(dev->mtd, start_sector, nsectors, buffer);
|
||||
if (nwrite != nsectors)
|
||||
{
|
||||
finfo("Write %u blocks starting at block %" PRIu32 " failed: %d\n",
|
||||
finfo("Write %u blocks starting at block %" PRIuOFF " failed: %d\n",
|
||||
nsectors, start_sector, nwrite);
|
||||
return -EIO;
|
||||
}
|
||||
|
@ -200,7 +201,7 @@ static int mmcl_geometry(FAR struct inode *inode, struct geometry *geometry)
|
|||
finfo("available: true mediachanged: false writeenabled: %s\n",
|
||||
geometry->geo_writeenabled ? "true" : "false");
|
||||
|
||||
finfo("nsectors: %" PRIu32 " sectorsize: %" PRIi16 "\n",
|
||||
finfo("nsectors: %" PRIuOFF " sectorsize: %" PRIi16 "\n",
|
||||
geometry->geo_nsectors, geometry->geo_sectorsize);
|
||||
|
||||
return OK;
|
||||
|
|
|
@ -679,8 +679,9 @@ int lc823450_mtd_initialize(uint32_t devno)
|
|||
partinfo[i].nblocks);
|
||||
if (!g_mtdpart[i])
|
||||
{
|
||||
finfo("%s(): mtd_partition failed. startblock=%lu nblocks=%lu\n",
|
||||
__func__, partinfo[i].startblock, partinfo[i].nblocks);
|
||||
finfo("%s(): mtd_partition failed. startblock=%"
|
||||
PRIuOFF " nblocks=%" PRIuOFF "\n", __func__,
|
||||
partinfo[i].startblock, partinfo[i].nblocks);
|
||||
mtd_semgive(&g_sem);
|
||||
DEBUGASSERT(0);
|
||||
return -EIO;
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
|
||||
#include <sys/types.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <inttypes.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <assert.h>
|
||||
|
@ -299,7 +300,7 @@ static int eeed_geometry(FAR struct inode *inode, struct geometry *geometry)
|
|||
|
||||
finfo("available: true mediachanged: false writeenabled: %s\n",
|
||||
geometry->geo_writeenabled ? "true" : "false");
|
||||
finfo("nsectors: %" PRIu32 " sectorsize: %" PRIu16 "\n",
|
||||
finfo("nsectors: %" PRIuOFF " sectorsize: %" PRIu16 "\n",
|
||||
geometry->geo_nsectors, geometry->geo_sectorsize);
|
||||
|
||||
return OK;
|
||||
|
|
|
@ -2234,7 +2234,7 @@ static ssize_t mmcsd_read(FAR struct inode *inode, unsigned char *buffer,
|
|||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
priv = (FAR struct mmcsd_state_s *)inode->i_private;
|
||||
finfo("startsector: %" PRIu32 " nsectors: %u sectorsize: %d\n",
|
||||
finfo("startsector: %" PRIuOFF " nsectors: %u sectorsize: %d\n",
|
||||
startsector, nsectors, priv->blocksize);
|
||||
|
||||
if (nsectors > 0)
|
||||
|
|
|
@ -1167,7 +1167,7 @@ static ssize_t mmcsd_read(FAR struct inode *inode, unsigned char *buffer,
|
|||
int i;
|
||||
int ret;
|
||||
|
||||
finfo("start_sector=%" PRIu32 " nsectors=%u\n", start_sector, nsectors);
|
||||
finfo("start_sector=%" PRIuOFF " nsectors=%u\n", start_sector, nsectors);
|
||||
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
if (!buffer)
|
||||
|
@ -1219,12 +1219,12 @@ static ssize_t mmcsd_read(FAR struct inode *inode, unsigned char *buffer,
|
|||
if (IS_BLOCK(slot->type))
|
||||
{
|
||||
offset = start_sector;
|
||||
finfo("nbytes=%zu sector offset=%jd\n", nbytes, (intmax_t)offset);
|
||||
finfo("nbytes=%zu sector offset=%" PRIdOFF "\n", nbytes, offset);
|
||||
}
|
||||
else
|
||||
{
|
||||
offset = start_sector * SECTORSIZE(slot);
|
||||
finfo("nbytes=%zu byte offset=%jd\n", nbytes, (intmax_t)offset);
|
||||
finfo("nbytes=%zu byte offset=%" PRIdOFF "\n", nbytes, offset);
|
||||
}
|
||||
|
||||
/* Select the slave */
|
||||
|
@ -1328,7 +1328,7 @@ static ssize_t mmcsd_write(FAR struct inode *inode,
|
|||
int i;
|
||||
int ret;
|
||||
|
||||
finfo("start_sector=%" PRIu32 " nsectors=%u\n", start_sector, nsectors);
|
||||
finfo("start_sector=%" PRIuOFF " nsectors=%u\n", start_sector, nsectors);
|
||||
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
if (!buffer)
|
||||
|
@ -1388,12 +1388,12 @@ static ssize_t mmcsd_write(FAR struct inode *inode,
|
|||
if (IS_BLOCK(slot->type))
|
||||
{
|
||||
offset = start_sector;
|
||||
finfo("nbytes=%zu sector offset=%jd\n", nbytes, (intmax_t)offset);
|
||||
finfo("nbytes=%zu sector offset=%" PRIdOFF "\n", nbytes, offset);
|
||||
}
|
||||
else
|
||||
{
|
||||
offset = start_sector * SECTORSIZE(slot);
|
||||
finfo("nbytes=%zu byte offset=%jd\n", nbytes, (intmax_t)offset);
|
||||
finfo("nbytes=%zu byte offset=%" PRIdOFF "\n", nbytes, offset);
|
||||
}
|
||||
|
||||
mmcsd_dumpbuffer("Write buffer", buffer, nbytes);
|
||||
|
@ -1594,7 +1594,7 @@ static int mmcsd_geometry(FAR struct inode *inode, struct geometry *geometry)
|
|||
finfo("geo_available: %d\n", geometry->geo_available);
|
||||
finfo("geo_mediachanged: %d\n", geometry->geo_mediachanged);
|
||||
finfo("geo_writeenabled: %d\n", geometry->geo_writeenabled);
|
||||
finfo("geo_nsectors: %" PRIu32 "\n", geometry->geo_nsectors);
|
||||
finfo("geo_nsectors: %" PRIuOFF "\n", geometry->geo_nsectors);
|
||||
finfo("geo_sectorsize: %" PRIi16 "\n", geometry->geo_sectorsize);
|
||||
|
||||
return OK;
|
||||
|
|
|
@ -190,8 +190,8 @@ static ssize_t ftl_reload(FAR void *priv, FAR uint8_t *buffer,
|
|||
nread = MTD_BREAD(dev->mtd, startblock, nblocks, buffer);
|
||||
if (nread != nblocks)
|
||||
{
|
||||
ferr("ERROR: Read %zu blocks starting at block %jd failed: %zd\n",
|
||||
nblocks, (intmax_t)startblock, nread);
|
||||
ferr("ERROR: Read %zu blocks starting at block %" PRIdOFF
|
||||
" failed: %zd\n", nblocks, startblock, nread);
|
||||
}
|
||||
|
||||
return nread;
|
||||
|
@ -209,7 +209,7 @@ static ssize_t ftl_read(FAR struct inode *inode, unsigned char *buffer,
|
|||
{
|
||||
FAR struct ftl_struct_s *dev;
|
||||
|
||||
finfo("sector: %" PRIu32 " nsectors: %u\n", start_sector, nsectors);
|
||||
finfo("sector: %" PRIuOFF " nsectors: %u\n", start_sector, nsectors);
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
|
||||
|
@ -284,8 +284,8 @@ static ssize_t ftl_flush(FAR void *priv, FAR const uint8_t *buffer,
|
|||
nxfrd = MTD_BREAD(dev->mtd, rwblock, dev->blkper, dev->eblock);
|
||||
if (nxfrd != dev->blkper)
|
||||
{
|
||||
ferr("ERROR: Read erase block %jd failed: %zd\n",
|
||||
(intmax_t)rwblock, nxfrd);
|
||||
ferr("ERROR: Read erase block %" PRIdOFF " failed: %zd\n",
|
||||
rwblock, nxfrd);
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
|
@ -295,8 +295,8 @@ static ssize_t ftl_flush(FAR void *priv, FAR const uint8_t *buffer,
|
|||
ret = MTD_ERASE(dev->mtd, eraseblock, 1);
|
||||
if (ret < 0)
|
||||
{
|
||||
ferr("ERROR: Erase block=%jd failed: %d\n",
|
||||
(intmax_t)eraseblock, ret);
|
||||
ferr("ERROR: Erase block=%" PRIdOFF "failed: %d\n",
|
||||
eraseblock, ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -313,8 +313,8 @@ static ssize_t ftl_flush(FAR void *priv, FAR const uint8_t *buffer,
|
|||
nbytes = dev->geo.erasesize - offset;
|
||||
}
|
||||
|
||||
finfo("Copy %d bytes into erase block=%jd at offset=%jd\n",
|
||||
nbytes, (intmax_t)eraseblock, (intmax_t)offset);
|
||||
finfo("Copy %d bytes into erase block=%" PRIdOFF
|
||||
" at offset=%" PRIdOFF "\n", nbytes, eraseblock, offset);
|
||||
|
||||
memcpy(dev->eblock + offset, buffer, nbytes);
|
||||
|
||||
|
@ -323,8 +323,8 @@ static ssize_t ftl_flush(FAR void *priv, FAR const uint8_t *buffer,
|
|||
nxfrd = MTD_BWRITE(dev->mtd, rwblock, dev->blkper, dev->eblock);
|
||||
if (nxfrd != dev->blkper)
|
||||
{
|
||||
ferr("ERROR: Write erase block %jd failed: %zu\n",
|
||||
(intmax_t)rwblock, nxfrd);
|
||||
ferr("ERROR: Write erase block %" PRIdOFF " failed: %zu\n",
|
||||
rwblock, nxfrd);
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
|
@ -352,21 +352,21 @@ static ssize_t ftl_flush(FAR void *priv, FAR const uint8_t *buffer,
|
|||
ret = MTD_ERASE(dev->mtd, eraseblock, 1);
|
||||
if (ret < 0)
|
||||
{
|
||||
ferr("ERROR: Erase block=%jd failed: %d\n",
|
||||
(intmax_t)eraseblock, ret);
|
||||
ferr("ERROR: Erase block=%" PRIdOFF " failed: %d\n",
|
||||
eraseblock, ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Write a full erase back to flash */
|
||||
|
||||
finfo("Write %" PRId32 " bytes into erase block=%jd at offset=0\n",
|
||||
dev->geo.erasesize, (intmax_t)alignedblock);
|
||||
finfo("Write %" PRId32 " bytes into erase block=%" PRIdOFF
|
||||
" at offset=0\n", dev->geo.erasesize, alignedblock);
|
||||
|
||||
nxfrd = MTD_BWRITE(dev->mtd, alignedblock, dev->blkper, buffer);
|
||||
if (nxfrd != dev->blkper)
|
||||
{
|
||||
ferr("ERROR: Write erase block %jd failed: %zu\n",
|
||||
(intmax_t)alignedblock, nxfrd);
|
||||
ferr("ERROR: Write erase block %" PRIdOFF " failed: %zu\n",
|
||||
alignedblock, nxfrd);
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
|
@ -393,8 +393,8 @@ static ssize_t ftl_flush(FAR void *priv, FAR const uint8_t *buffer,
|
|||
nxfrd = MTD_BREAD(dev->mtd, alignedblock, dev->blkper, dev->eblock);
|
||||
if (nxfrd != dev->blkper)
|
||||
{
|
||||
ferr("ERROR: Read erase block %jd failed: %zu\n",
|
||||
(intmax_t)alignedblock, nxfrd);
|
||||
ferr("ERROR: Read erase block %" PRIdOFF " failed: %zu\n",
|
||||
alignedblock, nxfrd);
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
|
@ -404,16 +404,16 @@ static ssize_t ftl_flush(FAR void *priv, FAR const uint8_t *buffer,
|
|||
ret = MTD_ERASE(dev->mtd, eraseblock, 1);
|
||||
if (ret < 0)
|
||||
{
|
||||
ferr("ERROR: Erase block=%jd failed: %d\n",
|
||||
(intmax_t)eraseblock, ret);
|
||||
ferr("ERROR: Erase block=%" PRIdOFF "failed: %d\n",
|
||||
eraseblock, ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Copy the user data at the beginning the buffered erase block */
|
||||
|
||||
nbytes = remaining * dev->geo.blocksize;
|
||||
finfo("Copy %d bytes into erase block=%jd at offset=0\n",
|
||||
nbytes, (intmax_t)alignedblock);
|
||||
finfo("Copy %d bytes into erase block=%" PRIdOFF " at offset=0\n",
|
||||
nbytes, alignedblock);
|
||||
memcpy(dev->eblock, buffer, nbytes);
|
||||
|
||||
/* And write the erase back to flash */
|
||||
|
@ -421,8 +421,8 @@ static ssize_t ftl_flush(FAR void *priv, FAR const uint8_t *buffer,
|
|||
nxfrd = MTD_BWRITE(dev->mtd, alignedblock, dev->blkper, dev->eblock);
|
||||
if (nxfrd != dev->blkper)
|
||||
{
|
||||
ferr("ERROR: Write erase block %jd failed: %zu\n",
|
||||
(intmax_t)alignedblock, nxfrd);
|
||||
ferr("ERROR: Write erase block %" PRIdOFF " failed: %zu\n",
|
||||
alignedblock, nxfrd);
|
||||
return -EIO;
|
||||
}
|
||||
}
|
||||
|
@ -443,7 +443,7 @@ static ssize_t ftl_write(FAR struct inode *inode,
|
|||
{
|
||||
struct ftl_struct_s *dev;
|
||||
|
||||
finfo("sector: %" PRIu32 " nsectors: %u\n", start_sector, nsectors);
|
||||
finfo("sector: %" PRIuOFF " nsectors: %u\n", start_sector, nsectors);
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
dev = (struct ftl_struct_s *)inode->i_private;
|
||||
|
@ -480,7 +480,7 @@ static int ftl_geometry(FAR struct inode *inode,
|
|||
|
||||
finfo("available: true mediachanged: false writeenabled: %s\n",
|
||||
geometry->geo_writeenabled ? "true" : "false");
|
||||
finfo("nsectors: %" PRIu32 " sectorsize: %u\n",
|
||||
finfo("nsectors: %" PRIuOFF " sectorsize: %u\n",
|
||||
geometry->geo_nsectors, geometry->geo_sectorsize);
|
||||
|
||||
return OK;
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
#include <nuttx/config.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <inttypes.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <errno.h>
|
||||
|
@ -430,8 +431,8 @@ static int part_ioctl(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg)
|
|||
* return the sum to the caller.
|
||||
*/
|
||||
|
||||
*ppv = (FAR void *)(base +
|
||||
priv->firstblock * priv->blocksize);
|
||||
*ppv = (FAR void *)(uintptr_t)
|
||||
(base + priv->firstblock * priv->blocksize);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -860,8 +860,8 @@ static ssize_t smart_reload(struct smart_struct_s *dev, FAR uint8_t *buffer,
|
|||
nread = MTD_BREAD(dev->mtd, mtdstartblock, mtdblocks, buffer);
|
||||
if (nread != mtdblocks)
|
||||
{
|
||||
ferr("ERROR: Read %zd blocks starting at block %jd failed: %zd\n",
|
||||
nblocks, (intmax_t)startblock, nread);
|
||||
ferr("ERROR: Read %zd blocks starting at block %" PRIdOFF
|
||||
" failed: %zd\n", nblocks, startblock, nread);
|
||||
}
|
||||
|
||||
return nread;
|
||||
|
@ -879,7 +879,8 @@ static ssize_t smart_read(FAR struct inode *inode, unsigned char *buffer,
|
|||
{
|
||||
FAR struct smart_struct_s *dev;
|
||||
|
||||
finfo("SMART: sector: %" PRIu32 " nsectors: %u\n", start_sector, nsectors);
|
||||
finfo("SMART: sector: %" PRIuOFF " nsectors: %u\n",
|
||||
start_sector, nsectors);
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
#ifdef CONFIG_SMARTFS_MULTI_ROOT_DIRS
|
||||
|
@ -915,7 +916,7 @@ static ssize_t smart_write(FAR struct inode *inode,
|
|||
off_t mtdstartblock;
|
||||
off_t mtdblockcount;
|
||||
|
||||
finfo("sector: %" PRIu32 " nsectors: %u\n", start_sector, nsectors);
|
||||
finfo("sector: %" PRIuOFF " nsectors: %u\n", start_sector, nsectors);
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
#ifdef CONFIG_SMARTFS_MULTI_ROOT_DIRS
|
||||
|
@ -940,8 +941,8 @@ static ssize_t smart_write(FAR struct inode *inode,
|
|||
mtdblockcount = nsectors * dev->mtdblkspersector;
|
||||
mtdblkspererase = dev->mtdblkspersector * dev->sectorsperblk;
|
||||
|
||||
finfo("mtdsector: %jd mtdnsectors: %jd\n",
|
||||
(intmax_t)mtdstartblock, (intmax_t)mtdblockcount);
|
||||
finfo("mtdsector: %" PRIdOFF " mtdnsectors: %" PRIdOFF "\n",
|
||||
mtdstartblock, mtdblockcount);
|
||||
|
||||
/* Start at first block to be written */
|
||||
|
||||
|
@ -963,8 +964,8 @@ static ssize_t smart_write(FAR struct inode *inode,
|
|||
ret = MTD_ERASE(dev->mtd, eraseblock, 1);
|
||||
if (ret < 0)
|
||||
{
|
||||
ferr("ERROR: Erase block=%jd failed: %d\n",
|
||||
(intmax_t)eraseblock, ret);
|
||||
ferr("ERROR: Erase block=%" PRIdOFF " failed: %d\n",
|
||||
eraseblock, ret);
|
||||
|
||||
/* Unlock the mutex if we add one */
|
||||
|
||||
|
@ -987,15 +988,15 @@ static ssize_t smart_write(FAR struct inode *inode,
|
|||
|
||||
/* Try to write to the sector. */
|
||||
|
||||
finfo("Write MTD block %jd from offset %jd\n",
|
||||
(intmax_t)nextblock, (intmax_t)offset);
|
||||
finfo("Write MTD block %" PRIdOFF " from offset %" PRIdOFF "\n",
|
||||
nextblock, offset);
|
||||
nxfrd = MTD_BWRITE(dev->mtd, nextblock, blkstowrite, &buffer[offset]);
|
||||
if (nxfrd != blkstowrite)
|
||||
{
|
||||
/* The block is not empty!! What to do? */
|
||||
|
||||
ferr("ERROR: Write block %jd failed: %zd.\n",
|
||||
(intmax_t)nextblock, nxfrd);
|
||||
ferr("ERROR: Write block %" PRIdOFF " failed: %zd.\n",
|
||||
nextblock, nxfrd);
|
||||
|
||||
/* Unlock the mutex if we add one */
|
||||
|
||||
|
@ -1046,7 +1047,7 @@ static int smart_geometry(FAR struct inode *inode, struct geometry *geometry)
|
|||
|
||||
finfo("available: true mediachanged: false writeenabled: %s\n",
|
||||
geometry->geo_writeenabled ? "true" : "false");
|
||||
finfo("nsectors: %" PRIu32 " sectorsize: %" PRIi16 "\n",
|
||||
finfo("nsectors: %" PRIuOFF " sectorsize: %" PRIi16 "\n",
|
||||
geometry->geo_nsectors, geometry->geo_sectorsize);
|
||||
|
||||
return OK;
|
||||
|
|
|
@ -233,7 +233,7 @@ static ssize_t rd_read(FAR struct inode *inode, unsigned char *buffer,
|
|||
DEBUGASSERT(inode && inode->i_private);
|
||||
dev = (FAR struct rd_struct_s *)inode->i_private;
|
||||
|
||||
finfo("sector: %" PRIu32 " nsectors: %u sectorsize: %d\n",
|
||||
finfo("sector: %" PRIuOFF " nsectors: %u sectorsize: %d\n",
|
||||
start_sector, nsectors, dev->rd_sectsize);
|
||||
|
||||
if (start_sector < dev->rd_nsectors &&
|
||||
|
@ -267,7 +267,7 @@ static ssize_t rd_write(FAR struct inode *inode, const unsigned char *buffer,
|
|||
DEBUGASSERT(inode && inode->i_private);
|
||||
dev = (struct rd_struct_s *)inode->i_private;
|
||||
|
||||
finfo("sector: %" PRIu32 " nsectors: %u sectorsize: %d\n",
|
||||
finfo("sector: %" PRIuOFF " nsectors: %u sectorsize: %d\n",
|
||||
start_sector, nsectors, dev->rd_sectsize);
|
||||
|
||||
if (!RDFLAG_IS_WRENABLED(dev->rd_flags))
|
||||
|
@ -315,7 +315,7 @@ static int rd_geometry(FAR struct inode *inode, struct geometry *geometry)
|
|||
|
||||
finfo("available: true mediachanged: false writeenabled: %s\n",
|
||||
geometry->geo_writeenabled ? "true" : "false");
|
||||
finfo("nsectors: %" PRIu32 " sectorsize: %" PRIi16 "\n",
|
||||
finfo("nsectors: %" PRIuOFF " sectorsize: %" PRIi16 "\n",
|
||||
geometry->geo_nsectors, geometry->geo_sectorsize);
|
||||
|
||||
return OK;
|
||||
|
|
|
@ -540,8 +540,8 @@ int rwb_invalidate_writebuffer(FAR struct rwbuffer_s *rwb,
|
|||
off_t wrbend;
|
||||
off_t invend;
|
||||
|
||||
finfo("startblock=%jd blockcount=%zu\n",
|
||||
(intmax_t)startblock, blockcount);
|
||||
finfo("startblock=%" PRIdOFF " blockcount=%zu\n",
|
||||
startblock, blockcount);
|
||||
|
||||
ret = rwb_semtake(&rwb->wrsem);
|
||||
if (ret < 0)
|
||||
|
@ -682,8 +682,8 @@ int rwb_invalidate_readahead(FAR struct rwbuffer_s *rwb,
|
|||
off_t rhbend;
|
||||
off_t invend;
|
||||
|
||||
finfo("startblock=%jd blockcount=%zu\n",
|
||||
(intmax_t)startblock, blockcount);
|
||||
finfo("startblock=%" PRIdOFF " blockcount=%zu\n",
|
||||
startblock, blockcount);
|
||||
|
||||
ret = rwb_semtake(&rwb->rhsem);
|
||||
if (ret < 0)
|
||||
|
@ -937,7 +937,7 @@ static ssize_t rwb_read_(FAR struct rwbuffer_s *rwb, off_t startblock,
|
|||
|
||||
if (rwb->rhnblocks > 0)
|
||||
{
|
||||
off_t bufferend;
|
||||
off_t bufferend;
|
||||
|
||||
/* How many blocks are available in this buffer? */
|
||||
|
||||
|
@ -1125,7 +1125,7 @@ ssize_t rwb_write(FAR struct rwbuffer_s *rwb, off_t startblock,
|
|||
#ifdef CONFIG_DRVR_WRITEBUFFER
|
||||
if (rwb->wrmaxblocks > 0)
|
||||
{
|
||||
finfo("startblock=%d wrbuffer=%p\n", startblock, wrbuffer);
|
||||
finfo("startblock=%" PRIdOFF " wrbuffer=%p\n", startblock, wrbuffer);
|
||||
|
||||
ret = nxsem_wait(&rwb->wrsem);
|
||||
if (ret < 0)
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
@ -2037,8 +2038,8 @@ static ssize_t usbhost_read(FAR struct inode *inode, unsigned char *buffer,
|
|||
DEBUGASSERT(priv->usbclass.hport);
|
||||
hport = priv->usbclass.hport;
|
||||
|
||||
uinfo("startsector: %" PRIu32 " nsectors: %u sectorsize: %" PRIu16 "\n",
|
||||
startsector, nsectors, priv->blocksize);
|
||||
uinfo("startsector: %" PRIuOFF " nsectors: %u "
|
||||
"sectorsize: %" PRIu16 "\n", startsector, nsectors, priv->blocksize);
|
||||
|
||||
/* Check if the mass storage device is still connected */
|
||||
|
||||
|
@ -2144,7 +2145,7 @@ static ssize_t usbhost_write(FAR struct inode *inode,
|
|||
ssize_t nbytes;
|
||||
int ret;
|
||||
|
||||
uinfo("sector: %" PRIu32 " nsectors: %u\n", startsector, nsectors);
|
||||
uinfo("sector: %" PRIuOFF " nsectors: %u\n", startsector, nsectors);
|
||||
|
||||
DEBUGASSERT(inode && inode->i_private);
|
||||
priv = (FAR struct usbhost_state_s *)inode->i_private;
|
||||
|
@ -2271,8 +2272,8 @@ static int usbhost_geometry(FAR struct inode *inode,
|
|||
geometry->geo_sectorsize = priv->blocksize;
|
||||
usbhost_givesem(&priv->exclsem);
|
||||
|
||||
uinfo("nsectors: %ld sectorsize: %" PRIi16 "n",
|
||||
(long)geometry->geo_nsectors, geometry->geo_sectorsize);
|
||||
uinfo("nsectors: %" PRIdOFF " sectorsize: %" PRIi16 "\n",
|
||||
geometry->geo_nsectors, geometry->geo_sectorsize);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -108,10 +108,10 @@ static int fat_checkbootrecord(struct fat_mountpt_s *fs)
|
|||
FBR_GETBYTESPERSEC(fs->fs_buffer) != fs->fs_hwsectorsize)
|
||||
{
|
||||
fwarn("WARNING: Signature: %04x FS sectorsize: %d "
|
||||
"HW sectorsize: %jd\n",
|
||||
"HW sectorsize: %" PRIdOFF "\n",
|
||||
FBR_GETSIGNATURE(fs->fs_buffer),
|
||||
FBR_GETBYTESPERSEC(fs->fs_buffer),
|
||||
(intmax_t)fs->fs_hwsectorsize);
|
||||
fs->fs_hwsectorsize);
|
||||
|
||||
return -EINVAL;
|
||||
}
|
||||
|
@ -148,7 +148,8 @@ static int fat_checkbootrecord(struct fat_mountpt_s *fs)
|
|||
|
||||
if (!fs->fs_nfatsects || fs->fs_nfatsects >= fs->fs_hwnsectors)
|
||||
{
|
||||
fwarn("WARNING: fs_nfatsects %" PRId32 " fs_hwnsectors: %" PRId32 "\n",
|
||||
fwarn("WARNING: fs_nfatsects %" PRId32
|
||||
" fs_hwnsectors: %" PRIdOFF "\n",
|
||||
fs->fs_nfatsects, fs->fs_hwnsectors);
|
||||
|
||||
return -EINVAL;
|
||||
|
@ -168,8 +169,9 @@ static int fat_checkbootrecord(struct fat_mountpt_s *fs)
|
|||
|
||||
if (!fs->fs_fattotsec || fs->fs_fattotsec > fs->fs_hwnsectors)
|
||||
{
|
||||
fwarn("WARNING: fs_fattotsec %" PRId32 " fs_hwnsectors: %jd\n",
|
||||
fs->fs_fattotsec, (intmax_t)fs->fs_hwnsectors);
|
||||
fwarn("WARNING: fs_fattotsec %" PRId32
|
||||
" fs_hwnsectors: %" PRIdOFF "\n",
|
||||
fs->fs_fattotsec, fs->fs_hwnsectors);
|
||||
|
||||
return -EINVAL;
|
||||
}
|
||||
|
@ -179,8 +181,9 @@ static int fat_checkbootrecord(struct fat_mountpt_s *fs)
|
|||
fs->fs_fatresvdseccount = FBR_GETRESVDSECCOUNT(fs->fs_buffer);
|
||||
if (fs->fs_fatresvdseccount > fs->fs_hwnsectors)
|
||||
{
|
||||
fwarn("WARNING: fs_fatresvdseccount %d fs_hwnsectors: %jd\n",
|
||||
fs->fs_fatresvdseccount, (intmax_t)fs->fs_hwnsectors);
|
||||
fwarn("WARNING: fs_fatresvdseccount %d"
|
||||
" fs_hwnsectors: %" PRIdOFF "\n",
|
||||
fs->fs_fatresvdseccount, fs->fs_hwnsectors);
|
||||
|
||||
return -EINVAL;
|
||||
}
|
||||
|
@ -198,8 +201,9 @@ static int fat_checkbootrecord(struct fat_mountpt_s *fs)
|
|||
ntotalfatsects - rootdirsectors;
|
||||
if (ndatasectors > fs->fs_hwnsectors)
|
||||
{
|
||||
fwarn("WARNING: ndatasectors %" PRId32 " fs_hwnsectors: %jd\n",
|
||||
ndatasectors, (intmax_t)fs->fs_hwnsectors);
|
||||
fwarn("WARNING: ndatasectors %" PRId32
|
||||
" fs_hwnsectors: %" PRIdOFF "\n",
|
||||
ndatasectors, fs->fs_hwnsectors);
|
||||
|
||||
return -EINVAL;
|
||||
}
|
||||
|
@ -646,15 +650,15 @@ int fat_mount(struct fat_mountpt_s *fs, bool writeable)
|
|||
/* We did it! */
|
||||
|
||||
finfo("FAT%d:\n", fs->fs_type == 0 ? 12 : fs->fs_type == 1 ? 16 : 32);
|
||||
finfo("\tHW sector size: %jd\n", (intmax_t)fs->fs_hwsectorsize);
|
||||
finfo("\t sectors: %jd\n", (intmax_t)fs->fs_hwnsectors);
|
||||
finfo("\tHW sector size: %" PRIdOFF "\n", fs->fs_hwsectorsize);
|
||||
finfo("\t sectors: %" PRIdOFF "\n", fs->fs_hwnsectors);
|
||||
finfo("\tFAT reserved: %d\n", fs->fs_fatresvdseccount);
|
||||
finfo("\t sectors: %" PRId32 "\n", fs->fs_fattotsec);
|
||||
finfo("\t start sector: %jd\n", (intmax_t)fs->fs_fatbase);
|
||||
finfo("\t root sector: %jd\n", (intmax_t)fs->fs_rootbase);
|
||||
finfo("\t start sector: %" PRIdOFF "\n", fs->fs_fatbase);
|
||||
finfo("\t root sector: %" PRIdOFF "\n", fs->fs_rootbase);
|
||||
finfo("\t root entries: %d\n", fs->fs_rootentcnt);
|
||||
finfo("\t data sector: %jd\n", (intmax_t)fs->fs_database);
|
||||
finfo("\t FSINFO sector: %jd\n", (intmax_t)fs->fs_fsinfo);
|
||||
finfo("\t data sector: %" PRIdOFF "\n", fs->fs_database);
|
||||
finfo("\t FSINFO sector: %" PRIdOFF "\n", fs->fs_fsinfo);
|
||||
finfo("\t Num FATs: %d\n", fs->fs_fatnumfats);
|
||||
finfo("\t FAT sectors: %" PRId32 "\n", fs->fs_nfatsects);
|
||||
finfo("\t sectors/cluster: %d\n", fs->fs_fatsecperclus);
|
||||
|
@ -2197,8 +2201,9 @@ int fat_currentsector(struct fat_mountpt_s *fs, struct fat_file_s *ff,
|
|||
|
||||
ff->ff_sectorsincluster = fs->fs_fatsecperclus - sectoroffset;
|
||||
|
||||
finfo("position=%jd currentsector=%jd sectorsincluster=%d\n",
|
||||
(intmax_t)position, (intmax_t)ff->ff_currentsector,
|
||||
finfo("position=%" PRIdOFF " currentsector=%" PRIdOFF
|
||||
" sectorsincluster=%d\n",
|
||||
position, ff->ff_currentsector,
|
||||
ff->ff_sectorsincluster);
|
||||
|
||||
return OK;
|
||||
|
|
|
@ -1570,7 +1570,7 @@ void spiffs_fobj_event(FAR struct spiffs_s *fs,
|
|||
|
||||
if (ev != SPIFFS_EV_NDXDEL)
|
||||
{
|
||||
finfo("Setting objid=%d (offset=%" PRIu32 ") objhdr_pgndx "
|
||||
finfo("Setting objid=%d (offset=%" PRIuOFF ") objhdr_pgndx "
|
||||
"to %04x size=%" PRIu32 "\n",
|
||||
fobj->objid, fobj->offset, new_pgndx, new_size);
|
||||
|
||||
|
@ -1737,8 +1737,8 @@ ssize_t spiffs_fobj_append(FAR struct spiffs_s *fs,
|
|||
int ret = OK;
|
||||
int ret2;
|
||||
|
||||
finfo("Append %zu bytes @ offs=%jd of size=%jd\n",
|
||||
len, (intmax_t)offset, (intmax_t)fobj->size);
|
||||
finfo("Append %zu bytes @ offs=%" PRIdOFF " of size=%" PRIdOFF "\n",
|
||||
len, offset, fobj->size);
|
||||
|
||||
if (offset > fobj->size)
|
||||
{
|
||||
|
@ -1891,9 +1891,9 @@ ssize_t spiffs_fobj_append(FAR struct spiffs_s *fs,
|
|||
return ret;
|
||||
}
|
||||
|
||||
finfo("objid=%04x store new size I %jd in objhdr, "
|
||||
"%04x:%04x, nwritten=%zu\n",
|
||||
fobj->objid, (intmax_t)(offset + nwritten),
|
||||
finfo("objid=%04x store new size I %" PRIdOFF
|
||||
" in objhdr, %04x:%04x, nwritten=%zu\n",
|
||||
fobj->objid, offset + nwritten,
|
||||
new_objhdr_page, 0,
|
||||
nwritten);
|
||||
}
|
||||
|
@ -2008,7 +2008,7 @@ ssize_t spiffs_fobj_append(FAR struct spiffs_s *fs,
|
|||
}
|
||||
|
||||
finfo("objid=%04x found object index at "
|
||||
"page=%04x [fobj size=%" PRIu32 "]\n",
|
||||
"page=%04x [fobj size=%" PRIuOFF "]\n",
|
||||
fobj->objid, pgndx, fobj->size);
|
||||
|
||||
ret = spiffs_cache_read(fs,
|
||||
|
@ -2200,9 +2200,9 @@ ssize_t spiffs_fobj_append(FAR struct spiffs_s *fs,
|
|||
offset + nwritten,
|
||||
&new_objhdr_page);
|
||||
|
||||
finfo("objid=%04x store new size II %jd in objhdr, %04x:%04x, "
|
||||
"nwritten=%zu, ret=%d\n",
|
||||
fobj->objid, (intmax_t)(offset + nwritten),
|
||||
finfo("objid=%04x store new size II %" PRIdOFF
|
||||
" in objhdr, %04x:%04x, nwritten=%zu, ret=%d\n",
|
||||
fobj->objid, offset + nwritten,
|
||||
new_objhdr_page, 0, nwritten,
|
||||
ret2);
|
||||
|
||||
|
|
|
@ -1186,7 +1186,7 @@ int spiffs_gc_check(FAR struct spiffs_s *fs, off_t len)
|
|||
|
||||
spiffs_gcinfo("#%d: run gc free_blocks=%" PRIu32 " pfree="
|
||||
"%" PRIu32 " pallo=%" PRIu32 " pdele=%" PRIu32 ""
|
||||
" [%" PRIu32 "] len=%" PRIu32 " of %" PRIu32 "\n",
|
||||
" [%" PRIu32 "] len=%" PRIuOFF " of %" PRIu32 "\n",
|
||||
tries, fs->free_blocks, free_pages,
|
||||
fs->alloc_pages, fs->deleted_pages,
|
||||
(free_pages + fs->alloc_pages + fs->deleted_pages),
|
||||
|
|
Loading…
Reference in a new issue