Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755123AbcK1T4q (ORCPT ); Mon, 28 Nov 2016 14:56:46 -0500 Received: from p3plsmtps2ded01.prod.phx3.secureserver.net ([208.109.80.58]:53942 "EHLO p3plsmtps2ded01.prod.phx3.secureserver.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754796AbcK1T4i (ORCPT ); Mon, 28 Nov 2016 14:56:38 -0500 x-originating-ip: 72.167.245.219 From: Matthew Wilcox To: linux-kernel@vger.kernel.org, Andrew Morton , Konstantin Khlebnikov , Ross Zwisler Cc: Matthew Wilcox , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, "Kirill A . Shutemov" Subject: [PATCH v3 29/33] tpm: Use idr_find(), not idr_find_slowpath() Date: Mon, 28 Nov 2016 13:50:33 -0800 Message-Id: <1480369871-5271-30-git-send-email-mawilcox@linuxonhyperv.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1480369871-5271-1-git-send-email-mawilcox@linuxonhyperv.com> References: <1480369871-5271-1-git-send-email-mawilcox@linuxonhyperv.com> X-CMAE-Envelope: MS4wfCYI7bRM92+0QvlKBCl1NYkj2eyh46iZ8o3nxTAbtMHWw7gdqHkjSn8T7OoUzjyys55AicBrGGd1p9EXjMMaDeo5mCerVLZqHHwJ9//ZXEHaOf2hHv0c tC8pnz048mnJp9x80q+nNAGRnU7geNQlS1B3pdz/gb9tPop3faNOCnxXRlgxNMnfU+gvcGWBbkobpdbC6BK8ph0w1x1rd5GSYPXzcstiGN93jh0i3KecIm1e e0YCpzGCtciFBm/dg21UYJkE0BrChK/M7sUzaRA5mc7S7+O5Vq0SmAMkhenOTjDVmPGUkmuZuAgWUu51i+ZDgp0f+koyohC44pESRuq1zjMOGWP4h86y/6rs v1fM/DCtaULWtjbDZwQXV50y70/QmzvF5MIBbr/EzBoFBR2P94JU61wRK5U4Lao8TZdf/ROGcJGY0SXDZ15VGwiJAowMTdMa1CAslXtFHK343TNr/90= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1056 Lines: 35 From: Matthew Wilcox idr_find_slowpath() is not intended to be part of the public API, it's an implementation detail. There's no reason to skip straight to the slowpath here. Signed-off-by: Matthew Wilcox --- drivers/char/tpm/tpm-chip.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/char/tpm/tpm-chip.c b/drivers/char/tpm/tpm-chip.c index 7a48691..a77262d 100644 --- a/drivers/char/tpm/tpm-chip.c +++ b/drivers/char/tpm/tpm-chip.c @@ -84,7 +84,7 @@ EXPORT_SYMBOL_GPL(tpm_put_ops); * * The return'd chip has been tpm_try_get_ops'd and must be released via * tpm_put_ops - */ + */ struct tpm_chip *tpm_chip_find_get(int chip_num) { struct tpm_chip *chip, *res = NULL; @@ -103,7 +103,7 @@ struct tpm_chip *tpm_chip_find_get(int chip_num) } } while (chip_prev != chip_num); } else { - chip = idr_find_slowpath(&dev_nums_idr, chip_num); + chip = idr_find(&dev_nums_idr, chip_num); if (chip && !tpm_try_get_ops(chip)) res = chip; } -- 2.10.2