From patchwork Sun Apr 23 06:11:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yingsha Xu X-Patchwork-Id: 677110 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EA524C77B73 for ; Sun, 23 Apr 2023 06:12:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230153AbjDWGMw (ORCPT ); Sun, 23 Apr 2023 02:12:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46608 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229516AbjDWGMv (ORCPT ); Sun, 23 Apr 2023 02:12:51 -0400 Received: from hust.edu.cn (mail.hust.edu.cn [202.114.0.240]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 942E42700; Sat, 22 Apr 2023 23:12:48 -0700 (PDT) Received: from localhost.localdomain ([222.20.126.128]) (user=ysxu@hust.edu.cn mech=LOGIN bits=0) by mx1.hust.edu.cn with ESMTP id 33N6Bugb007746-33N6Bugc007746 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO); Sun, 23 Apr 2023 14:12:00 +0800 From: Yingsha Xu To: Serge Semin , Mark Brown Cc: hust-os-kernel-patches@googlegroups.com, Yingsha Xu , linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] spi: remove return value check of debugfs_create_dir() Date: Sun, 23 Apr 2023 14:11:54 +0800 Message-Id: <20230423061155.2540-1-ysxu@hust.edu.cn> X-Mailer: git-send-email 2.17.1 X-FEAS-AUTH-USER: ysxu@hust.edu.cn Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org Smatch complains that: dw_spi_debugfs_init() warn: 'dws->debugfs' is an error pointer or valid Debugfs checks are generally not supposed to be checked for errors and it is not necessary here. Just delete the dead code. Signed-off-by: Yingsha Xu Reviewed-by: Dongliang Mu --- drivers/spi/spi-dw-core.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/spi/spi-dw-core.c b/drivers/spi/spi-dw-core.c index c3bfb6c84cab..64eb6dcdaac3 100644 --- a/drivers/spi/spi-dw-core.c +++ b/drivers/spi/spi-dw-core.c @@ -63,8 +63,6 @@ static int dw_spi_debugfs_init(struct dw_spi *dws) snprintf(name, 32, "dw_spi%d", dws->master->bus_num); dws->debugfs = debugfs_create_dir(name, NULL); - if (!dws->debugfs) - return -ENOMEM; dws->regset.regs = dw_spi_dbgfs_regs; dws->regset.nregs = ARRAY_SIZE(dw_spi_dbgfs_regs);