[PATCH net-next] crush: fix using plain integer as NULL warning

Subsystems: ceph common code (libceph), the rest

STALE2922d

2 messages, 2 authors, 2018-08-10 · open the first message on its own page

[PATCH net-next] crush: fix using plain integer as NULL warning

From: YueHaibing <hidden>
Date: 2018-08-08 11:53:26

Fixes the following sparse warning:
net/ceph/crush/mapper.c:517:76: warning: Using plain integer as NULL pointer
net/ceph/crush/mapper.c:728:68: warning: Using plain integer as NULL pointer

Signed-off-by: YueHaibing <redacted>
---
 net/ceph/crush/mapper.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/ceph/crush/mapper.c b/net/ceph/crush/mapper.c
index 417df67..3f323ed 100644
--- a/net/ceph/crush/mapper.c
+++ b/net/ceph/crush/mapper.c
@@ -514,7 +514,7 @@ static int crush_choose_firstn(const struct crush_map *map,
 						in, work->work[-1-in->id],
 						x, r,
 						(choose_args ?
-						 &choose_args[-1-in->id] : 0),
+						 &choose_args[-1-in->id] : NULL),
 						outpos);
 				if (item >= map->max_devices) {
 					dprintk("   bad item %d\n", item);
@@ -725,7 +725,7 @@ static void crush_choose_indep(const struct crush_map *map,
 					in, work->work[-1-in->id],
 					x, r,
 					(choose_args ?
-					 &choose_args[-1-in->id] : 0),
+					 &choose_args[-1-in->id] : NULL),
 					outpos);
 				if (item >= map->max_devices) {
 					dprintk("   bad item %d\n", item);
-- 
2.7.0

Re: [PATCH net-next] crush: fix using plain integer as NULL warning

From: Ilya Dryomov <idryomov@gmail.com>
Date: 2018-08-10 10:59:58

On Wed, Aug 8, 2018 at 1:53 PM YueHaibing [off-list ref] wrote:
quoted hunk
Fixes the following sparse warning:
net/ceph/crush/mapper.c:517:76: warning: Using plain integer as NULL pointer
net/ceph/crush/mapper.c:728:68: warning: Using plain integer as NULL pointer

Signed-off-by: YueHaibing <redacted>
---
 net/ceph/crush/mapper.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/ceph/crush/mapper.c b/net/ceph/crush/mapper.c
index 417df67..3f323ed 100644
--- a/net/ceph/crush/mapper.c
+++ b/net/ceph/crush/mapper.c
@@ -514,7 +514,7 @@ static int crush_choose_firstn(const struct crush_map *map,
                                                in, work->work[-1-in->id],
                                                x, r,
                                                (choose_args ?
-                                                &choose_args[-1-in->id] : 0),
+                                                &choose_args[-1-in->id] : NULL),
                                                outpos);
                                if (item >= map->max_devices) {
                                        dprintk("   bad item %d\n", item);
@@ -725,7 +725,7 @@ static void crush_choose_indep(const struct crush_map *map,
                                        in, work->work[-1-in->id],
                                        x, r,
                                        (choose_args ?
-                                        &choose_args[-1-in->id] : 0),
+                                        &choose_args[-1-in->id] : NULL),
                                        outpos);
                                if (item >= map->max_devices) {
                                        dprintk("   bad item %d\n", item);
Applied.

Thanks,

                Ilya
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help