Skip to contentSkip to conversation

staging: lustre: Fix sparse, using plain integer as NULL pointer in lov_object_fiemap()

PATCH In review Andrii Vladyka 4 participants 6 messages Nov 30, 2017 – Dec 7, 2017 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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

drivers/staging/lustre/lustre/lov/lov_object.c +1 -1
index 105b707..897cf2c 100644
@@ -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)
#2 lore raw

PATCH 1/1 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

---

drivers/staging/lustre/lustre/lov/lov_object.c +1 -1
index 105b707..897cf2c 100644
@@ -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)
#3 lore raw
Quoted 12 lines · Andrii Vladyka

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

---

drivers/staging/lustre/lustre/lov/lov_object.c +0 -0
index 105b707..897cf2c 100644

drivers/staging/lustre/lustre/lov/lov_object.c static int lov_object_fiemap(const struct lu_env *env, struct cl_object *obj, · line 1340

Quoted 7 lines
drivers/staging/lustre/lustre/lov/lov_object.c +1 -1
@@ -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

author
#4 lore raw

PATCH 1/1 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

drivers/staging/lustre/lustre/lov/lov_object.c +1 -1
index 105b707..897cf2c 100644
@@ -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)
#5 lore raw
In reply to [email protected]
Quoted 8 lines · gregkh at linuxfoundation.org
Quoted 7 lines · Andrii Vladyka

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

---

Quoted 15 lines

drivers/staging/lustre/lustre/lov/lov_object.c static int lov_object_fiemap(const struct lu_env *env, struct cl_object *obj, · line 1340

Quoted 12 lines
drivers/staging/lustre/lustre/lov/lov_object.c +1 -1
index 105b707..897cf2c 100644
@@ -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.