From: Guenter Roeck <linux@roeck-us.net>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Ugur Usug <Ugur.Usug@maximintegrated.com>,
Jean Delvare <jdelvare@suse.com>,
linux-hwmon@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] hwmon: (pmbus/max20730) delete some dead code
Date: Fri, 23 Oct 2020 14:14:10 -0700 [thread overview]
Message-ID: <20201023211410.GA28103@roeck-us.net> (raw)
In-Reply-To: <20201022070659.GA2817762@mwanda>
On Thu, Oct 22, 2020 at 10:06:59AM +0300, Dan Carpenter wrote:
> The debugfs_create_dir() function never returns NULL. Normal users are
> not supposed to check the return value so the correct fix is just to
> delete this check.
>
> In the case where the debugfs_create_dir() fails, the function returns
> NULL. The other debugfs function check for NULL directory and handle
> it.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Applied.
Thanks,
Guenter
> ---
> drivers/hwmon/pmbus/max20730.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/drivers/hwmon/pmbus/max20730.c b/drivers/hwmon/pmbus/max20730.c
> index be83b98411c7..00fea16acab4 100644
> --- a/drivers/hwmon/pmbus/max20730.c
> +++ b/drivers/hwmon/pmbus/max20730.c
> @@ -328,8 +328,6 @@ static int max20730_init_debugfs(struct i2c_client *client,
> return -ENOENT;
>
> max20730_dir = debugfs_create_dir(client->name, debugfs);
> - if (!max20730_dir)
> - return -ENOENT;
>
> for (i = 0; i < MAX20730_DEBUGFS_NUM_ENTRIES; ++i)
> psu->debugfs_entries[i] = i;
prev parent reply other threads:[~2020-10-23 21:14 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-22 7:06 [PATCH] hwmon: (pmbus/max20730) delete some dead code Dan Carpenter
2020-10-23 21:14 ` Guenter Roeck [this message]
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=20201023211410.GA28103@roeck-us.net \
--to=linux@roeck-us.net \
--cc=Ugur.Usug@maximintegrated.com \
--cc=dan.carpenter@oracle.com \
--cc=jdelvare@suse.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-hwmon@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox