Fix the printf warning after off_t change

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Id46daa2ee690a73d3187b479f0e7ab0e2e361764
This commit is contained in:
Xiang Xiao
2021-07-21 15:27:36 +08:00
committed by Jiuzhu Dong
parent 6c9ea8d293
commit 030d496728
15 changed files with 119 additions and 105 deletions
+8 -5
View File
@@ -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);
+6 -5
View File
@@ -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;
+3 -2
View File
@@ -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;
+2 -1
View File
@@ -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;