diff mbox series

[1/2] nfsd: Remove unnecessary assignment in nfs4xdr.c

Message ID 20200812141252.21059-1-alex.dewar90@gmail.com
State New
Headers show
Series [1/2] nfsd: Remove unnecessary assignment in nfs4xdr.c | expand

Commit Message

Alex Dewar Aug. 12, 2020, 2:12 p.m. UTC
In nfsd4_encode_listxattrs(), the variable p is assigned to at one point
but this value is never used before p is reassigned. Fix this.

Addresses-Coverity: ("Unused value")
Signed-off-by: Alex Dewar <alex.dewar90@gmail.com>
---
 fs/nfsd/nfs4xdr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Frank van der Linden Aug. 12, 2020, 8:36 p.m. UTC | #1
On Wed, Aug 12, 2020 at 03:12:51PM +0100, Alex Dewar wrote:
> 
> In nfsd4_encode_listxattrs(), the variable p is assigned to at one point
> but this value is never used before p is reassigned. Fix this.
> 
> Addresses-Coverity: ("Unused value")
> Signed-off-by: Alex Dewar <alex.dewar90@gmail.com>
> ---
>  fs/nfsd/nfs4xdr.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
> index 259d5ad0e3f47..1a0341fd80f9a 100644
> --- a/fs/nfsd/nfs4xdr.c
> +++ b/fs/nfsd/nfs4xdr.c
> @@ -4859,7 +4859,7 @@ nfsd4_encode_listxattrs(struct nfsd4_compoundres *resp, __be32 nfserr,
>                         goto out;
>                 }
> 
> -               p = xdr_encode_opaque(p, sp, slen);
> +               xdr_encode_opaque(p, sp, slen);
> 
>                 xdrleft -= xdrlen;
>                 count++;
> --
> 2.28.0
> 

Yep, I guess my linting missed that, thanks for the fix.

- Frank
Chuck Lever Aug. 13, 2020, 7:01 p.m. UTC | #2
> On Aug 12, 2020, at 4:36 PM, Frank van der Linden <fllinden@amazon.com> wrote:
> 
> On Wed, Aug 12, 2020 at 03:12:51PM +0100, Alex Dewar wrote:
>> 
>> In nfsd4_encode_listxattrs(), the variable p is assigned to at one point
>> but this value is never used before p is reassigned. Fix this.
>> 
>> Addresses-Coverity: ("Unused value")
>> Signed-off-by: Alex Dewar <alex.dewar90@gmail.com>
>> ---
>> fs/nfsd/nfs4xdr.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
>> index 259d5ad0e3f47..1a0341fd80f9a 100644
>> --- a/fs/nfsd/nfs4xdr.c
>> +++ b/fs/nfsd/nfs4xdr.c
>> @@ -4859,7 +4859,7 @@ nfsd4_encode_listxattrs(struct nfsd4_compoundres *resp, __be32 nfserr,
>>                        goto out;
>>                }
>> 
>> -               p = xdr_encode_opaque(p, sp, slen);
>> +               xdr_encode_opaque(p, sp, slen);
>> 
>>                xdrleft -= xdrlen;
>>                count++;
>> --
>> 2.28.0
>> 
> 
> Yep, I guess my linting missed that, thanks for the fix.

Bruce, these two don't appear to be urgent, so I'm deferring them
to you for v5.10.


--
Chuck Lever
Alex Dewar Aug. 20, 2020, 11:37 p.m. UTC | #3
On Wed, Aug 12, 2020 at 08:36:31PM +0000, Frank van der Linden wrote:
> On Wed, Aug 12, 2020 at 03:12:51PM +0100, Alex Dewar wrote:
> > 
> > In nfsd4_encode_listxattrs(), the variable p is assigned to at one point
> > but this value is never used before p is reassigned. Fix this.
> > 
> > Addresses-Coverity: ("Unused value")
> > Signed-off-by: Alex Dewar <alex.dewar90@gmail.com>
> > ---
> >  fs/nfsd/nfs4xdr.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
> > index 259d5ad0e3f47..1a0341fd80f9a 100644
> > --- a/fs/nfsd/nfs4xdr.c
> > +++ b/fs/nfsd/nfs4xdr.c
> > @@ -4859,7 +4859,7 @@ nfsd4_encode_listxattrs(struct nfsd4_compoundres *resp, __be32 nfserr,
> >                         goto out;
> >                 }
> > 
> > -               p = xdr_encode_opaque(p, sp, slen);
> > +               xdr_encode_opaque(p, sp, slen);
> > 
> >                 xdrleft -= xdrlen;
> >                 count++;
> > --
> > 2.28.0
> > 
> 
> Yep, I guess my linting missed that, thanks for the fix.
> 
> - Frank

Ping? The second patch in this series had a mistake in it, but I think
this one's still good to go :-)
J. Bruce Fields Aug. 26, 2020, 8:09 p.m. UTC | #4
On Fri, Aug 21, 2020 at 12:37:45AM +0100, Alex Dewar wrote:
> On Wed, Aug 12, 2020 at 08:36:31PM +0000, Frank van der Linden wrote:
> > On Wed, Aug 12, 2020 at 03:12:51PM +0100, Alex Dewar wrote:
> > > 
> > > In nfsd4_encode_listxattrs(), the variable p is assigned to at one point
> > > but this value is never used before p is reassigned. Fix this.
> > > 
> > > Addresses-Coverity: ("Unused value")
> > > Signed-off-by: Alex Dewar <alex.dewar90@gmail.com>
> > > ---
> > >  fs/nfsd/nfs4xdr.c | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > 
> > > diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
> > > index 259d5ad0e3f47..1a0341fd80f9a 100644
> > > --- a/fs/nfsd/nfs4xdr.c
> > > +++ b/fs/nfsd/nfs4xdr.c
> > > @@ -4859,7 +4859,7 @@ nfsd4_encode_listxattrs(struct nfsd4_compoundres *resp, __be32 nfserr,
> > >                         goto out;
> > >                 }
> > > 
> > > -               p = xdr_encode_opaque(p, sp, slen);
> > > +               xdr_encode_opaque(p, sp, slen);
> > > 
> > >                 xdrleft -= xdrlen;
> > >                 count++;
> > > --
> > > 2.28.0
> > > 
> > 
> > Yep, I guess my linting missed that, thanks for the fix.
> > 
> > - Frank
> 
> Ping? The second patch in this series had a mistake in it, but I think
> this one's still good to go :-)

Thanks, applied for 5.10.--b.
diff mbox series

Patch

diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
index 259d5ad0e3f47..1a0341fd80f9a 100644
--- a/fs/nfsd/nfs4xdr.c
+++ b/fs/nfsd/nfs4xdr.c
@@ -4859,7 +4859,7 @@  nfsd4_encode_listxattrs(struct nfsd4_compoundres *resp, __be32 nfserr,
 			goto out;
 		}
 
-		p = xdr_encode_opaque(p, sp, slen);
+		xdr_encode_opaque(p, sp, slen);
 
 		xdrleft -= xdrlen;
 		count++;