From patchwork Wed Aug 21 11:21:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Ruibin <11162571@vivo.com> X-Patchwork-Id: 13771259 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1FE43C52D6F for ; Wed, 21 Aug 2024 11:23:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version:Content-Type: Content-Transfer-Encoding:Message-Id:Date:Subject:Cc:To:From:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=aTMcIlgrXQk6v4nx3zXQZnQhyZVBHQ0XSHnnKB6A4pc=; b=o07soulBh8LvHIv/3Utoke9zLW EAHdaGZj42KdZWGeMCjGZvSuUIMz/GaIBrKzE477Th875RmcMSSYHFQgOwOcuE1gwMnf6Z2/UPW0l b+rZpZKtTSJiUJVeTK7YsJl2RcBRisNGAT0de+tKWpVoEUnCL/n1GFloH5yFqCMFAhjC+686FqKjT YZEG1DO1but0jEPgoZC+sGYIQM1LQ4ubCkhv0VrqJL0IJcWNYGV3mAfGgpmEA62V93TytvozihAcS vdnVDIJts2F/jsAoQYVHUgitXVcODZXkLqN3fDIIXGzJFfOa+KlAVG68/ZRht3JoDf/R1D4FsyCl+ U3jcT1CA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sgjQp-00000008f9O-2bud; Wed, 21 Aug 2024 11:23:15 +0000 Received: from mail-psaapc01on20617.outbound.protection.outlook.com ([2a01:111:f400:feae::617] helo=APC01-PSA-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sgjQ7-00000008ez9-13M1 for linux-arm-kernel@lists.infradead.org; Wed, 21 Aug 2024 11:22:32 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=QS2TFDQpbLNCyReYtqPSDn6cY9Gdr0PKhO1lJlrCXW/Nv2I53bC9/6gLjLf+jMmTbVikViMLnIAuB3NxL6TcjNCSy7D615h86Pm6cD4uRx1UmXuzYVG/tysvB+ZYuIsnvIz+b3fb9n9vR5RdWtR8+JIxUMEur+z3sOjrdwORapjy9oNkGv9Uz7E6gDNxm1wQfw9335Dzsiq0K1WdFi0yjdv3ZJlDVE4hEg8JT0JaayUopl5/mOG836S4PvdNohyxx0wd1n79zb1TObCQwdaS09NA9m1JTZ7J7H5RNZj/DVx9oj1vznPbWHO+FhBQBVxGwYTtKrXoZebzZAlO/hcU4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=aTMcIlgrXQk6v4nx3zXQZnQhyZVBHQ0XSHnnKB6A4pc=; b=ZeATNiPcaH6g+fu8VFfWpjLvIm+Kdnravk3iyAnV2ioAOz0pyzeViyPEXV4Z9w08bGxPjlLNIBZCGAy1XId7AVvWPZxaZzI5WIzRYgCde5/7r2XbaD2Xyn36dQZt3ZR2j9nQmo6o4wCsrF5M3egiuKgFnZBkZz7jnJ4BaZgPFxjf/+9NbANoUKJbQgGw/jOw5oLY6xye2+HQlR8Cqx8NU9piyVw6cvU0LeuwkIC5KlqbSlWydevcqI3ET1qUyzoGTz+ssrsCc99mRc2i4xNxESuzmlxNi3SBFSomXWmG+K9FkJaP9Q3XK6DILInvaodNj5wMu5ZVq6IqS15DkVK1sQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vivo.com; dmarc=pass action=none header.from=vivo.com; dkim=pass header.d=vivo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vivo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=aTMcIlgrXQk6v4nx3zXQZnQhyZVBHQ0XSHnnKB6A4pc=; b=ld2cezoL0zo09MamKyPaf6ix0zJUdmn5kodeX9MKEHJ4jp385w1b39pETBCePhb30w0NZIMr7Jw88/RiIYDeTVy3JRB20vfJILYvYom6OzNlMGqYabF4fWDWb0VCaaGk/fe6uPSGDhXjr5gAuFT/RHyT2DAR8Mqh9fJz1psKR/sey7NQwbcDlGcnkGbFWnIFRQi77kyY9j6TrYnrKq2uPuI3i0gvXKfzFV9dZMsqIoQi8YVScxEGzqlo3kLCI4mdFyhM76nVR56xfV2IPH3LlcXmMn3deDuGExNs2YITXQq3bvt1z7l0CO8AAuPaiNQqoWVmKVkqMc1qkL6ahjbThQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from TYZPR06MB6263.apcprd06.prod.outlook.com (2603:1096:400:33d::14) by JH0PR06MB7030.apcprd06.prod.outlook.com (2603:1096:990:6d::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.22; Wed, 21 Aug 2024 11:22:11 +0000 Received: from TYZPR06MB6263.apcprd06.prod.outlook.com ([fe80::bd8:d8ed:8dd5:3268]) by TYZPR06MB6263.apcprd06.prod.outlook.com ([fe80::bd8:d8ed:8dd5:3268%6]) with mapi id 15.20.7875.019; Wed, 21 Aug 2024 11:22:11 +0000 From: Yang Ruibin <11162571@vivo.com> To: Andrew Lunn , Sebastian Hesselbarth , Gregory Clement , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: opensource.kernel@vivo.com, Yang Ruibin <11162571@vivo.com> Subject: [PATCH v1] drivers:bus:Fix the NULL vs IS_ERR() bug for debugfs_create_dir() Date: Wed, 21 Aug 2024 07:21:30 -0400 Message-Id: <20240821112131.6004-1-11162571@vivo.com> X-Mailer: git-send-email 2.34.1 X-ClientProxiedBy: TYCP286CA0080.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:2b3::10) To TYZPR06MB6263.apcprd06.prod.outlook.com (2603:1096:400:33d::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYZPR06MB6263:EE_|JH0PR06MB7030:EE_ X-MS-Office365-Filtering-Correlation-Id: c7e1c5cb-6906-42dd-1f2d-08dcc1d36e26 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|376014|52116014|1800799024|38350700014|81742002; X-Microsoft-Antispam-Message-Info: baKanrzAMipKLFAQoVzC497FG0DKP3VyOK6UY4FtIWOaXie9v+yIgdaMaZyS9ykvO8Red1FTpdZSB4SAaZwnYyPjddhVUS6lbCfO/T8+rr4pnRrkaHTSr9CLNXwcvGUMjFUHQeLh/05tLJyWD+p6Kq1leH4dfmnPx9mRL+N2tTIZer/uB5kzsAHFagd7rB0ycu3rBOywqd/XQtSCkmZQYFDxdUJ9f3wPnCu/41ss3O1ep685drP/3R9kTncFZzXVtpKRsm2SsNbP9jcF630cF6r+ytG03Px0Of2rXJGk5TLZtWGNs/Nep9PVh8HDpcm4XXMz8c6EZs5408CcDRVsem/ztQTc+xP59KvrVFYUMI1n+XphrnNv1iC1m6i80QbX5ssMSD/wmhBL2Zamffd0t9bOhGERIghtEk23zebHRQ01BbrhzcdktAISYnjjRysQxw+azmQ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cprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(376014)(52116014)(1800799024)(38350700014)(81742002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: GPymSuVPehA53ZxO+FogjD/z2NLMEjLlcTpd8FraHK0PAJJJqdQm700mOCwpTZJgxDpCGXwVHryXeBbbtZgT5VNOaFlEJfR81kDii1nKKYFH53w3b6x7no65XHgbuDKYh5GcBJVPth6+hzGlzfCYwWo2rNr3UAzHDvMNac7YVNN/8ZYFx6pr0dDGJbvR5ZbPmA3Q6yJ4NSvumf9AZjzH45DGf64LkgFsYu7EgI6sqUJF264AfVl+idBukd54gEYexE0oiIcrkoWEmtpFK/nL7qXQteMICDjeOAI0FTcM96YrprxEw9Xqz7c4ZOJ09AsiVEgT6b5OovWl3qt6s2OvwbcE1fLHccfnL3y/ehX/GsrkhMOvfKm3Kz3++FKSJfUK+97l2Sx6Kv7L7IHxRLW3T3h7z5NeYkuzZvZHKF5JHh4jbNFvKOsJO7H1kGyrPn9fVfn6/OucRBEZZDCjvIo3vMkn020mW3CPLEv9ED/Ty/y+1XG8Wy5BgcjI/L8Zq4xgHDr2LnMYmb+vfZiH24lHM08FCE50xp6HrneKc0eMpmw7YFqIFTZTeYAzLf/IPquaw/0HI2Wl+WT8Ot6ikvbLKdCqwpi1A2qEs0KRILCJFT/lHWatCMSh0snfrneIMDLGXNUFMLOpJETvlEVKS2GClGskKRInmItETbOmFr73dAixS6LPFCLcpoWKNinbSEurrAICrCCE6Lpw1sqlaIUr0hPzZXh1hWGUn+cJYcBvmVnxR6BQpMrw7M5em6siNvBizrPuoXt2aJcUrGsYuO172/zHf/LZsPDAaaH3w9W/+m7Mu3MSRHFlILbs/FxQRY3IFp+eMkfOkpUjVlj6/umoUpUGD2quWVMpeCLn7Ie0+nSM6s3YvExbTjnjAbMxwAWZfQZOLMPT/Q9aN3J8qjsrj6ztdVO3yfdJ7glseblqPNdZtc0agSKQigloH38o2GkXU4WUS2dWjOizB1c+/1QctFE9OxRqftaErhFWMFkhhBuM2qol7vAz/JRjnHqqKN71EK5DdR66h79wvWVaoVO/jH/XIMJjfNogR9/lHjtOrWymA2QH2DILSVcHYPzbE1QvSfWJCGyJ1KfYZQKeb69DHXEhX7E/OfTu7CW3g4RzKHTj4s3bBYOm2zAOeMftiTLYUrkoJ+zwPnRZ1HjtwWo/9IhAXzqp18EoYwqqWOW7RRDVpRv408I+YcKCykKo5MiuuAhhuNw0QWHFApcKlPxAdNVqqnle6nuJO0q5vAfkRU4HzpQFbAyTKq2NDJRgrP0tFQsh/p38UG2qdxF1sbhYZugrOzZnWe+z8lpdOaJBAPouaHN9zg9pxFaKsFnCCqm3OSi+JgPEd/Yprrr91P7KCmjAvQxG89RTlxk9FxcnVwrklwthkK7slC88x4AfHP78TYE1GqE6n4tc7Dj//WENrZQ5clXLD3fBEAyUKQrWt0Z4WNxGacuuvssxXaXNM/Lq0GXsNUfCeDfoShtORcJ/RU07qejZAJ3JL6rIlw2XhvCRXuP0+ysRsKlBVYioO6npZl56byjPckyjXL32FQpqT99h+xf/qZOYmtDEEaQK9Z1TfA+CRJGBJ5QHGfA6BD18 X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: c7e1c5cb-6906-42dd-1f2d-08dcc1d36e26 X-MS-Exchange-CrossTenant-AuthSource: TYZPR06MB6263.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Aug 2024 11:21:41.2937 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 923e42dc-48d5-4cbe-b582-1a797a6412ed X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: JSokrn1cmdZQvUtihylIC0orntsuv7jmSfZteVzH27kf4RxRGV6OBXUO0R5j4K29QwUHSkKk1Uh0RyriXWA0iw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: JH0PR06MB7030 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240821_042231_507365_46AC8E12 X-CRM114-Status: GOOD ( 10.06 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The debugfs_create_dir() function returns error pointers. It never returns NULL. So use IS_ERR() to check it. Signed-off-by: Yang Ruibin <11162571@vivo.com> --- drivers/bus/mvebu-mbus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/bus/mvebu-mbus.c b/drivers/bus/mvebu-mbus.c index 3c99d72087eb..42621838ba75 100644 --- a/drivers/bus/mvebu-mbus.c +++ b/drivers/bus/mvebu-mbus.c @@ -995,13 +995,13 @@ static __init int mvebu_mbus_debugfs_init(void) s->debugfs_root = debugfs_create_dir("mvebu-mbus", NULL); if(IS_ERR(s->debugfs_root)) return PTR_ERR(s->debugfs_root); + s->debugfs_sdram = debugfs_create_file("sdram", S_IRUGO, s->debugfs_root, NULL, &mvebu_sdram_debug_fops); s->debugfs_devs = debugfs_create_file("devices", S_IRUGO, s->debugfs_root, NULL, &mvebu_devs_debug_fops); - } return 0; }