linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] crush: fix using plain integer as NULL warning
@ 2018-08-08 11:52 YueHaibing
  2018-08-10 10:59 ` Ilya Dryomov
  0 siblings, 1 reply; 2+ messages in thread
From: YueHaibing @ 2018-08-08 11:52 UTC (permalink / raw)
  To: davem, idryomov; +Cc: linux-kernel, netdev, zyan, sage, ceph-devel, YueHaibing

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 <yuehaibing@huawei.com>
---
 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



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net-next] crush: fix using plain integer as NULL warning
  2018-08-08 11:52 [PATCH net-next] crush: fix using plain integer as NULL warning YueHaibing
@ 2018-08-10 10:59 ` Ilya Dryomov
  0 siblings, 0 replies; 2+ messages in thread
From: Ilya Dryomov @ 2018-08-10 10:59 UTC (permalink / raw)
  To: yuehaibing
  Cc: David S. Miller, linux-kernel, netdev, Yan, Zheng, Sage Weil,
	Ceph Development

On Wed, Aug 8, 2018 at 1:53 PM YueHaibing <yuehaibing@huawei.com> wrote:
>
> 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 <yuehaibing@huawei.com>
> ---
>  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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-08-10 10:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-08 11:52 [PATCH net-next] crush: fix using plain integer as NULL warning YueHaibing
2018-08-10 10:59 ` Ilya Dryomov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).