fs: nxffs: nxstyle error fix

Fix nxstyle errors to pass CI

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
This commit is contained in:
Alin Jerpelea 2021-02-04 13:56:38 +01:00 committed by Alan Carvalho de Assis
parent 789d3751ad
commit a544c3f499
5 changed files with 28 additions and 14 deletions

View File

@ -89,8 +89,9 @@ int closedir(FAR DIR *dirp)
goto errout; goto errout;
} }
/* A special case is when we enumerate an "empty", unused inode. That is /* A special case is when we enumerate an "empty", unused inode.
* an inode in the pseudo-filesystem that has no operations and no children. * That is an inode in the pseudo-filesystem that has no operations
* and no children.
* This is a "dangling" directory entry that has lost its childre. * This is a "dangling" directory entry that has lost its childre.
*/ */

View File

@ -56,7 +56,8 @@
* Call the close method and release the inode * Call the close method and release the inode
* *
* Input Parameters: * Input Parameters:
* inode - reference to the inode of a block driver opened by open_blockdriver * inode - reference to the inode of a block driver opened by
* open_blockdriver
* *
* Returned Value: * Returned Value:
* Returns zero on success or a negated errno on failure: * Returns zero on success or a negated errno on failure:

View File

@ -128,8 +128,8 @@ void rammap_initialize(void);
* offset The offset into the file to map * offset The offset into the file to map
* *
* Returned Value: * Returned Value:
* On success, rammmap() returns a pointer to the mapped area. On error, the * On success, rammmap() returns a pointer to the mapped area. On error,
* value MAP_FAILED is returned, and errno is set appropriately. * the value MAP_FAILED is returned, and errno is set appropriately.
* *
* EBADF * EBADF
* 'fd' is not a valid file descriptor. * 'fd' is not a valid file descriptor.

View File

@ -147,8 +147,8 @@ static inline ssize_t nxffs_analyzeinode(FAR struct nxffs_blkinfo_s *blkinfo,
if (doffs < blkinfo->offset + offset + SIZEOF_NXFFS_BLOCK_HDR) if (doffs < blkinfo->offset + offset + SIZEOF_NXFFS_BLOCK_HDR)
{ {
/* The first data block begins before the inode header. This can't can't /* The first data block begins before the inode header. This can't
* be a real inode header (or it is a corrupted one). * can't be a real inode header (or it is a corrupted one).
*/ */
return ERROR; return ERROR;
@ -197,7 +197,8 @@ static inline ssize_t nxffs_analyzeinode(FAR struct nxffs_blkinfo_s *blkinfo,
nxffs_wrle32(inode.crc, 0); nxffs_wrle32(inode.crc, 0);
crc = crc32((FAR const uint8_t *)&inode, SIZEOF_NXFFS_INODE_HDR); crc = crc32((FAR const uint8_t *)&inode, SIZEOF_NXFFS_INODE_HDR);
crc = crc32part(&blkinfo->buffer[noffs - blkinfo->offset], inode.namlen, crc); crc = crc32part(&blkinfo->buffer[noffs - blkinfo->offset],
inode.namlen, crc);
if (crc != ecrc) if (crc != ecrc)
{ {
@ -273,7 +274,8 @@ static inline ssize_t nxffs_analyzedata(FAR struct nxffs_blkinfo_s *blkinfo,
nxffs_wrle32(dathdr.crc, 0); nxffs_wrle32(dathdr.crc, 0);
crc = crc32((FAR const uint8_t *)&dathdr, SIZEOF_NXFFS_DATA_HDR); crc = crc32((FAR const uint8_t *)&dathdr, SIZEOF_NXFFS_DATA_HDR);
crc = crc32part(&blkinfo->buffer[offset + SIZEOF_NXFFS_DATA_HDR], datlen, crc); crc = crc32part(&blkinfo->buffer[offset + SIZEOF_NXFFS_DATA_HDR],
datlen, crc);
if (crc != ecrc) if (crc != ecrc)
{ {
@ -329,7 +331,12 @@ static inline void nxffs_analyze(FAR struct nxffs_blkinfo_s *blkinfo)
{ {
if (blkinfo->verbose) if (blkinfo->verbose)
{ {
syslog(LOG_NOTICE, g_format, blkinfo->block, 0, "BLOCK", "ERASED ", syslog(LOG_NOTICE,
g_format,
blkinfo->block,
0,
"BLOCK",
"ERASED ",
blkinfo->geo.blocksize); blkinfo->geo.blocksize);
} }
@ -409,8 +416,9 @@ static inline void nxffs_analyze(FAR struct nxffs_blkinfo_s *blkinfo)
* Name: nxffs_dump * Name: nxffs_dump
* *
* Description: * Description:
* Dump a summary of the contents of an NXFFS file system. CONFIG_DEBUG_FEATURES * Dump a summary of the contents of an NXFFS file system.
* and CONFIG_DEBUG_FS must be enabled for this function to do anything. * CONFIG_DEBUG_FEATURES and CONFIG_DEBUG_FS must be enabled
* for this function to do anything.
* *
* Input Parameters: * Input Parameters:
* mtd - The MTD device that provides the interface to NXFFS-formatted * mtd - The MTD device that provides the interface to NXFFS-formatted
@ -435,7 +443,9 @@ int nxffs_dump(FAR struct mtd_dev_s *mtd, bool verbose)
*/ */
memset(&blkinfo, 0, sizeof(struct nxffs_blkinfo_s)); memset(&blkinfo, 0, sizeof(struct nxffs_blkinfo_s));
ret = MTD_IOCTL(mtd, MTDIOC_GEOMETRY, (unsigned long)((uintptr_t)&blkinfo.geo)); ret = MTD_IOCTL(mtd,
MTDIOC_GEOMETRY,
(unsigned long)((uintptr_t)&blkinfo.geo));
if (ret < 0) if (ret < 0)
{ {
ferr("ERROR: MTD ioctl(MTDIOC_GEOMETRY) failed: %d\n", -ret); ferr("ERROR: MTD ioctl(MTDIOC_GEOMETRY) failed: %d\n", -ret);

View File

@ -107,7 +107,9 @@ ssize_t file_read(FAR struct file *filep, FAR void *buf, size_t nbytes)
* signature and position in the operations vtable. * signature and position in the operations vtable.
*/ */
ret = (int)inode->u.i_ops->read(filep, (FAR char *)buf, (size_t)nbytes); ret = (int)inode->u.i_ops->read(filep,
(FAR char *)buf,
(size_t)nbytes);
} }
/* Return the number of bytes read (or possibly an error code) */ /* Return the number of bytes read (or possibly an error code) */