You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by ag...@apache.org on 2020/03/07 16:50:11 UTC
[incubator-nuttx] branch master updated (faca2f2 -> ae060e1)
This is an automated email from the ASF dual-hosted git repository.
aguettouche pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git.
from faca2f2 z20x: Timer/Spi Fixes
new 9836d17 nfs: fix warning: 'byteswritten' may be used uninitialized
new ae060e1 fs/nfs/nfs_vfsops.c: Run nxstyle against the file.
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
fs/nfs/nfs_vfsops.c | 35 ++++++++++++++++++++++-------------
1 file changed, 22 insertions(+), 13 deletions(-)
[incubator-nuttx] 02/02: fs/nfs/nfs_vfsops.c: Run nxstyle against
the file.
Posted by ag...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
aguettouche pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
commit ae060e1d9827cbaba204fd2fa42e6e3af8fd2052
Author: Ouss4 <ab...@gmail.com>
AuthorDate: Sat Mar 7 17:43:40 2020 +0000
fs/nfs/nfs_vfsops.c: Run nxstyle against the file.
---
fs/nfs/nfs_vfsops.c | 33 +++++++++++++++++++++------------
1 file changed, 21 insertions(+), 12 deletions(-)
diff --git a/fs/nfs/nfs_vfsops.c b/fs/nfs/nfs_vfsops.c
index 318494c..3c3c6a1 100644
--- a/fs/nfs/nfs_vfsops.c
+++ b/fs/nfs/nfs_vfsops.c
@@ -122,7 +122,8 @@ static int nfs_fileopen(FAR struct nfsmount *nmp,
static int nfs_open(FAR struct file *filep, FAR const char *relpath,
int oflags, mode_t mode);
static int nfs_close(FAR struct file *filep);
-static ssize_t nfs_read(FAR struct file *filep, FAR char *buffer, size_t buflen);
+static ssize_t nfs_read(FAR struct file *filep, FAR char *buffer,
+ size_t buflen);
static ssize_t nfs_write(FAR struct file *filep, FAR const char *buffer,
size_t buflen);
static int nfs_dup(FAR const struct file *oldp, FAR struct file *newp);
@@ -131,7 +132,8 @@ static int nfs_fstat(FAR const struct file *filep, FAR struct stat *buf);
static int nfs_truncate(FAR struct file *filep, off_t length);
static int nfs_opendir(FAR struct inode *mountpt, FAR const char *relpath,
FAR struct fs_dirent_s *dir);
-static int nfs_readdir(FAR struct inode *mountpt, FAR struct fs_dirent_s *dir);
+static int nfs_readdir(FAR struct inode *mountpt,
+ FAR struct fs_dirent_s *dir);
static int nfs_rewinddir(FAR struct inode *mountpt,
FAR struct fs_dirent_s *dir);
static void nfs_decode_args(FAR struct nfs_mount_parameters *nprmt,
@@ -611,9 +613,9 @@ static int nfs_open(FAR struct file *filep, FAR const char *relpath,
goto errout_with_semaphore;
}
- /* The file does not exist. Check if we were asked to create the file. If
- * the O_CREAT bit is set in the oflags then we should create the file if it
- * does not exist.
+ /* The file does not exist. Check if we were asked to create the file.
+ * If the O_CREAT bit is set in the oflags then we should create the
+ * file if it does not exist.
*/
if ((oflags & O_CREAT) == 0)
@@ -647,9 +649,9 @@ static int nfs_open(FAR struct file *filep, FAR const char *relpath,
filep->f_priv = np;
/* Then insert the new instance at the head of the list in the mountpoint
- * structure. It needs to be there (1) to handle error conditions that effect
- * all files, and (2) to inform the umount logic that we are busy. We
- * cannot unmount the file system if this list is not empty!
+ * structure. It needs to be there (1) to handle error conditions that
+ * effect all files, and (2) to inform the umount logic that we are busy.
+ * We cannot unmount the file system if this list is not empty!
*/
np->n_next = nmp->nm_head;
@@ -771,7 +773,8 @@ static int nfs_close(FAR struct file *filep)
*
****************************************************************************/
-static ssize_t nfs_read(FAR struct file *filep, FAR char *buffer, size_t buflen)
+static ssize_t nfs_read(FAR struct file *filep, FAR char *buffer,
+ size_t buflen)
{
FAR struct nfsmount *nmp;
FAR struct nfsnode *np;
@@ -1562,7 +1565,8 @@ errout_with_semaphore:
*
****************************************************************************/
-static int nfs_rewinddir(FAR struct inode *mountpt, FAR struct fs_dirent_s *dir)
+static int nfs_rewinddir(FAR struct inode *mountpt,
+ FAR struct fs_dirent_s *dir)
{
finfo("Entry\n");
@@ -1873,6 +1877,7 @@ static int nfs_bind(FAR struct inode *blkdriver, FAR const void *data,
return OK;
bad:
+
/* Disconnect from the server */
if (nmp->nm_rpcclnt)
@@ -2003,6 +2008,7 @@ static int nfs_fsinfo(FAR struct nfsmount *nmp)
{
nmp->nm_rsize = (pref + NFS_FABLKSIZE - 1) & ~(NFS_FABLKSIZE - 1);
}
+
if (max < nmp->nm_rsize)
{
nmp->nm_rsize = max & ~(NFS_FABLKSIZE - 1);
@@ -2020,6 +2026,7 @@ static int nfs_fsinfo(FAR struct nfsmount *nmp)
{
nmp->nm_wsize = (pref + NFS_FABLKSIZE - 1) & ~(NFS_FABLKSIZE - 1);
}
+
if (max < nmp->nm_wsize)
{
nmp->nm_wsize = max & ~(NFS_FABLKSIZE - 1);
@@ -2032,7 +2039,8 @@ static int nfs_fsinfo(FAR struct nfsmount *nmp)
pref = fxdr_unsigned(uint32_t, *ptr++);
if (pref < nmp->nm_readdirsize)
{
- nmp->nm_readdirsize = (pref + NFS_DIRBLKSIZ - 1) & ~(NFS_DIRBLKSIZ - 1);
+ nmp->nm_readdirsize = (pref + NFS_DIRBLKSIZ - 1) &
+ ~(NFS_DIRBLKSIZ - 1);
}
/* Get the file attributes if needed */
@@ -2208,7 +2216,8 @@ errout_with_semaphore:
*
****************************************************************************/
-static int nfs_mkdir(FAR struct inode *mountpt, FAR const char *relpath, mode_t mode)
+static int nfs_mkdir(FAR struct inode *mountpt, FAR const char *relpath,
+ mode_t mode)
{
FAR struct nfsmount *nmp;
struct file_handle fhandle;
[incubator-nuttx] 01/02: nfs: fix warning: 'byteswritten' may be
used uninitialized
Posted by ag...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
aguettouche pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
commit 9836d17f3f7280911f091ae265163fb06218d35d
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Sat Mar 7 23:00:14 2020 +0800
nfs: fix warning: 'byteswritten' may be used uninitialized
---
fs/nfs/nfs_vfsops.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/nfs/nfs_vfsops.c b/fs/nfs/nfs_vfsops.c
index f3f0eed..318494c 100644
--- a/fs/nfs/nfs_vfsops.c
+++ b/fs/nfs/nfs_vfsops.c
@@ -939,7 +939,7 @@ static ssize_t nfs_write(FAR struct file *filep, FAR const char *buffer,
FAR struct nfsnode *np;
ssize_t writesize;
ssize_t bufsize;
- ssize_t byteswritten;
+ ssize_t byteswritten = 0;
size_t reqlen;
FAR uint32_t *ptr;
uint32_t tmp;