All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Jay Fang <f.fangjian@huawei.com>
Cc: Mark Brown <broonie@kernel.org>,
	linux-spi@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [PATCH] spi: hisi-kunpeng: Delete some dead code
Date: Thu, 10 Jun 2021 13:06:17 +0300	[thread overview]
Message-ID: <YMHkGcroJwaBd1av@mwanda> (raw)

The debugfs_create_dir() function returns error pointers, it doesn't
return NULL.  But debugfs functions aren't supposed to be checked in
normal circumstancers where the driver doesn't dereference the pointer
itself.

Fixes: 2b2142f247eb ("spi: hisi-kunpeng: Add debugfs support")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/spi/spi-hisi-kunpeng.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/spi/spi-hisi-kunpeng.c b/drivers/spi/spi-hisi-kunpeng.c
index 58b823a16fc4..875f337a7836 100644
--- a/drivers/spi/spi-hisi-kunpeng.c
+++ b/drivers/spi/spi-hisi-kunpeng.c
@@ -167,8 +167,6 @@ static int hisi_spi_debugfs_init(struct hisi_spi *hs)
 
 	snprintf(name, 32, "hisi_spi%d", hs->bus_num);
 	hs->debugfs = debugfs_create_dir(name, NULL);
-	if (!hs->debugfs)
-		return -ENOMEM;
 
 	hs->regset.regs = hisi_spi_regs;
 	hs->regset.nregs = ARRAY_SIZE(hisi_spi_regs);
-- 
2.30.2


                 reply	other threads:[~2021-06-10 10:06 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=YMHkGcroJwaBd1av@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=broonie@kernel.org \
    --cc=f.fangjian@huawei.com \
    --cc=kernel-janitors@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.