From patchwork Tue Sep 3 14:36:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li Zetao X-Patchwork-Id: 103934 X-Patchwork-Delegate: hverkuil@xs4all.nl Received: from sv.mirrors.kernel.org ([139.178.88.99]) by linuxtv.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1slUXS-0006i3-0V for patchwork@linuxtv.org; Tue, 03 Sep 2024 14:29:47 +0000 Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 77C3A2856FB for ; Tue, 3 Sep 2024 14:29:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C2BD4143748; Tue, 3 Sep 2024 14:27:39 +0000 (UTC) X-Original-To: linux-media@vger.kernel.org Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B19C713F43B for ; Tue, 3 Sep 2024 14:27:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.187 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725373659; cv=none; b=t5/ZtVd5CbAPFT8u8YxuEHrTaRtEM3IY2tzTdWyg0JO7EWLaEdfNDbsAOx5HUbDls16PTDg7WaHd3e1wxEALC4tq5CX8QTbV6Tq7ja4Ko6FEr48w3cnoEBShSbnjxIcfLs/ENUn5W/aSsPtPRENA/SnHK4mp90NCsp6OSenHC7E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725373659; c=relaxed/simple; bh=pZFThl30fpXtDcnl8t3CWso1+6IangjT5I44T/p8NvU=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=oOSwICM6kths7F6S7KkWoZG0F0aM2xvgocwRCragNMzsx7yMKlcOj3MFG+YyIwHlCA8sId7wQ4nQbmE95t1f2784JDV+q9B1U7C+se8jqqLFE+i0bBSpK5Ug4x6YIde/dAhrF2wGqsTmuHkV6JNIXhWUoPxxo/+GkN/VCcbKrzU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.187 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.162.254]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4WynxT4xnHzyR1H; Tue, 3 Sep 2024 22:26:37 +0800 (CST) Received: from kwepemd500012.china.huawei.com (unknown [7.221.188.25]) by mail.maildlp.com (Postfix) with ESMTPS id 3FFE118010A; Tue, 3 Sep 2024 22:27:34 +0800 (CST) Received: from huawei.com (10.90.53.73) by kwepemd500012.china.huawei.com (7.221.188.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.34; Tue, 3 Sep 2024 22:27:33 +0800 From: Li Zetao To: , , , , CC: , , Subject: [PATCH -next 1/2] media: cec: remove redundant null pointer checks in cec_devnode_init() Date: Tue, 3 Sep 2024 22:36:06 +0800 Message-ID: <20240903143607.2004802-1-lizetao1@huawei.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To kwepemd500012.china.huawei.com (7.221.188.25) X-LSpam-Score: -7.3 (-------) X-LSpam-Report: No, score=-7.3 required=5.0 tests=ARC_SIGNED=0.001,ARC_VALID=-0.1,BAYES_00=-1.9,DMARC_QUAR=1.198,HEADER_FROM_DIFFERENT_DOMAINS=0.5,MAILING_LIST_MULTI=-1,RCVD_IN_DNSWL_MED=-2.3,RCVD_IN_VALIDITY_CERTIFIED=-3,RCVD_IN_VALIDITY_RPBL=1.31,RCVD_IN_VALIDITY_SAFE=-2,SPF_HELO_NONE=0.001,SPF_PASS=-0.001 autolearn=ham autolearn_force=no Since the debugfs_create_dir() never returns a null pointer, checking the return value for a null pointer is redundant, and using IS_ERR is safe enough. Signed-off-by: Li Zetao --- drivers/media/cec/core/cec-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/cec/core/cec-core.c b/drivers/media/cec/core/cec-core.c index e0756826d629..b4135447cdae 100644 --- a/drivers/media/cec/core/cec-core.c +++ b/drivers/media/cec/core/cec-core.c @@ -441,7 +441,7 @@ static int __init cec_devnode_init(void) #ifdef CONFIG_DEBUG_FS top_cec_dir = debugfs_create_dir("cec", NULL); - if (IS_ERR_OR_NULL(top_cec_dir)) { + if (IS_ERR(top_cec_dir)) { pr_warn("cec: Failed to create debugfs cec dir\n"); top_cec_dir = NULL; } From patchwork Tue Sep 3 14:36:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li Zetao X-Patchwork-Id: 103935 Received: from am.mirrors.kernel.org ([147.75.80.249]) by linuxtv.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1slUXY-0006ij-2V for patchwork@linuxtv.org; Tue, 03 Sep 2024 14:29:54 +0000 Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id A16161F28329 for ; Tue, 3 Sep 2024 14:29:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2B0F9153BD7; Tue, 3 Sep 2024 14:27:40 +0000 (UTC) X-Original-To: linux-media@vger.kernel.org Received: from szxga06-in.huawei.com (szxga06-in.huawei.com [45.249.212.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EF61414036F for ; Tue, 3 Sep 2024 14:27:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.32 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725373659; cv=none; b=qNZT5NkVUNFD7qD4QsA9EWeUBw2L4F0IgNGXnrSUS/PitzeKI45ufIdKqJF4JcSDzVOivwx4/XaS+rq+Sqr+x9EgUK83LkLXkMiu8F/AQuNka7mHm6GBLZDbt+LL1v3a4WqT+E5HiQFeBUKJ8+y2rhQK2XY0Gz5rjM0m7CU9dwU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725373659; c=relaxed/simple; bh=6LLZVLZVwzqPc7DQFWGl+PPhxmrYoGk9J5qMr8/MzOo=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=VzX3172P0NLb6YnbGIPQv5tH1oVOUMMWdN4Cloy+TPzWCHCCUTNdYoW4DLzjY2JT56/agENnRTBw+CenD5g7Y3IG/cWklLENHc6lhmNr8pQALEf9Q6CQMu2d2hsXL2dv0eT17vNoQ4T81c+ftzs/kqa/0uZ2Zm1fWPTkmyLD+vU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.88.214]) by szxga06-in.huawei.com (SkyGuard) with ESMTP id 4WynwG1gzrz1xwp2; Tue, 3 Sep 2024 22:25:34 +0800 (CST) Received: from kwepemd500012.china.huawei.com (unknown [7.221.188.25]) by mail.maildlp.com (Postfix) with ESMTPS id 99F5D1A016C; Tue, 3 Sep 2024 22:27:34 +0800 (CST) Received: from huawei.com (10.90.53.73) by kwepemd500012.china.huawei.com (7.221.188.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.34; Tue, 3 Sep 2024 22:27:34 +0800 From: Li Zetao To: , , , , CC: , , Subject: [PATCH -next 2/2] media: siano: remove redundant null pointer checks in cec_devnode_init() Date: Tue, 3 Sep 2024 22:36:07 +0800 Message-ID: <20240903143607.2004802-2-lizetao1@huawei.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240903143607.2004802-1-lizetao1@huawei.com> References: <20240903143607.2004802-1-lizetao1@huawei.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To kwepemd500012.china.huawei.com (7.221.188.25) X-LSpam-Score: -5.0 (-----) X-LSpam-Report: No, score=-5.0 required=5.0 tests=ARC_SIGNED=0.001,ARC_VALID=-0.1,BAYES_00=-1.9,DMARC_QUAR=1.198,HEADER_FROM_DIFFERENT_DOMAINS=0.5,MAILING_LIST_MULTI=-1,RCVD_IN_VALIDITY_CERTIFIED=-3,RCVD_IN_VALIDITY_RPBL=1.31,RCVD_IN_VALIDITY_SAFE=-2,SPF_HELO_NONE=0.001,SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no Since the debugfs_create_dir() never returns a null pointer, checking the return value for a null pointer is redundant, and using IS_ERR is safe enough. Signed-off-by: Li Zetao --- drivers/media/common/siano/smsdvb-debugfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/common/siano/smsdvb-debugfs.c b/drivers/media/common/siano/smsdvb-debugfs.c index 73990e469df9..325d674c74d9 100644 --- a/drivers/media/common/siano/smsdvb-debugfs.c +++ b/drivers/media/common/siano/smsdvb-debugfs.c @@ -411,7 +411,7 @@ void smsdvb_debugfs_register(void) * subsystem. */ d = debugfs_create_dir("smsdvb", usb_debug_root); - if (IS_ERR_OR_NULL(d)) { + if (IS_ERR(d)) { pr_err("Couldn't create sysfs node for smsdvb\n"); return; }