All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yingsha Xu <ysxu@hust.edu.cn>
To: Serge Semin <fancer.lancer@gmail.com>, Mark Brown <broonie@kernel.org>
Cc: hust-os-kernel-patches@googlegroups.com,
	Yingsha Xu <ysxu@hust.edu.cn>,
	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	[thread overview]
Message-ID: <20230423061155.2540-1-ysxu@hust.edu.cn> (raw)

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 <ysxu@hust.edu.cn>
Reviewed-by: Dongliang Mu <dzm91@hust.edu.cn>
---
 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);
-- 
2.17.1


             reply	other threads:[~2023-04-23  6:12 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-23  6:11 Yingsha Xu [this message]
2023-04-24 11:54 ` [PATCH] spi: remove return value check of debugfs_create_dir() Mark Brown
2023-04-24 12:20   ` Peter Enderborg
2023-04-24 12:32     ` Mark Brown
2023-04-24 12:53       ` Greg Kroah-Hartman
2023-04-24 13:00         ` Mark Brown
2023-04-24 13:08           ` Greg Kroah-Hartman
2023-04-24 13:17             ` Mark Brown
2023-04-24 13:17         ` Peter Enderborg
2023-04-24 13:22           ` Greg Kroah-Hartman
2023-04-24 13:54             ` Peter Enderborg
2023-04-25  5:31               ` Greg Kroah-Hartman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230423061155.2540-1-ysxu@hust.edu.cn \
    --to=ysxu@hust.edu.cn \
    --cc=broonie@kernel.org \
    --cc=fancer.lancer@gmail.com \
    --cc=hust-os-kernel-patches@googlegroups.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.