mirror of
https://github.com/apache/nuttx.git
synced 2026-06-04 23:03:27 +08:00
nuttx/fs: Fix some spacing and alignment issues
This commit is contained in:
+2
-2
@@ -133,7 +133,7 @@ FAR void *mmap(FAR void *start, size_t length, int prot, int flags,
|
||||
|
||||
#ifdef CONFIG_DEBUG
|
||||
if (prot == PROT_NONE ||
|
||||
(flags & (MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS|MAP_DENYWRITE)) != 0)
|
||||
(flags & (MAP_PRIVATE | MAP_FIXED | MAP_ANONYMOUS | MAP_DENYWRITE)) != 0)
|
||||
{
|
||||
fdbg("Unsupported options, prot=%x flags=%04x\n", prot, flags);
|
||||
set_errno(ENOSYS);
|
||||
@@ -170,5 +170,5 @@ FAR void *mmap(FAR void *start, size_t length, int prot, int flags,
|
||||
|
||||
/* Return the offset address */
|
||||
|
||||
return (void*)(((uint8_t*)addr) + offset);
|
||||
return (FAR void *)(((FAR uint8_t *)addr) + offset);
|
||||
}
|
||||
|
||||
+1
-1
@@ -196,7 +196,7 @@ int munmap(FAR void *start, size_t length)
|
||||
else
|
||||
{
|
||||
newaddr = kumm_realloc(curr->addr, sizeof(struct fs_rammap_s) + length);
|
||||
DEBUGASSERT(newaddr == (FAR void*)(curr->addr));
|
||||
DEBUGASSERT(newaddr == (FAR void *)(curr->addr));
|
||||
curr->length = length;
|
||||
}
|
||||
|
||||
|
||||
+14
-14
@@ -177,24 +177,24 @@ FAR void *rammap(int fd, size_t length, off_t offset)
|
||||
nread = read(fd, rdbuffer, length);
|
||||
if (nread < 0)
|
||||
{
|
||||
/* Handle the special case where the read was interrupted by a
|
||||
* signal.
|
||||
*/
|
||||
/* Handle the special case where the read was interrupted by a
|
||||
* signal.
|
||||
*/
|
||||
|
||||
err = get_errno();
|
||||
if (err != EINTR)
|
||||
{
|
||||
/* All other read errors are bad. errno is already set.
|
||||
* (but maybe should be forced to EINVAL?). NOTE that if
|
||||
* FS DEBUG is enabled, then the following fdbg() macro will
|
||||
* destroy the errno value.
|
||||
*/
|
||||
err = get_errno();
|
||||
if (err != EINTR)
|
||||
{
|
||||
/* All other read errors are bad. errno is already set.
|
||||
* (but maybe should be forced to EINVAL?). NOTE that if
|
||||
* FS DEBUG is enabled, then the following fdbg() macro will
|
||||
* destroy the errno value.
|
||||
*/
|
||||
|
||||
fdbg("Read failed: offset=%d errno=%d\n", (int)offset, err);
|
||||
fdbg("Read failed: offset=%d errno=%d\n", (int)offset, err);
|
||||
#ifdef CONFIG_DEBUG_FS
|
||||
goto errout_with_region;
|
||||
goto errout_with_region;
|
||||
#else
|
||||
goto errout_with_errno;
|
||||
goto errout_with_errno;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user