Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1503100 > unrolled thread

[PATCH] nfs4: fix missing-braces warning

Started byArnd Bergmann <arnd@arndb.de>
First post2016-10-18 17:30 +0200
Last post2016-10-19 21:00 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] nfs4: fix missing-braces warning Arnd Bergmann <arnd@arndb.de> - 2016-10-18 17:30 +0200
    Re: [PATCH] nfs4: fix missing-braces warning Anna Schumaker <Anna.Schumaker@netapp.com> - 2016-10-19 21:00 +0200

#1503100 — [PATCH] nfs4: fix missing-braces warning

FromArnd Bergmann <arnd@arndb.de>
Date2016-10-18 17:30 +0200
Subject[PATCH] nfs4: fix missing-braces warning
Message-ID<stEuZ-3xx-11@gated-at.bofh.it>
A bugfix introduced a harmless warning for update_open_stateid:

fs/nfs/nfs4proc.c:1548:2: error: missing braces around initializer [-Werror=missing-braces]

Removing the zero in the initializer will do the right thing here
and initialize the entire structure to zero.

Fixes: 1393d9612ba0 ("NFSv4: Fix a race when updating an open_stateid")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 fs/nfs/nfs4proc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index ad917bd72b38..7897826d7c51 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -1545,7 +1545,7 @@ static int update_open_stateid(struct nfs4_state *state,
 	struct nfs_client *clp = server->nfs_client;
 	struct nfs_inode *nfsi = NFS_I(state->inode);
 	struct nfs_delegation *deleg_cur;
-	nfs4_stateid freeme = {0};
+	nfs4_stateid freeme = { };
 	int ret = 0;
 
 	fmode &= (FMODE_READ|FMODE_WRITE);
-- 
2.9.0

[toc] | [next] | [standalone]


#1504257

FromAnna Schumaker <Anna.Schumaker@netapp.com>
Date2016-10-19 21:00 +0200
Message-ID<su4fL-5aV-7@gated-at.bofh.it>
In reply to#1503100
Hi Arnd (and Geert, if you're out there. I keep getting "relay access denied" when I try to CC you),

Thanks for the patches for this issue!  I've applied Arnd's version for 4.9-rc* since I think it looks a little cleaner.

Cheers,
Anna


On 10/18/2016 11:21 AM, Arnd Bergmann wrote:
> A bugfix introduced a harmless warning for update_open_stateid:
> 
> fs/nfs/nfs4proc.c:1548:2: error: missing braces around initializer [-Werror=missing-braces]
> 
> Removing the zero in the initializer will do the right thing here
> and initialize the entire structure to zero.
> 
> Fixes: 1393d9612ba0 ("NFSv4: Fix a race when updating an open_stateid")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  fs/nfs/nfs4proc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
> index ad917bd72b38..7897826d7c51 100644
> --- a/fs/nfs/nfs4proc.c
> +++ b/fs/nfs/nfs4proc.c
> @@ -1545,7 +1545,7 @@ static int update_open_stateid(struct nfs4_state *state,
>  	struct nfs_client *clp = server->nfs_client;
>  	struct nfs_inode *nfsi = NFS_I(state->inode);
>  	struct nfs_delegation *deleg_cur;
> -	nfs4_stateid freeme = {0};
> +	nfs4_stateid freeme = { };
>  	int ret = 0;
>  
>  	fmode &= (FMODE_READ|FMODE_WRITE);
> 

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web