From patchwork Wed Mar 27 23:50:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 10874357 X-Patchwork-Delegate: jgg@ziepe.ca Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5EA1014DE for ; Wed, 27 Mar 2019 23:51:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4A80928BED for ; Wed, 27 Mar 2019 23:51:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3E5E728CF7; Wed, 27 Mar 2019 23:51:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4E19C28BED for ; Wed, 27 Mar 2019 23:51:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727839AbfC0XvG (ORCPT ); Wed, 27 Mar 2019 19:51:06 -0400 Received: from mail-pl1-f194.google.com ([209.85.214.194]:33764 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725948AbfC0XvG (ORCPT ); Wed, 27 Mar 2019 19:51:06 -0400 Received: by mail-pl1-f194.google.com with SMTP id bg8so4049486plb.0 for ; Wed, 27 Mar 2019 16:51:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=C02o4mFU0+HvhOaPe0F7x8yGDr9uMjtqSi9pqCDJpag=; b=YLVwLFRlJqU05JEKRhpu9BtvyI7hKQtcfpkuTP53mwmywi3IBxsNrVm9qdL34KEj6E jwdJtvYd9vNr0LGvipdAA5fSVkR092HOWXaMkLkmpKg/R+gkn0pHm8hKjVKK9Vxl5+js Zl4ROOLqZiAyotLpNSE1R2ftT9QQOm9vO9zxD6WTkr3oU6xuBYicD3z2YEx43tPnLDlu KsSglwiNwCb+jQz2cjXeXQpLeRHa5rUxhFKc7mokl/PBLN9nzCOQkwf6wLC3dtJQVoBA h5ZcWJaWpfBJp3wC8p4ZsojpzeXmq9fbu5tEbh2fb/e9oGaCNipMd5vZmmZ9c/FietI5 EaDw== X-Gm-Message-State: APjAAAWAnU9Z/NzIzFHEkS95oZfjibL52hMyusWNXAlVc0Y7e9PMNSLN ia0fuMf+ZLenYnZn3uLYJIY= X-Google-Smtp-Source: APXvYqxnB9J/AqewvzJKlCfkkD7Xfm0Pbk8abeBAHYhk87vbfLukfHJA3fgAQTZ/dryXdked2Zvecg== X-Received: by 2002:a17:902:765:: with SMTP id 92mr38354475pli.95.1553730665793; Wed, 27 Mar 2019 16:51:05 -0700 (PDT) Received: from desktop-bart.svl.corp.google.com ([2620:15c:2cd:203:5cdc:422c:7b28:ebb5]) by smtp.gmail.com with ESMTPSA id a3sm16493115pfn.182.2019.03.27.16.51.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 27 Mar 2019 16:51:04 -0700 (PDT) From: Bart Van Assche To: Jason Gunthorpe Cc: Leon Romanovsky , Doug Ledford , linux-rdma@vger.kernel.org, Bart Van Assche Subject: [PATCH v2 2/7] RDMA/uverbs: Annotate uverbs_request_next_ptr() return value as a __user pointer Date: Wed, 27 Mar 2019 16:50:46 -0700 Message-Id: <20190327235051.67361-3-bvanassche@acm.org> X-Mailer: git-send-email 2.20.GIT In-Reply-To: <20190327235051.67361-1-bvanassche@acm.org> References: <20190327235051.67361-1-bvanassche@acm.org> MIME-Version: 1.0 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch avoids that sparse complains about a mismatch between the returned value and the function return type. Reviewed-by: Leon Romanovsky Cc: Doug Ledford Fixes: c3bea3d2dc53 ("RDMA/uverbs: Use the iterator for ib_uverbs_unmarshall_recv()") # v5.0. Signed-off-by: Bart Van Assche --- drivers/infiniband/core/uverbs_cmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; }