Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp135282pxf; Wed, 31 Mar 2021 19:14:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzmL15YUJHg1TFbBMipeBFqmusZ9Z8BSAF0qD1BoNR9eL9Dzo7JbZNK+liP4dmUxLNiX1JK X-Received: by 2002:a17:906:b7d5:: with SMTP id fy21mr6806582ejb.153.1617243263605; Wed, 31 Mar 2021 19:14:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617243263; cv=none; d=google.com; s=arc-20160816; b=wKspeuh5jDhWGjlKPVD4gxpOwlBjhB7INsVgN0bqqiBNM9QxlPsRDW2y/e/I8IXSKS 0acF8GnyQzK2bimHz132Yc7R8pIxkUZJe5+oyWHXM3aLM7Sz2bKnxiqwNpY6vHrqr+Jg O/+TedKsTy1P0s2y10bICnkUzHvzg9qtAEiqbd6NNFMmo7GVt4TDZIvttuixfKPCFUV0 hGFU6O5DOO+aUIWc237OyTc2TvvdbzbZmvEtg3C0vMU/IgCp5r1ZDtceuVaEcs/P8qRr n3ds3QFVtll1nWUc9IuD0p4bDiYR81h04qrmK/gAAKluI6HsCO0IyioJ7C3Rr7RPOywT okgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=hvhkoQefKcE3WNMRoJQnDwgkEt7pPZOfibvdMiwVI7A=; b=lCDsQe2mHNaNPzfkKjeccHFMCawSDGgH+du8I6dJ0XJwqhxQtdOohC6Wb2MMxBHz9F VRPWSC48QQxtXQ+vtkCHPWLmZ59Ixm9GJgQOHfd6vkFfqQ05+r71lpHs+uSm2Xi4X/ny RotXFrxKiKlonwYHu7/DHg7i/8O2DVVo3fP2k8b4TFEqOM4jflki3drTRb1icQ6mOF0u eyOcg5nPqk/ljNLhScpX4oGA9CgaIYSwoMZOItCIhQxVQVM4OaJxuzFLxmhyYcNU3cH/ UOqke23unkx3lu+E5Qj5IQlm2rU9Tat9xUneY1EApq9zpdXzanq7WUhJ/ES4PkHt+siy OI+g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b14si3271348ede.310.2021.03.31.19.14.00; Wed, 31 Mar 2021 19:14:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232565AbhDACLM (ORCPT + 99 others); Wed, 31 Mar 2021 22:11:12 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:15838 "EHLO szxga07-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232271AbhDACLC (ORCPT ); Wed, 31 Mar 2021 22:11:02 -0400 Received: from DGGEMS410-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4F9mnY2tk6z93hs; Thu, 1 Apr 2021 10:08:49 +0800 (CST) Received: from localhost (10.174.179.96) by DGGEMS410-HUB.china.huawei.com (10.3.19.210) with Microsoft SMTP Server id 14.3.498.0; Thu, 1 Apr 2021 10:10:46 +0800 From: YueHaibing To: , CC: , , YueHaibing Subject: [PATCH -next] RDMA/uverbs: Fix -Wunused-function warning Date: Thu, 1 Apr 2021 10:10:28 +0800 Message-ID: <20210401021028.25720-1-yuehaibing@huawei.com> X-Mailer: git-send-email 2.10.2.windows.1 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.174.179.96] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org make W=1 warns this: In file included from drivers/infiniband/sw/rdmavt/mmap.c:51:0: ./include/rdma/uverbs_ioctl.h:937:1: warning: ‘_uverbs_get_const_unsigned’ defined but not used [-Wunused-function] _uverbs_get_const_unsigned(u64 *to, ^~~~~~~~~~~~~~~~~~~~~~~~~~ ./include/rdma/uverbs_ioctl.h:930:1: warning: ‘_uverbs_get_const_signed’ defined but not used [-Wunused-function] _uverbs_get_const_signed(s64 *to, const struct uverbs_attr_bundle *attrs_bundle, ^~~~~~~~~~~~~~~~~~~~~~~~ Make these functions inline to fix this warnings. Signed-off-by: YueHaibing --- include/rdma/uverbs_ioctl.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/include/rdma/uverbs_ioctl.h b/include/rdma/uverbs_ioctl.h index 3829b6ef4bb6..23bb404aba12 100644 --- a/include/rdma/uverbs_ioctl.h +++ b/include/rdma/uverbs_ioctl.h @@ -926,14 +926,15 @@ uverbs_copy_to_struct_or_zero(const struct uverbs_attr_bundle *bundle, { return -EINVAL; } -static int -_uverbs_get_const_signed(s64 *to, const struct uverbs_attr_bundle *attrs_bundle, +static inline int +_uverbs_get_const_signed(s64 *to, + const struct uverbs_attr_bundle *attrs_bundle, size_t idx, s64 lower_bound, u64 upper_bound, s64 *def_val) { return -EINVAL; } -static int +static inline int _uverbs_get_const_unsigned(u64 *to, const struct uverbs_attr_bundle *attrs_bundle, size_t idx, u64 upper_bound, u64 *def_val) -- 2.17.1