Message ID | 20190321172417.77869-3-bvanassche@acm.org (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | Multiple fixes for issues reported by static checkers | expand |
On Thu, Mar 21, 2019 at 10:24:11AM -0700, Bart Van Assche wrote: > This patch avoids that sparse complains about a mismatch between the returned > value and the function return type. > > Cc: Leon Romanovsky <leonro@mellanox.com> > Cc: Doug Ledford <dledford@redhat.com> > Fixes: c3bea3d2dc53 ("RDMA/uverbs: Use the iterator for ib_uverbs_unmarshall_recv()") # v5.0. > Signed-off-by: Bart Van Assche <bvanassche@acm.org> > --- > drivers/infiniband/core/uverbs_cmd.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > Thanks, Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
diff --git a/drivers/infiniband/core/uverbs_cmd.c b/drivers/infiniband/core/uverbs_cmd.c index 062a86c04123..c9acd94b049d 100644 --- a/drivers/infiniband/core/uverbs_cmd.c +++ b/drivers/infiniband/core/uverbs_cmd.c @@ -162,7 +162,7 @@ static const void __user *uverbs_request_next_ptr(struct uverbs_req_iter *iter, const void __user *res = iter->cur; if (iter->cur + len > iter->end) - return ERR_PTR(-ENOSPC); + return (void __force __user *)ERR_PTR(-ENOSPC); iter->cur += len; return res; }
This patch avoids that sparse complains about a mismatch between the returned value and the function return type. Cc: Leon Romanovsky <leonro@mellanox.com> Cc: Doug Ledford <dledford@redhat.com> Fixes: c3bea3d2dc53 ("RDMA/uverbs: Use the iterator for ib_uverbs_unmarshall_recv()") # v5.0. Signed-off-by: Bart Van Assche <bvanassche@acm.org> --- drivers/infiniband/core/uverbs_cmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)