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@xxxxxxxxxxx> Reviewed-by: Dongliang Mu <dzm91@xxxxxxxxxxx> --- 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