2017-12-04 08:20:38

by Dilger, Andreas

[permalink] [raw]
Subject: Re: [PATCH] staging: lustre: Fix sparse, using plain integer as NULL pointer in lov_object_fiemap()


> On Nov 30, 2017, at 11:30, Andrii Vladyka <[email protected]> wrote:
>
> Change 0 to NULL in lov_object_fiemap() in order to fix warning produced by sparse
>
> Signed-off-by: Andrii Vladyka <[email protected]>

Patches should be inline rather than in an attachment.

That said, the patch looks correct, so you can add:

Signed-off-by: Andreas Dilger <[email protected]>

Cheers, Andreas
--
Andreas Dilger
Lustre Principal Architect
Intel Corporation








2017-12-04 10:44:45

by Andrii Vladyka

[permalink] [raw]
Subject: [PATCH] staging: lustre: Fix sparse, using plain integer as NULL pointer in lov_object_fiemap()

Change 0 to NULL in lov_object_fiemap() in order to fix warning produced
by sparse

Signed-off-by: Andrii Vladyka <[email protected]>
Signed-off-by: Andreas Dilger <[email protected]>
---

diff --git a/drivers/staging/lustre/lustre/lov/lov_object.c b/drivers/staging/lustre/lustre/lov/lov_object.c
index 105b707..897cf2c 100644
--- a/drivers/staging/lustre/lustre/lov/lov_object.c
+++ b/drivers/staging/lustre/lustre/lov/lov_object.c
@@ -1335,7 +1335,7 @@ static int lov_object_fiemap(const struct lu_env *env, struct cl_object *obj,
int rc = 0;
int cur_stripe;
int stripe_count;
- struct fiemap_state fs = { 0 };
+ struct fiemap_state fs = { NULL };

lsm = lov_lsm_addref(cl2lov(obj));
if (!lsm)

2017-12-06 08:53:02

by Greg KH

[permalink] [raw]
Subject: Re: [PATCH] staging: lustre: Fix sparse, using plain integer as NULL pointer in lov_object_fiemap()

On Mon, Dec 04, 2017 at 12:44:32PM +0200, Andrii Vladyka wrote:
> Change 0 to NULL in lov_object_fiemap() in order to fix warning produced by
> sparse
>
> Signed-off-by: Andrii Vladyka <[email protected]>
> Signed-off-by: Andreas Dilger <[email protected]>
> ---
>
> diff --git a/drivers/staging/lustre/lustre/lov/lov_object.c b/drivers/staging/lustre/lustre/lov/lov_object.c
> index 105b707..897cf2c 100644
> --- a/drivers/staging/lustre/lustre/lov/lov_object.c
> +++ b/drivers/staging/lustre/lustre/lov/lov_object.c
> @@ -1335,7 +1335,7 @@ static int lov_object_fiemap(const struct lu_env *env, struct cl_object *obj,
> int rc = 0;
> int cur_stripe;
> int stripe_count;
> - struct fiemap_state fs = { 0 };
> + struct fiemap_state fs = { NULL };
> lsm = lov_lsm_addref(cl2lov(obj));
> if (!lsm)

Patch is corrupted, and can not apply, please fix up your email client
and try it again.

greg k-h

2017-12-06 09:33:49

by Andrii Vladyka

[permalink] [raw]
Subject: [PATCH] staging: lustre: Fix sparse, using plain integer as NULL pointer in lov_object_fiemap()

Change 0 to NULL in lov_object_fiemap() in order to fix warning produced by
sparse

Signed-off-by: Andrii Vladyka <[email protected]>
Signed-off-by: Andreas Dilger <[email protected]>



Attachments:
task16.patch (519.00 B)

2017-12-07 17:24:58

by Joe Perches

[permalink] [raw]
Subject: Re: [PATCH] staging: lustre: Fix sparse, using plain integer as NULL pointer in lov_object_fiemap()

On Wed, 2017-12-06 at 09:53 +0100, [email protected] wrote:
> On Mon, Dec 04, 2017 at 12:44:32PM +0200, Andrii Vladyka wrote:
> > Change 0 to NULL in lov_object_fiemap() in order to fix warning produced by
> > sparse
> >
> > Signed-off-by: Andrii Vladyka <[email protected]>
> > Signed-off-by: Andreas Dilger <[email protected]>
> > ---
> >
> > diff --git a/drivers/staging/lustre/lustre/lov/lov_object.c b/drivers/staging/lustre/lustre/lov/lov_object.c
> > index 105b707..897cf2c 100644
> > --- a/drivers/staging/lustre/lustre/lov/lov_object.c
> > +++ b/drivers/staging/lustre/lustre/lov/lov_object.c
> > @@ -1335,7 +1335,7 @@ static int lov_object_fiemap(const struct lu_env *env, struct cl_object *obj,
> > int rc = 0;
> > int cur_stripe;
> > int stripe_count;
> > - struct fiemap_state fs = { 0 };
> > + struct fiemap_state fs = { NULL };
> > lsm = lov_lsm_addref(cl2lov(obj));
> > if (!lsm)
>
> Patch is corrupted, and can not apply, please fix up your email client
> and try it again.

It would be better to use {} to clear the struct
rather than any member initialization.