linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] spi: remove return value check of debugfs_create_dir()
@ 2023-04-23  6:11 Yingsha Xu
  2023-04-24 11:54 ` Mark Brown
  0 siblings, 1 reply; 12+ messages in thread
From: Yingsha Xu @ 2023-04-23  6:11 UTC (permalink / raw)
  To: Serge Semin, Mark Brown
  Cc: hust-os-kernel-patches, Yingsha Xu, linux-spi, linux-kernel

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


^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2023-04-25  5:31 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-23  6:11 [PATCH] spi: remove return value check of debugfs_create_dir() Yingsha Xu
2023-04-24 11:54 ` 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).