From patchwork Wed Oct 13 18:35:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Das, Nirmoy" X-Patchwork-Id: 12556603 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BF982C433EF for ; Wed, 13 Oct 2021 18:36:20 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 81C5660F21 for ; Wed, 13 Oct 2021 18:36:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 81C5660F21 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=amd.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 30B2E6E0FB; Wed, 13 Oct 2021 18:36:19 +0000 (UTC) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2075.outbound.protection.outlook.com [40.107.237.75]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9B0EF6E0FB; Wed, 13 Oct 2021 18:36:17 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=f23LQTfpBbzBHupLxdMPoBGay1akJ0GVfY+2s0l1sEePfFkjx/Y0jmjjKjlWn0cjoR1YueVfc0yfPHKyGHRK5Ky+X4ErGGWgG2qxsc/0gAPC1cQYOeVCMQPyaHbJ1fNSpSIy6ZK5Fo6JSpTymqnx7qjjG3/BAhnfisUC0+b2V/5n8Uw5vXM0fcVsOJPxvz+jATt/BwMdC5yUYA7oxBDqH3GGZaN9mfRbOGHvwS83lIwABoh6iVtlGk4UUf2Aa95SQQS1f8+2GpudSBhgR8/3/cBQiZz0ifvECOtMr/E7lwLAEqYSejVBLd8aVre900Lr5SLo3TdgoKhMhULYeDvfzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=3wh335hn16jS+pIuCfapAk8ZuR4DgGjARl9vabxRbf0=; b=eKGzfiYtwuCBnClP6yyyjfcEeoOhzgXE9XRwN93l1+WtEw+aG6t95moXs8dnEZv718Jn+z3A+r8TR4AMEhqrwUVhFGXiLJIgjrXCiMKljU0NxzBcvjpSOFJcNFUzGazuUedcpBcMW1WNGr0LbfYrhv8vZJIx5/31bHpEeBqvhPVHyiZaROmf9e1y4N0gjYSjUQ9Qo9D5z93vCa1MZkIGFIu/pC3DhLL99Aj/Tx9kKvEUDj1HMsqPhYiyZqwmZwhphBmEv+qyKEIabH6pEEljxhyoT9LNN0SCUmPFloOHSTIKtpWPrX8z+H3BHspzQkyTVxyt0tPA1oJCsPY26Vvn/A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.freedesktop.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=3wh335hn16jS+pIuCfapAk8ZuR4DgGjARl9vabxRbf0=; b=MCyryF7eE2MYA5E6g+fVdh62MxNOVvoQJRwzNALruqaaKi4xBkJaVvrizHO2yzPxEA9f1ZBm11+tFbszIvJ58pdNbQ2//99cBbvKnQdrer/+zqljiACk8+fWMgbe+SDcjkkM7v17w+9XCU6ibUqi3if6aJmvvZseW8m94rQifsY= Received: from DM5PR20CA0031.namprd20.prod.outlook.com (2603:10b6:3:13d::17) by DM6PR12MB2988.namprd12.prod.outlook.com (2603:10b6:5:3d::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.22; Wed, 13 Oct 2021 18:36:15 +0000 Received: from DM6NAM11FT033.eop-nam11.prod.protection.outlook.com (2603:10b6:3:13d:cafe::69) by DM5PR20CA0031.outlook.office365.com (2603:10b6:3:13d::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.15 via Frontend Transport; Wed, 13 Oct 2021 18:36:15 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; lists.freedesktop.org; dkim=none (message not signed) header.d=none;lists.freedesktop.org; dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; Received: from SATLEXMB04.amd.com (165.204.84.17) by DM6NAM11FT033.mail.protection.outlook.com (10.13.172.221) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4608.15 via Frontend Transport; Wed, 13 Oct 2021 18:36:14 +0000 Received: from brihaspati.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.8; Wed, 13 Oct 2021 13:36:12 -0500 From: Nirmoy Das To: CC: , Nirmoy Das , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter Subject: [PATCH v2 1/4] dri: do not check for NULL debugfs dentry Date: Wed, 13 Oct 2021 20:35:58 +0200 Message-ID: <20211013183601.16514-1-nirmoy.das@amd.com> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 77aea556-b540-4ad6-5ab4-08d98e78566e X-MS-TrafficTypeDiagnostic: DM6PR12MB2988: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5516; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: iUqySQ2WvaJ9B3PcykWMF6Ao1o1z/QlU0GoN/yCM5URSSPMKQc2Dd5OPM19EAfNVkQr9wNLZFUABFAzKpbIpOOQnlNm/UmqRdMiulGm5TXl3P3o/wkZklgXMxmxT0jZQwKXHRz7PxB76HzRtHknjg2HkJzd2CnMgL7lPbtPuEho4cdfPzfZnXSf/kbSQPvk+e1JSegfV5QXnviG6ihWoI179sF+Pd9okwObJaTsKllb9eTLnRuDKUzPMZX4yYwVfU7gSYHWwraO1nxB1Z5CV3slV172F+T0rUaEKZHa0QnkqomSezljORh3rvNHbiGWJB1Z4Mrs3A1BzxQqsYnlyhSPdI7K03BquHi/GU/hfhIV6Ot4IMj2vpqHz+eGaI67mcZpPz60LO36Spf5gcSfequxBkEFEw5dc1Y3QjZ5IiF68wIMbef7vMefDINlCAgq/AbgQMryjC4W2kWV9xR62RD2j5VYC9Vq0qxb7ZYYtTjOgBSKqC9Fp3wKOZbU69u36kYU8K+pw1gqoF9/zMtjtxMY/12/rgrgLzrQRl8iI+tEAzmN/Ah8a0UVBvWlu6ohEBsvKOtO+ZldwVSimojadXM3HGKG94Z/QgNICRzRH1SEe0r/0BPAdQ5QWLjKfjBVEs0F09uXbz6nRvAAVdOnmyDuCbMER22pYHzpnFmg3lZsDKoDG10sOZrS2ttkcBVvOOcz6xLP7B4jAQ4UdSTupbvQfalheDlfPjC+8hSQvELo= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(4636009)(36840700001)(46966006)(70586007)(47076005)(44832011)(7696005)(5660300002)(6666004)(1076003)(8676002)(186003)(86362001)(356005)(508600001)(336012)(83380400001)(4326008)(16526019)(82310400003)(36756003)(2616005)(8936002)(70206006)(36860700001)(6916009)(26005)(54906003)(2906002)(316002)(426003)(81166007)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Oct 2021 18:36:14.6168 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 77aea556-b540-4ad6-5ab4-08d98e78566e X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT033.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB2988 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Debugfs APIs returns encoded error on failure instead of NULL and for drm primary/minor debugfs directories, we save the returned value in the dentry pointer and pass it on to drm drivers to further create debugfs files/directories. Error conditions are handled by debugfs APIs, so no need to check for NULL, as saved dentry pointers will either contain a valid pointer or an error code. Also document this for future reference. CC: Maarten Lankhorst CC: Maxime Ripard CC: Thomas Zimmermann CC: David Airlie CC: Daniel Vetter Signed-off-by: Nirmoy Das --- drivers/gpu/drm/drm_debugfs.c | 9 --------- drivers/gpu/drm/drm_drv.c | 1 + include/drm/drm_file.h | 28 ++++++++++++++++++++++++---- 3 files changed, 25 insertions(+), 13 deletions(-) -- 2.32.0 diff --git a/drivers/gpu/drm/drm_debugfs.c b/drivers/gpu/drm/drm_debugfs.c index b0a826489488..0073854a4383 100644 --- a/drivers/gpu/drm/drm_debugfs.c +++ b/drivers/gpu/drm/drm_debugfs.c @@ -272,9 +272,6 @@ static void drm_debugfs_remove_all_files(struct drm_minor *minor) void drm_debugfs_cleanup(struct drm_minor *minor) { - if (!minor->debugfs_root) - return; - drm_debugfs_remove_all_files(minor); debugfs_remove_recursive(minor->debugfs_root); @@ -419,9 +416,6 @@ void drm_debugfs_connector_add(struct drm_connector *connector) struct drm_minor *minor = connector->dev->primary; struct dentry *root; - if (!minor->debugfs_root) - return; - root = debugfs_create_dir(connector->name, minor->debugfs_root); connector->debugfs_entry = root; @@ -440,9 +434,6 @@ void drm_debugfs_connector_add(struct drm_connector *connector) void drm_debugfs_connector_remove(struct drm_connector *connector) { - if (!connector->debugfs_entry) - return; - debugfs_remove_recursive(connector->debugfs_entry); connector->debugfs_entry = NULL; diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c index 7a5097467ba5..918f302d9c43 100644 --- a/drivers/gpu/drm/drm_drv.c +++ b/drivers/gpu/drm/drm_drv.c @@ -64,6 +64,7 @@ static struct idr drm_minors_idr; */ static bool drm_core_init_complete; +/* Do not deference this pointer as it will contain ERR_PTR on error. */ static struct dentry *drm_debugfs_root; DEFINE_STATIC_SRCU(drm_unplug_srcu); diff --git a/include/drm/drm_file.h b/include/drm/drm_file.h index a3acb7ac3550..3a30fc4d8905 100644 --- a/include/drm/drm_file.h +++ b/include/drm/drm_file.h @@ -69,15 +69,35 @@ enum drm_minor_type { */ struct drm_minor { /* private: */ - int index; /* Minor device number */ - int type; /* Control or render */ - struct device *kdev; /* Linux device */ + /** @index: minor device number. */ + int index; + + /** @type: minor device type: primary, control, render. */ + int type; + + /** @kdev: Linux device pointer. */ + struct device *kdev; + + /** @dev: drm device pointer. */ struct drm_device *dev; + + /** @debugfs_root: + * + * Dentry for /sys/kernel/debug/dri/@index debugfs dir. Do not + * deference this pointer as it will contain ERR_PTR on error. + */ struct dentry *debugfs_root; + /** @debugfs_list: + * + * A list to keep track of debugfs dentries created using + * drm_debugfs_create_files() by drm drivers. + */ struct list_head debugfs_list; - struct mutex debugfs_lock; /* Protects debugfs_list. */ + + /** @debugfs_lock: Protects debugfs_list. */ + struct mutex debugfs_lock; }; /** From patchwork Wed Oct 13 18:35:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Das, Nirmoy" X-Patchwork-Id: 12556605 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3C504C433FE for ; Wed, 13 Oct 2021 18:36:29 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0BC7C61056 for ; Wed, 13 Oct 2021 18:36:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 0BC7C61056 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=amd.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4477B6E0FC; Wed, 13 Oct 2021 18:36:19 +0000 (UTC) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2042.outbound.protection.outlook.com [40.107.94.42]) by gabe.freedesktop.org (Postfix) with ESMTPS id D34236E0FC; Wed, 13 Oct 2021 18:36:17 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZIFZkaCWyt04BP2MCQ2yaQcPLH0RreOB1WdBcGPFIzx3nxlLbL0aUjPAJ92jFAAfGqtGlujZ0btp1OycYtQWfXbUtUmyIf8UZp8grGnNq3wWTDaDXPfZFxVw8RsReQPe80XsxwnojJvwSttChlLUkpFc75+y5BqKKEJZ84uWDcdCoswTIJ6JQUZY/Sk04/Qi6T6gwwZGcVNuA4P7Tg7rmm9UUBOuegaSnJzz23Bklzgku67UIwfM+1GsxxcBVFhuKzVwoMy9I37/6hzQaf0W6eY5LmYRRoVEPp6mneQ2LytvO6mxgPJqTRDsC7uE6nEa/eBrPM78o/wAbp6qZhhF0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=OavUhKdvYgtbIxUS2tB4oYhW303qh034ljtVWUmgigc=; b=XNfv3xJXbsFd4qM4c4Q00hqIYCF1eWh5B6L4ppfQ66tDfEJVQSH4jR5yjpx0US9ya6uuITJ4KIZrymJqE+6WRHJ5PVFepIvW0PUVRku2Gps6/EtgAg61xDiU/OL455h/qZib7LD3KcCgXHtmd2u07NtPA2vkVkUl2foX5TlEae2A5mfZF7Z3qM91ZUk5xTsq0v6zCNDI0NDpbTYvXhGIFl4F01cyp8qzaAv7uqSTbQXpVMx0+xFnHlJ18nL3FWECmkw4C0fRJgmRQvCA2u9d0opqVb7MwIf3raIRV4m1GyJVhxAyhe5P4/tARR0kPWB0A5JvncyItOV1Rnm5Wb3MXA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.freedesktop.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=OavUhKdvYgtbIxUS2tB4oYhW303qh034ljtVWUmgigc=; b=MCSXwW+M93MjhZ3veiR1IVQaJttmCRQCpFyAxYZcBPoRuF0EKVvo37pwg2wdtwfAKg6VcYQffAc6uQ0mdiECnrnpjLk7NNQDuIg3NgQLTALj4q5a0v6z8LwSNDkkkwIeM+CV4652vFbtwtDcmh2RmRJaqI3ad7sUe/lbc30hQkM= Received: from DM6PR13CA0062.namprd13.prod.outlook.com (2603:10b6:5:134::39) by CO6PR12MB5443.namprd12.prod.outlook.com (2603:10b6:303:13a::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.16; Wed, 13 Oct 2021 18:36:16 +0000 Received: from DM6NAM11FT057.eop-nam11.prod.protection.outlook.com (2603:10b6:5:134:cafe::2f) by DM6PR13CA0062.outlook.office365.com (2603:10b6:5:134::39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.14 via Frontend Transport; Wed, 13 Oct 2021 18:36:16 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; lists.freedesktop.org; dkim=none (message not signed) header.d=none;lists.freedesktop.org; dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; Received: from SATLEXMB04.amd.com (165.204.84.17) by DM6NAM11FT057.mail.protection.outlook.com (10.13.172.252) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4608.15 via Frontend Transport; Wed, 13 Oct 2021 18:36:15 +0000 Received: from brihaspati.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.8; Wed, 13 Oct 2021 13:36:13 -0500 From: Nirmoy Das To: CC: , Nirmoy Das , Christian Koenig , Huang Rui , David Airlie , Daniel Vetter Subject: [PATCH 2/4] drm/ttm: do not set NULL to debugfs dentry Date: Wed, 13 Oct 2021 20:35:59 +0200 Message-ID: <20211013183601.16514-2-nirmoy.das@amd.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20211013183601.16514-1-nirmoy.das@amd.com> References: <20211013183601.16514-1-nirmoy.das@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 68e61358-a88d-4aa8-4724-08d98e785735 X-MS-TrafficTypeDiagnostic: CO6PR12MB5443: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5516; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: cupaER+0Y2huTKxO/DzHD0Tq5MvYhtpjYNPbzl1tiAoHUCrh3lkj7vzhfCbBRAN+uvSOhvY5dtmqKW9PEypTbhNasFo8u2UoUwBbRgG/zj+6drzKi06r2Lz3ZoEJu6rkwEEnxF65M4Qp0KyV3UnUo3MOJaGWkedbIM1S7spJX7T0QjqP2pf4Mxbi1IQqZKUZMwo5pIZjNkC+sBuhIDw+oV8kBJWL3KbWlm+y/iSoO/osLBbrhKmA1zlK7oT+vn/3rhxZQmnHdflVBhlfC5Zo8BgF6CrUpop3fIyVaf8whuWD3BQC1wTQvtlCH7NFOomijJlMDl4OfuIhI6JG4fullKh5l3VDAiAYAyx1kaf6a8xf3sZ1rbppb9l0yzjGTdtr/sy4LFapCb+a3Yb8dNM+FU+/3OHeX+ozTtdToB8IoJky0+qXaC2k3ILQy2vw56X3SM8iPI9qAlPatFPMCjA4WuozMX48qX+4jGG7K4pEpG5hUSmsBDKHu8L6gG/HyYOMEHVdJFNgi/TvM73uZRl5BRzz/awxW4c+UmhaEDqzErEqB9RshPdz0ctjWZKjXm+MgkjCoCbjoupxJCl4nVa/Yxbm1Qw0KrCIvSUc4zhFPGHQ72Go+hCUCdHZPO1QB/Bd9M95AZY7CqNNkdPQwNjQwN/lDWRsKKGnI3RkTswbFrmoBDQwKKUnCpRtP3B4OXG9lKaRCFRydaLHZAYAk9DgYQvPE4l3MB3NickpSuW+mgY= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(4636009)(36840700001)(46966006)(47076005)(26005)(83380400001)(1076003)(36756003)(356005)(82310400003)(44832011)(336012)(4326008)(186003)(81166007)(54906003)(426003)(2616005)(6916009)(86362001)(16526019)(70206006)(5660300002)(6666004)(8676002)(70586007)(8936002)(316002)(508600001)(7696005)(2906002)(36860700001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Oct 2021 18:36:15.9016 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 68e61358-a88d-4aa8-4724-08d98e785735 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT057.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR12MB5443 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" For debugfs directory, it is recommended to save the result and pass over to next debugfs API for creating debugfs files/directories. Error conditions are handled by debugfs APIs. CC: Christian Koenig CC: Huang Rui CC: David Airlie CC: Daniel Vetter Signed-off-by: Nirmoy Das --- drivers/gpu/drm/ttm/ttm_device.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/ttm/ttm_device.c b/drivers/gpu/drm/ttm/ttm_device.c index be24bb6cefd0..2c66f06198e9 100644 --- a/drivers/gpu/drm/ttm/ttm_device.c +++ b/drivers/gpu/drm/ttm/ttm_device.c @@ -44,6 +44,7 @@ static unsigned ttm_glob_use_count; struct ttm_global ttm_glob; EXPORT_SYMBOL(ttm_glob); +/* Do not deference this pointer as it will contain ERR_PTR on error. */ struct dentry *ttm_debugfs_root; static void ttm_global_release(void) @@ -77,9 +78,6 @@ static int ttm_global_init(void) si_meminfo(&si); ttm_debugfs_root = debugfs_create_dir("ttm", NULL); - if (IS_ERR(ttm_debugfs_root)) { - ttm_debugfs_root = NULL; - } /* Limit the number of pages in the pool to about 50% of the total * system memory. @@ -108,8 +106,7 @@ static int ttm_global_init(void) debugfs_create_atomic_t("buffer_objects", 0444, ttm_debugfs_root, &glob->bo_count); out: - if (ret && ttm_debugfs_root) - debugfs_remove(ttm_debugfs_root); + debugfs_remove(ttm_debugfs_root); if (ret) --ttm_glob_use_count; mutex_unlock(&ttm_global_mutex); From patchwork Wed Oct 13 18:36:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Das, Nirmoy" X-Patchwork-Id: 12556607 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 58EEFC4332F for ; Wed, 13 Oct 2021 18:36:34 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 28E99610A2 for ; Wed, 13 Oct 2021 18:36:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 28E99610A2 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=amd.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 713296EA13; Wed, 13 Oct 2021 18:36:23 +0000 (UTC) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2056.outbound.protection.outlook.com [40.107.237.56]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8DFD66EA59; Wed, 13 Oct 2021 18:36:20 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iSpmrdOjRe1JCHIPUWknFO0tSNNSkh5a+v48ZMqmknF/c1Sl8BZLeNHEKGUateb2K+vhEeI8ZvNw/ZOi/3X41thV5dBIQW8P5DQDvdJjPmackVj1XU9RuLb0c2ej6obH1p7XSx36TY+wngvt9qRACU0BLUufi2QyPz1NKdrJN78RMoRC9DaJ7z/gfCaYeUQ3kmxWCJk8UDDSbFjX7lI5vuQgbqvW9Ql0tmreQmFQYesMDCy4WoYRwmYLMPeyLnMEJoJj6EPMwdpHimLBe6upRLcpQ8d7nHmKambUq6sWAm71GfuerFTXzQn2SQORZbNWZrpg83NnkEaSfo6xzzh0MQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=94Hsy9uxVpjI7NE9tvsVTZAOa7AiXgnaKaKUuYzDA94=; b=kxxovHiNs5TDlURrrtZiz4E8oZiBAW62A+Et6WcmMd8JU1yQeojen9a73fkM6wdb9qy9LkF6kRWUnNLRBxA/+JD43w0/rjlJN+EHmkJX6MmV8kIAxpAAhY8aOk8nk4kCKb9K9SXuRtmNLid13tZVVzJkUfq1rUJED/zBEyLOdoki6Jb7r4OE0sSMyKvaels7b9S9zRkkQr0KH2fCTWaEU4eQ8jd5SHgJ28CGmOn33wDrHTM7+6/zQQkITFBfVyOohVBGcRQVDQOnNEh7Dr9r6drxF/z3+TEKzo92Chy4JKInCDvmgl+U4q4dbhITfsIrWOBC6LLXoi6uFOkLBUFrrQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.freedesktop.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=94Hsy9uxVpjI7NE9tvsVTZAOa7AiXgnaKaKUuYzDA94=; b=y5nPxKr4CctjuttyZy8EUDe6V03QdHMlEmYFaiwRDBJIf4OWEshguZsux8WFNllbxNI1qenIQbi1AJ2FuuRsZHhXL+6Wea8tCqwt0S8Zh/sDd6NUsRW+p7Gqv6SOCB+rP+wg053kVwEcrKL2G4vb2LGbGkv/ZNw0I12qt3q0O0g= Received: from DS7PR05CA0004.namprd05.prod.outlook.com (2603:10b6:5:3b9::9) by BN6PR12MB1857.namprd12.prod.outlook.com (2603:10b6:404:102::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.20; Wed, 13 Oct 2021 18:36:17 +0000 Received: from DM6NAM11FT035.eop-nam11.prod.protection.outlook.com (2603:10b6:5:3b9:cafe::cf) by DS7PR05CA0004.outlook.office365.com (2603:10b6:5:3b9::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.14 via Frontend Transport; Wed, 13 Oct 2021 18:36:17 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; lists.freedesktop.org; dkim=none (message not signed) header.d=none;lists.freedesktop.org; dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; Received: from SATLEXMB04.amd.com (165.204.84.17) by DM6NAM11FT035.mail.protection.outlook.com (10.13.172.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4608.15 via Frontend Transport; Wed, 13 Oct 2021 18:36:17 +0000 Received: from brihaspati.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.8; Wed, 13 Oct 2021 13:36:15 -0500 From: Nirmoy Das To: CC: , Nirmoy Das , "Jani Nikula" , Joonas Lahtinen , Rodrigo Vivi , David Airlie , Daniel Vetter Subject: [PATCH 3/4] drm/i915/gt: do not check for NULL debugfs dentry Date: Wed, 13 Oct 2021 20:36:00 +0200 Message-ID: <20211013183601.16514-3-nirmoy.das@amd.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20211013183601.16514-1-nirmoy.das@amd.com> References: <20211013183601.16514-1-nirmoy.das@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 88ba0d73-cf36-4d14-429e-08d98e78580f X-MS-TrafficTypeDiagnostic: BN6PR12MB1857: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:862; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: w/93BHFQhDwkDHnNEkpur6DNVcImBZch4qtofeo31K/u1X57y8vDpeTP4gTPb6h2w0IQ4MEWQyPX0v8v/0bEi+7aOPr+qZbcR//2H/hYfJbVZ6ngqUjQP4kZpRWfYcAAo6RoO5+ElArNLPvY/V89MsghU1f5GC3mon1PDllDHuEOAj+V5vTfN6jKORGJjt2RPEaEzRWMUU8JDO9BqweDiBCXaFdR40rkTAx6wzJ2pcdIyrsZU1tbA3DpWZB8HlO1eS/N8Y77L3h436RbxOLNGE8ndNix0PcA1f8CKXUEbywh0t/vs35/t3eaK1fbjZp5q4rEdSZCoNs/XNkTFO5P8a55R2AOWv7nTq1uU7XKX4A15PFsxPvFBSDkZnAUkpQ+qjueAFZY9VhX6TXDTy79Q7YUr9rs+iA8CTnZsGqdtDKrMrL5sr+8j30hNy0NmGeTTfhGYUGh2nZf3KZeDoCBxaU6OSGY8b0sGemcQwVxdgqvFdoxj1yRNEdebVr+O8efSyWpKz9oy3bBm3L5HgSA0WKnzMvuDGfIfFqlYh5B0Y19TNxLsDQvX3h2iTEXFCFAoOTZNbn32dmcVmhVT1fQvZkN02+fPqufaO2SzCsfh5mDHvMafBrR93J4bE9V03VuYI5tMqzn99NvICl6hGdj7Qk+GfTkjSKEiWRw+8GhPLx55wzibuAXDlqoabQFRBbi02LeSc3X3hExM3S9EfAo63BzX/tynf9t6PkEIWL4PHw= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(4636009)(46966006)(36840700001)(81166007)(26005)(356005)(47076005)(186003)(508600001)(44832011)(86362001)(8676002)(5660300002)(7696005)(36756003)(83380400001)(70206006)(70586007)(54906003)(36860700001)(82310400003)(8936002)(6916009)(316002)(6666004)(426003)(336012)(2616005)(2906002)(4744005)(4326008)(1076003)(16526019)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Oct 2021 18:36:17.3411 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 88ba0d73-cf36-4d14-429e-08d98e78580f X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT035.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR12MB1857 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Do not check for NULL value as drm.primary->debugfs_root will either contain a valid pointer or an encoded error instead of NULL. CC: Jani Nikula CC: Joonas Lahtinen CC: Rodrigo Vivi CC: David Airlie CC: Daniel Vetter Signed-off-by: Nirmoy Das --- drivers/gpu/drm/i915/gt/debugfs_gt.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/gpu/drm/i915/gt/debugfs_gt.c b/drivers/gpu/drm/i915/gt/debugfs_gt.c index 591eb60785db..95ca1b3ad320 100644 --- a/drivers/gpu/drm/i915/gt/debugfs_gt.c +++ b/drivers/gpu/drm/i915/gt/debugfs_gt.c @@ -16,9 +16,6 @@ void debugfs_gt_register(struct intel_gt *gt) { struct dentry *root; - if (!gt->i915->drm.primary->debugfs_root) - return; - root = debugfs_create_dir("gt", gt->i915->drm.primary->debugfs_root); if (IS_ERR(root)) return; From patchwork Wed Oct 13 18:36:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Das, Nirmoy" X-Patchwork-Id: 12556609 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6CBE6C433F5 for ; Wed, 13 Oct 2021 18:36:36 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3855A610C9 for ; Wed, 13 Oct 2021 18:36:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 3855A610C9 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=amd.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2F5B46EA59; Wed, 13 Oct 2021 18:36:25 +0000 (UTC) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2076.outbound.protection.outlook.com [40.107.92.76]) by gabe.freedesktop.org (Postfix) with ESMTPS id DF0C46EA59; Wed, 13 Oct 2021 18:36:23 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BUbU5IbZ1UCmXM6zvZl8Y/jEPQn5HeCTrdYMfkxq4kyB2wAq9n666XX+E++YlaQ3IQP+uHwEItar0TQVt8tyjIlgSO1yoSG722CCyTMVMsf6IOrwKuR2isomrcgA/UrkcxOVfYrzuuB5gyFgJZxqNmph2j9Ma4byuvEvsGhhhsb7PRVSsN4ow6t/Uvee4HbQkhxxYMOm73XqypQiMDcA1i15O3bSH8N4B4VPLKSqZdqrphC0Go6Y3An0ivJ3P8jrlniAG9j1iL07wvAx0QQLcQFJFZs9oy4AydHwcvZQ3TxhK8mvccSNNHtwBhFzDOe6MnSOpTxTBHbSE6rVmKZ9KQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=PChPYKluv1+6J4BjNoAeGkFBOyp8sRIIzfHwgLlDEbY=; b=j8hR8cJHGxHBkF54+MZhyRdcyFDKfFtst+DsjKDurCoVoRF7S/s3F89/ckAesQpaz2mH/+xQuMWqG5nJiMlJqVsSjAi4tzQspmRya6I5vuPFQrZmlp+oDy9KgDDHhE/D07dHxbs9DamgOt/j7vici4fubjt8gX0PwbyaUwFoNHnddZ5x8SBnNPzWSLYAxSEo4lpeNs1EOQCTD2LjzyJ73PBfQGI7H78G+aQDBcAZOqQ8LfpqrFin9uSwv2Drei5lQoZNT651EmWfRDUDgJ8RmI2ymS7sO2+t6rNrZEvKEgLb0O2EN46WrpRZE7EJu55obQCfmwsupKU+Qhc+w2FuqA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.freedesktop.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=PChPYKluv1+6J4BjNoAeGkFBOyp8sRIIzfHwgLlDEbY=; b=1rCnPFiRTlWRw8vKGE7lFkHz526Y2KmFVz0txoJIQh5oWq+b13K9EGjqkM7mv4EyNSNygngICccZGwyvAtPgpZa9DJkyc3hJbouxt2gErkIP9YZrv8m0s4xg5sJuCapGn9wJT69yufW0DgziXYkg8Six+WorOpsX3qOxHeYJlI8= Received: from DM5PR16CA0044.namprd16.prod.outlook.com (2603:10b6:4:15::30) by BN7PR12MB2689.namprd12.prod.outlook.com (2603:10b6:408:29::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.25; Wed, 13 Oct 2021 18:36:19 +0000 Received: from DM6NAM11FT037.eop-nam11.prod.protection.outlook.com (2603:10b6:4:15:cafe::88) by DM5PR16CA0044.outlook.office365.com (2603:10b6:4:15::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.16 via Frontend Transport; Wed, 13 Oct 2021 18:36:19 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; lists.freedesktop.org; dkim=none (message not signed) header.d=none;lists.freedesktop.org; dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; Received: from SATLEXMB04.amd.com (165.204.84.17) by DM6NAM11FT037.mail.protection.outlook.com (10.13.172.122) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4608.15 via Frontend Transport; Wed, 13 Oct 2021 18:36:19 +0000 Received: from brihaspati.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.8; Wed, 13 Oct 2021 13:36:16 -0500 From: Nirmoy Das To: CC: , Nirmoy Das , "Lukas Wunner" , David Airlie , Daniel Vetter , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann Subject: [PATCH v2 4/4] vgaswitcheroo: do not check for NULL debugfs dentry Date: Wed, 13 Oct 2021 20:36:01 +0200 Message-ID: <20211013183601.16514-4-nirmoy.das@amd.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20211013183601.16514-1-nirmoy.das@amd.com> References: <20211013183601.16514-1-nirmoy.das@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 177737aa-b870-4b48-7906-08d98e785931 X-MS-TrafficTypeDiagnostic: BN7PR12MB2689: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:400; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: FIOIGEBUHroLAI4JLveqWoL3I6XrUyFTU86sSJIO4mSEgX13viqDnyTjhaeuGAZquoIWjpepmenQgg57dgRIZ11N7DIY5WEdQmONswP+s8ZCBbZoBkvVG6yWeaKq3AVIyJnSSvZsc9FlKa4mBspX7hlydfXyLCfTdp7qXD5WL0Et6wfluMriZF5ddbwi1nkK8JVMN17qg145sd6pQoP3UzIY2oFXTHtfe3IUFKU0RyWR7kOMFLe4AwRqstfML588gWCuUnOnM0LeX15qEM8lfL4u7D4azSsY7OknDsGU4XWp5upbTm4GQSlCxihAoOaCscukUXHeo2+jWFbswFm1CPYh3ly7/UufhvXMZDfNbjmK0vu5NRb0JiH7BsmHyyTqjRF1bdPTk9blB8sy5bUZ86H+g4kBjNvCg7dc7+UG+x+TdmcTkQG6d+vlJUZFxo5+nqG0d+oD2t0a0cXDnIoqwwSLwsbqy3/s+rmlko2lxn4k4jZIGjBR71iovq9rggX6PjutOv0Rv22HHQNI2nB6lamZzjYI+w6gqyS8skjqnnIkZy2zMncdIJwXgpRINTvZtHnE6DoPSYCYhUXKGrw4EEDK/M6SP/dPTAQEMQ2mt5sLuVLMC1mue0/bAN2+c1td5BMxtm3PyEkzHNmECLaChl8qlM0O3yKb+aRVQM8DoyWF2ABF6FN/ycyVHOrDfMaf30ZGtw9wwM6hD3RcWxz/VhWhfGEAqKgrp8Rxb7arkfA= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(4636009)(36840700001)(46966006)(336012)(1076003)(36756003)(47076005)(2616005)(6916009)(86362001)(426003)(5660300002)(186003)(83380400001)(8676002)(2906002)(81166007)(7696005)(316002)(4326008)(16526019)(44832011)(82310400003)(508600001)(6666004)(70586007)(356005)(8936002)(36860700001)(26005)(54906003)(70206006)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Oct 2021 18:36:19.2460 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 177737aa-b870-4b48-7906-08d98e785931 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT037.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN7PR12MB2689 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Debugfs APIs returns encoded error on failure so use debugfs_lookup() instead of checking for NULL. CC: Lukas Wunner CC: David Airlie CC: Daniel Vetter CC: Maarten Lankhorst CC: Maxime Ripard CC: Thomas Zimmermann Signed-off-by: Nirmoy Das Reviewed-by: Lukas Wunner --- drivers/gpu/vga/vga_switcheroo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.32.0 diff --git a/drivers/gpu/vga/vga_switcheroo.c b/drivers/gpu/vga/vga_switcheroo.c index 365e6ddbe90f..07ab8d85e899 100644 --- a/drivers/gpu/vga/vga_switcheroo.c +++ b/drivers/gpu/vga/vga_switcheroo.c @@ -914,7 +914,7 @@ static void vga_switcheroo_debugfs_fini(struct vgasr_priv *priv) static void vga_switcheroo_debugfs_init(struct vgasr_priv *priv) { /* already initialised */ - if (priv->debugfs_root) + if (priv->debugfs_root && !IS_ERR(priv->debugfs_root)) return; priv->debugfs_root = debugfs_create_dir("vgaswitcheroo", NULL);