fs: nxstyle fixes
Fix for several errors reported by the nxstyle tool Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
This commit is contained in:
parent
015a205ec6
commit
7dc5db49fc
@ -127,7 +127,9 @@ int aio_cancel(int fildes, FAR struct aiocb *aiocbp)
|
||||
status = work_cancel(LPWORK, &aioc->aioc_work);
|
||||
if (status >= 0)
|
||||
{
|
||||
/* Remove the container from the list of pending transfers */
|
||||
/* Remove the container from the list of pending
|
||||
* transfers
|
||||
*/
|
||||
|
||||
pid = aioc->aioc_pid;
|
||||
aioc_decant(aioc);
|
||||
@ -182,7 +184,9 @@ int aio_cancel(int fildes, FAR struct aiocb *aiocbp)
|
||||
status = work_cancel(LPWORK, &aioc->aioc_work);
|
||||
if (status >= 0)
|
||||
{
|
||||
/* Remove the container from the list of pending transfers */
|
||||
/* Remove the container from the list of pending
|
||||
* transfers
|
||||
*/
|
||||
|
||||
next =
|
||||
(FAR struct aio_container_s *)aioc->aioc_link.flink;
|
||||
|
@ -103,7 +103,8 @@ struct nfsstats
|
||||
#undef EXTERN
|
||||
#if defined(__cplusplus)
|
||||
#define EXTERN extern "C"
|
||||
extern "C" {
|
||||
extern "C"
|
||||
{
|
||||
#else
|
||||
#define EXTERN extern
|
||||
#endif
|
||||
|
@ -80,9 +80,9 @@ struct nfsmount
|
||||
uint16_t nm_readdirsize; /* Size of a readdir RPC */
|
||||
uint16_t nm_buflen; /* Size of I/O buffer */
|
||||
|
||||
/* Set aside memory on the stack to hold the largest call message. NOTE
|
||||
* that for the case of the write call message, it is the reply message that
|
||||
* is in this union.
|
||||
/* Set aside memory on the stack to hold the largest call message.
|
||||
* NOTE that for the case of the write call message, it is the reply
|
||||
* message that is in this union.
|
||||
*/
|
||||
|
||||
union
|
||||
@ -101,24 +101,26 @@ struct nfsmount
|
||||
struct rpc_reply_write write;
|
||||
} nm_msgbuffer;
|
||||
|
||||
/* I/O buffer (must be a aligned to 32-bit boundaries). This buffer used for all
|
||||
* reply messages EXCEPT for the WRITE RPC. In that case it is used for the WRITE
|
||||
* call message that contains the data to be written. This buffer must be
|
||||
* dynamically sized based on the characteristics of the server and upon the
|
||||
* configuration of the NuttX network. It must be sized to hold the largest
|
||||
* possible WRITE call message or READ response message.
|
||||
/* I/O buffer (must be a aligned to 32-bit boundaries). This buffer used
|
||||
* for all reply messages EXCEPT for the WRITE RPC. In that case it is used
|
||||
* for the WRITE call message that contains the data to be written. This
|
||||
* buffer must be dynamically sized based on the characteristics of the
|
||||
* server and upon the configuration of the NuttX network. It must be
|
||||
* sized to hold the largest possible WRITE call message or READ response
|
||||
* message.
|
||||
*/
|
||||
|
||||
uint32_t nm_iobuffer[1]; /* Actual size is given by nm_buflen */
|
||||
};
|
||||
|
||||
/* The size of the nfsmount structure will depend on the size of the allocated I/O
|
||||
* buffer.
|
||||
/* The size of the nfsmount structure will depend on the size of the
|
||||
* allocated I/O buffer.
|
||||
*/
|
||||
|
||||
#define SIZEOF_nfsmount(n) (sizeof(struct nfsmount) + ((n + 3) & ~3) - sizeof(uint32_t))
|
||||
|
||||
/* Mount parameters structure. This structure is use in nfs_decode_args function before one
|
||||
/* Mount parameters structure.
|
||||
* This structure is use in nfs_decode_args function before one
|
||||
* mount structure is allocated in each NFS mount.
|
||||
*/
|
||||
|
||||
|
34
fs/nfs/rpc.h
34
fs/nfs/rpc.h
@ -12,23 +12,25 @@
|
||||
* the regents of the university of michigan
|
||||
* all rights reserved
|
||||
*
|
||||
* permission is granted to use, copy, create derivative works and redistribute
|
||||
* this software and such derivative works for any purpose, so long as the name
|
||||
* of the university of michigan is not used in any advertising or publicity
|
||||
* pertaining to the use or distribution of this software without specific,
|
||||
* written prior authorization. if the above copyright notice or any other
|
||||
* identification of the university of michigan is included in any copy of any
|
||||
* portion of this software, then the disclaimer below must also be included.
|
||||
* permission is granted to use, copy, create derivative works and
|
||||
* redistribute this software and such derivative works for any purpose, so
|
||||
* long as the name of the university of michigan is not used in any
|
||||
* advertising or publicity pertaining to the use or distribution of this
|
||||
* software without specific, written prior authorization. if the above
|
||||
* copyright notice or any other identification of the university of michigan
|
||||
* is included in any copy of any portion of this software, then the
|
||||
* disclaimer below must also be included.
|
||||
*
|
||||
* this software is provided as is, without representation from the university
|
||||
* of michigan as to its fitness for any purpose, and without warranty by the
|
||||
* university of michigan of any kind, either express or implied, including
|
||||
* without limitation the implied warranties of merchantability and fitness for
|
||||
* a particular purpose. the regents of the university of michigan shall not be
|
||||
* liable for any damages, including special, indirect, incidental, or
|
||||
* consequential damages, with respect to any claim arising out of or in
|
||||
* connection with the use of the software, even if it has been or is hereafter
|
||||
* advised of the possibility of such damages.
|
||||
* this software is provided as is, without representation from the
|
||||
* university of michigan as to its fitness for any purpose, and without
|
||||
* warranty by the university of michigan of any kind, either express or
|
||||
* implied, including without limitation the implied warranties of
|
||||
* merchantability and fitness for a particular purpose. the regents of the
|
||||
* university of michigan shall not be liable for any damages, including
|
||||
* special, indirect, incidental, or consequential damages, with respect to
|
||||
* any claim arising out of or in connection with the use of the software,
|
||||
* even if it has been or is hereafter advised of the possibility of such
|
||||
* damages.
|
||||
*
|
||||
* Copyright (c) 1989, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
|
@ -43,8 +43,8 @@
|
||||
* Copyright (c) 1989, 1991, 1993, 1995 The Regents of the University of
|
||||
* California. All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to Berkeley by Rick Macklem at
|
||||
* The University of Guelph.
|
||||
* This code is derived from software contributed to Berkeley by Rick Macklem
|
||||
* at The University of Guelph.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
@ -60,11 +60,11 @@
|
||||
* endorse or promote products derived from this software without specific
|
||||
* prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
|
@ -55,6 +55,7 @@
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/* Macros used for conversion to/from xdr representation by nfs...
|
||||
* These use the MACHINE DEPENDENT routines ntohl, htonl
|
||||
* As defined by "XDR: External Data Representation Standard" RFC1014
|
||||
|
@ -212,7 +212,9 @@ int smartfs_mount(struct smartfs_mountpt_s *fs, bool writeable)
|
||||
goto errout;
|
||||
}
|
||||
|
||||
/* Make sure that that the media is write-able (if write access is needed) */
|
||||
/* Make sure that that the media is write-able
|
||||
* (if write access is needed)
|
||||
*/
|
||||
|
||||
if (writeable && !geo.geo_writeenabled)
|
||||
{
|
||||
@ -724,7 +726,9 @@ int smartfs_finddirentry(struct smartfs_mountpt_s *fs,
|
||||
break;
|
||||
}
|
||||
|
||||
/* Add used bytes to the total and point to next sector */
|
||||
/* Add used bytes to the total and point
|
||||
* to next sector
|
||||
*/
|
||||
|
||||
if (*((FAR uint16_t *)header->used) !=
|
||||
SMARTFS_ERASEDSTATE_16BIT)
|
||||
@ -847,10 +851,12 @@ errout:
|
||||
****************************************************************************/
|
||||
|
||||
int smartfs_createentry(FAR struct smartfs_mountpt_s *fs,
|
||||
uint16_t parentdirsector, FAR const char *filename,
|
||||
uint16_t parentdirsector,
|
||||
FAR const char *filename,
|
||||
uint16_t type, mode_t mode,
|
||||
FAR struct smartfs_entry_s *direntry,
|
||||
uint16_t sectorno, FAR struct smartfs_ofile_s *sf)
|
||||
uint16_t sectorno,
|
||||
FAR struct smartfs_ofile_s *sf)
|
||||
{
|
||||
struct smart_read_write_s readwrite;
|
||||
int ret;
|
||||
@ -1264,7 +1270,9 @@ int smartfs_deleteentry(struct smartfs_mountpt_s *fs,
|
||||
offset += entrysize;
|
||||
}
|
||||
|
||||
/* Test if the count it zero. If it is, then we will release the sector */
|
||||
/* Test if the count it zero.
|
||||
* If it is, then we will release the sector
|
||||
*/
|
||||
|
||||
if (count == 0)
|
||||
{
|
||||
@ -1275,7 +1283,9 @@ int smartfs_deleteentry(struct smartfs_mountpt_s *fs,
|
||||
|
||||
nextsector = SMARTFS_NEXTSECTOR(header);
|
||||
|
||||
/* Now loop through the dir sectors to find ourselves in the chain */
|
||||
/* Now loop through the dir sectors to find ourselves in the
|
||||
* chain
|
||||
*/
|
||||
|
||||
sector = entry->dfirst;
|
||||
readwrite.offset = 0;
|
||||
|
@ -102,7 +102,9 @@ typedef int32_t(*spiffs_read_t)(uint32_t addr, uint32_t size, uint8_t * dst);
|
||||
|
||||
/* spi write call function type */
|
||||
|
||||
typedef int32_t(*spiffs_write_t)(uint32_t addr, uint32_t size, uint8_t * src);
|
||||
typedef int32_t(*spiffs_write_t)(uint32_t addr,
|
||||
uint32_t size,
|
||||
uint8_t * src);
|
||||
|
||||
/* spi erase call function type */
|
||||
|
||||
|
@ -193,7 +193,8 @@ static int spiffs_cache_page_remove_oldest(FAR struct spiffs_s *fs,
|
||||
|
||||
/* Don't remove any cache pages unless there are no free cache pages */
|
||||
|
||||
if ((cache->cpage_use_map & cache->cpage_use_mask) != cache->cpage_use_mask)
|
||||
if ((cache->cpage_use_map & cache->cpage_use_mask) !=
|
||||
cache->cpage_use_mask)
|
||||
{
|
||||
/* At least one free cpage */
|
||||
|
||||
@ -463,9 +464,9 @@ ssize_t spiffs_cache_read(FAR struct spiffs_s *fs, uint8_t op, int16_t objid,
|
||||
cp->cpndx, cp->pgndx);
|
||||
|
||||
ret = spiffs_mtd_read(fs, addr -
|
||||
SPIFFS_PADDR_TO_PAGE_OFFSET(fs, addr),
|
||||
SPIFFS_GEO_PAGE_SIZE(fs),
|
||||
spiffs_get_cache_page(fs, cache, cp->cpndx));
|
||||
SPIFFS_PADDR_TO_PAGE_OFFSET(fs, addr),
|
||||
SPIFFS_GEO_PAGE_SIZE(fs),
|
||||
spiffs_get_cache_page(fs, cache, cp->cpndx));
|
||||
|
||||
mem = spiffs_get_cache_page(fs, cache, cp->cpndx);
|
||||
memcpy(dest, &mem[SPIFFS_PADDR_TO_PAGE_OFFSET(fs, addr)], len);
|
||||
@ -705,7 +706,8 @@ void spiffs_cache_page_release(FAR struct spiffs_s *fs,
|
||||
|
||||
for (fobj = (FAR struct spiffs_file_s *)dq_peek(&fs->objq);
|
||||
fobj != NULL;
|
||||
fobj = (FAR struct spiffs_file_s *)dq_next((FAR dq_entry_t *)fobj))
|
||||
fobj =
|
||||
(FAR struct spiffs_file_s *)dq_next((FAR dq_entry_t *)fobj))
|
||||
{
|
||||
/* "Unrefer" the cache page */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user