From patchwork Thu Sep 28 18:04:11 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Volodymyr Babchuk X-Patchwork-Id: 9976645 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D37576034B for ; Thu, 28 Sep 2017 18:10:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C84DC296EA for ; Thu, 28 Sep 2017 18:10:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BD2C7296EF; Thu, 28 Sep 2017 18:10:43 +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=-4.2 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, DKIM_VALID, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 44BE1296EA for ; Thu, 28 Sep 2017 18:10:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=UYSXkj2+2jdH+7Y9DnbzU5vToigK6rkfSwLlFIWkx/8=; b=e/WTJkNY2+PUot nutMOs14MJ1KXdysFIkVD5Nn1XwwI5fjgSUlho9e2O/vsWc41xjYto+2Elo0+bQFGnUM4OrfRp8zj G302S9OOCfOuwU3PrF22Pg+yUd4uJsjwVWql9xzIsyMXU64Tdot0pBW/MHuK2c2y6dI/mNDHKwTn9 Owmu+pO7Veth3p2sH55iS4TMfJ6dLDm5F2Imc128jd7KmaVHuL6u8woA74snCyoB0D5kvkqFTpzp2 /CQCfnnOEz79cF0rLQ+YTRxQFo0J0qAnrVWTau+rkHZMaGS7MWF3iRYJr/xGW3rlbZ2GRSHZiD/Us jL9d1rrEAlcBDu5MOO+w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dxdGe-0001rq-En; Thu, 28 Sep 2017 18:10:36 +0000 Received: from mail-he1eur01on0050.outbound.protection.outlook.com ([104.47.0.50] helo=EUR01-HE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dxdCk-0005Or-PI for linux-arm-kernel@lists.infradead.org; Thu, 28 Sep 2017 18:06:50 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=EPAM.onmicrosoft.com; s=selector1-epam-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=2Sk9WxgOp26Pe6OW+1pd553W/semlVlx2AFsd3ibDVs=; b=W6vtxJQ3Ky1un3G996LxGGs406GNS2qOLfEJtP4SHBAQGCTBvuE2sVUxbU8k27ogIsz7/tDJlO1a+kJcXjYHPFe8fYjveAi89VfG1r2k7/rqE0zfrY8npIkdO25+SJ0C+G2QNpB3YvLPPKRCGsPYEOkMjHH7tmfQdWT9XLmIyFY= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Volodymyr_Babchuk@epam.com; Received: from EPUAKYIW2556.kyiv.epam.com (85.223.209.59) by VI1PR0301MB2141.eurprd03.prod.outlook.com (2603:10a6:800:26::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Thu, 28 Sep 2017 18:06:02 +0000 Received: by EPUAKYIW2556.kyiv.epam.com (sSMTP sendmail emulation); Thu, 28 Sep 2017 21:05:58 +0300 From: Volodymyr Babchuk To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, tee-dev@lists.linaro.org, Jens Wiklander Subject: [PATCH v1 14/14] tee: shm: inline tee_shm getter functions Date: Thu, 28 Sep 2017 21:04:11 +0300 Message-Id: <1506621851-6929-15-git-send-email-volodymyr_babchuk@epam.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1506621851-6929-1-git-send-email-volodymyr_babchuk@epam.com> References: <1506621851-6929-1-git-send-email-volodymyr_babchuk@epam.com> MIME-Version: 1.0 X-Originating-IP: [85.223.209.59] X-ClientProxiedBy: VI1P18901CA0005.EURP189.PROD.OUTLOOK.COM (2603:10a6:801::15) To VI1PR0301MB2141.eurprd03.prod.outlook.com (2603:10a6:800:26::14) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 02112d86-4635-4c75-c21e-08d5069b94f5 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:VI1PR0301MB2141; X-Microsoft-Exchange-Diagnostics: 1; VI1PR0301MB2141; 3:TQho3WcwKwcubSV3/5bsh4sx8/tp65XMgh+tlbeIjs5tmPksBkzCuuHr95n3lDdEX+7QgUrHGAGrNOdk2WaI5CAmcvAydCbz338mWf7T86tJo8WpPI5QOqJaQTsgtf0lipwxeVfTlionM/ArMJ1s0st6Y/mA3FN68wv9o4q6lHgruRJWD4JkxNTPTqmgNP1Uy2DejkJmU0gFLIMN+z3Gqcvip8KP2Y+mjPY9ftt+VlNXTIsy5J7zINy/d2nIFwO4; 25:CAdhgDj94nohzhfINySLrGtcCx3aDVdhuDModBe4q2dK77mHhp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wqK7A93KlQZ95JuyRDomeO3adohcS5f8bwyKrUi+WsmB; 4:MzOSJSXfU62BQU8jcA7yNMx9fUvt2u3TFYJbrP5zl0xsJ7ctdXXZ74qp0ZHWfJoEa8n5cAaAmv8cObXmbiiwmE6iw/bcDqQFHgUNCgpUyLyGGRm4EF1apGrCz1yiWjpppM/KaLo7eNXxS4Rtz2XFimSbG7PuABHEk2x0y5uubFVePEQre8iwlIwH+LdAM8ND2otMXX5ONB73tRVh1lqkmPrbo6GRbigcm/T/piddKuqv15wJ5i7+6zLfgXPSiG+n X-Exchange-Antispam-Report-Test: UriScan:; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(8121501046)(5005006)(93006095)(93001095)(3002001)(10201501046)(100000703101)(100105400095)(6041248)(20161123555025)(20161123560025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123562025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:VI1PR0301MB2141; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:VI1PR0301MB2141; X-Forefront-PRVS: 0444EB1997 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(346002)(376002)(199003)(189002)(16586007)(42186006)(97736004)(80792005)(316002)(2906002)(122856001)(81166006)(81156014)(76176999)(50986999)(6916009)(8676002)(5003940100001)(8936002)(39060400002)(50466002)(48376002)(4326008)(5660300001)(2950100002)(86362001)(72206003)(478600001)(33646002)(106356001)(50226002)(105586002)(305945005)(7736002)(66066001)(47776003)(68736007)(189998001)(6666003)(6116002)(3846002)(36756003)(101416001)(53936002); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR0301MB2141; H:EPUAKYIW2556.kyiv.epam.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: epam.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; VI1PR0301MB2141; 23:f2o64p9DgNR9hk2WAIvYdX9+L2E4oCv+htmQwBV?= =?us-ascii?Q?jU/8xmG8NXQFABGhVeV0q0vrzxb8SmpEyaHDFBDLOdHFasSSd9dutcLV7qIH?= =?us-ascii?Q?VSYFQx2yHhjwnSHO3k39JO7fO/rvIW65YGm3zXP8s/QGOOYwOZE0DUD3kCsJ?= =?us-ascii?Q?nd6my3NXGKeGuzAXP1K1PGDNM250/v4YJNBw/j4ztkL19GmvNsuUFUA2SXZ4?= =?us-ascii?Q?mJUWbGPzeJqMLRm2bmpvZlyytzcYBzwI8T4alNFKCeRGQF8uRvkXFSj3Djmp?= =?us-ascii?Q?4qwycLXpAqN8WSQaQBRAXlpF1y7WBBlu/NjyL+ehlPjlOIES4b/Am8Afhma9?= =?us-ascii?Q?uPi/YvwdCqStUkoTny+22e5YE0HWNSccA2EHiqbsFPDualjknE8h/Nniwq5g?= =?us-ascii?Q?No1ru88/UzJSeLg7/PY/pbU88qzZR1JB+aDmm+5uqv+WV05S9gxKkWZxWzes?= =?us-ascii?Q?IDBgVZpHhd1VskzVkL1JND4A5HmdFoLn5nYpV8gUCxf6pv808AG8gbGg03iI?= =?us-ascii?Q?50niePCEzAlwFpg5de5UM6UedUdEW+xUxiCeO7NlWNmq6pJkDuYqPNPhus7m?= =?us-ascii?Q?1UbL5P1GbFetcoUOPYih35bFk5MQzhwcL2CmrOZboIpTb5O8uWsOQVVpWWEY?= =?us-ascii?Q?/aKg5aPUKeuPnE9yC1jAIkQ4gMuTbs4KRhUAvaURLHe8vcsCcn8uCl5thBkc?= =?us-ascii?Q?rsjwRAKrSvM/2cdwE0jvHtmZJg+0B5uFIyEu8wTHsHgG1Z9SSpzXw6kVJ/nd?= =?us-ascii?Q?KQHI0IgPvw7q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nJqw8Sk5CuOWsAaW0tyy1qjPz2vP+kOjAO5Xmz2e0e11irJ99f3yLIZIPdTe/MBAP1rzlqsZYfFiAnraBQV8gshJX2c/eI4MDW2g2gXGdj3u1xlsQ05SEXsYUb955eIzsBhQIwKdsY3DXdEpB+uQ/TqvhQaIOlM9wN2FWEyFkWJD6zbS8CMOTtfAWBcSXsA+800c8VgEFHF8HUmtgo= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: epam.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Sep 2017 18:06:02.8655 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: b41b72d0-4e9f-4c26-8a69-f949f367c91d X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0301MB2141 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170928_110635_221318_EF9FF65B X-CRM114-Status: UNSURE ( 7.84 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Volodymyr Babchuk Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Volodymyr Babchuk Now, when struct tee_shm is defined in public header, we can inline small getter functions. Signed-off-by: Volodymyr Babchuk --- drivers/tee/tee_shm.c | 17 ----------------- include/linux/tee_drv.h | 10 ++++++++-- 2 files changed, 8 insertions(+), 19 deletions(-) diff --git a/drivers/tee/tee_shm.c b/drivers/tee/tee_shm.c index 5176c83..453700a 100644 --- a/drivers/tee/tee_shm.c +++ b/drivers/tee/tee_shm.c @@ -494,23 +494,6 @@ struct tee_shm *tee_shm_get_from_id(struct tee_context *ctx, int id) } EXPORT_SYMBOL_GPL(tee_shm_get_from_id); -bool tee_shm_is_registered(struct tee_shm *shm) -{ - return shm && (shm->flags & TEE_SHM_REGISTER); -} -EXPORT_SYMBOL_GPL(tee_shm_is_registered); - -/** - * tee_shm_get_id() - Get id of a shared memory object - * @shm: Shared memory handle - * @returns id - */ -int tee_shm_get_id(struct tee_shm *shm) -{ - return shm->id; -} -EXPORT_SYMBOL_GPL(tee_shm_get_id); - /** * tee_shm_put() - Decrease reference count on a shared memory handle * @shm: Shared memory handle diff --git a/include/linux/tee_drv.h b/include/linux/tee_drv.h index 6aaef65..2ae0286 100644 --- a/include/linux/tee_drv.h +++ b/include/linux/tee_drv.h @@ -429,7 +429,10 @@ static inline size_t tee_shm_get_page_offset(struct tee_shm *shm) * @shm: Shared memory handle * @returns id */ -int tee_shm_get_id(struct tee_shm *shm); +static inline int tee_shm_get_id(struct tee_shm *shm) +{ + return shm->id; +} /** * tee_shm_get_from_id() - Find shared memory object and increase reference @@ -445,6 +448,9 @@ struct tee_shm *tee_shm_get_from_id(struct tee_context *ctx, int id); * @shm: Shared memory handle * @returns true if object is registered in TEE */ -bool tee_shm_is_registered(struct tee_shm *shm); +static inline bool tee_shm_is_registered(struct tee_shm *shm) +{ + return shm && (shm->flags & TEE_SHM_REGISTER); +} #endif /*__TEE_DRV_H*/