From 12f727721eee61b3d19dedb95cb893b2baa9fe41 Mon Sep 17 00:00:00 2001 From: Arnd Bergmann Date: Wed, 6 Sep 2017 23:34:25 +0200 Subject: IB/uverbs: clean up INIT_UDATA_BUF_OR_NULL usage We get a harmless warning about the fact that we use the result of a multiplication as a condition: drivers/infiniband/core/uverbs_main.c: In function 'ib_uverbs_write': drivers/infiniband/core/uverbs_main.c:787:40: error: '*' in boolean context, suggest '&&' instead [-Werror=int-in-bool-context] drivers/infiniband/core/uverbs_main.c:787:117: error: '*' in boolean context, suggest '&&' instead [-Werror=int-in-bool-context] drivers/infiniband/core/uverbs_main.c:790:50: error: '*' in boolean context, suggest '&&' instead [-Werror=int-in-bool-context] drivers/infiniband/core/uverbs_main.c:790:151: error: '*' in boolean context, suggest '&&' instead [-Werror=int-in-bool-context] This avoids the problem by using an inline function in place of the macro. Fixes: a96e4e2ffe43 ("IB/uverbs: New macro to set pointers to NULL if length is 0 in INIT_UDATA()") Suggested-by: Christoph Hellwig Link: https://patchwork.kernel.org/patch/9940777/ Signed-off-by: Arnd Bergmann Signed-off-by: Doug Ledford --- drivers/infiniband/core/uverbs_std_types.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'drivers/infiniband/core/uverbs_std_types.c') diff --git a/drivers/infiniband/core/uverbs_std_types.c b/drivers/infiniband/core/uverbs_std_types.c index 0a98579700ec..b095bce7f238 100644 --- a/drivers/infiniband/core/uverbs_std_types.c +++ b/drivers/infiniband/core/uverbs_std_types.c @@ -246,7 +246,8 @@ static void create_udata(struct uverbs_attr_bundle *ctx, outbuf_len = uhw_out->ptr_attr.len; } - INIT_UDATA_BUF_OR_NULL(udata, inbuf, outbuf, inbuf_len, outbuf_len); + ib_uverbs_init_udata_buf_or_null(udata, inbuf, outbuf, inbuf_len, + outbuf_len); } static int uverbs_create_cq_handler(struct ib_device *ib_dev, -- cgit v1.2.3-59-g8ed1b