From: Patrice CHOTARD <patrice.chotard@st.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"linux-media@vger.kernel.org" <linux-media@vger.kernel.org>
Subject: Re: [PATCH] media: c8sectpfe: no need to check return value of debugfs_create functions
Date: Thu, 7 Nov 2019 09:58:46 +0000 [thread overview]
Message-ID: <e27c1351-3ca8-ccf3-bcb6-adab33be8889@st.com> (raw)
In-Reply-To: <20191107085238.GA1285658@kroah.com>
Hi
On 11/7/19 9:52 AM, Greg Kroah-Hartman wrote:
> When calling debugfs functions, there is no need to ever check the
> return value. The function can work or not, but the code logic should
> never do something different based on this.
>
> Cc: Patrice Chotard <patrice.chotard@st.com>
> Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
> Cc: linux-arm-kernel@lists.infradead.org
> Cc: linux-media@vger.kernel.org
> Cc: linux-kernel@vger.kernel.org
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> ---
> .../sti/c8sectpfe/c8sectpfe-debugfs.c | 26 +++----------------
> 1 file changed, 3 insertions(+), 23 deletions(-)
>
> diff --git a/drivers/media/platform/sti/c8sectpfe/c8sectpfe-debugfs.c b/drivers/media/platform/sti/c8sectpfe/c8sectpfe-debugfs.c
> index 8f0ddcbeed9d..301fa10f419b 100644
> --- a/drivers/media/platform/sti/c8sectpfe/c8sectpfe-debugfs.c
> +++ b/drivers/media/platform/sti/c8sectpfe/c8sectpfe-debugfs.c
> @@ -225,36 +225,16 @@ static const struct debugfs_reg32 fei_sys_regs[] = {
>
> void c8sectpfe_debugfs_init(struct c8sectpfei *fei)
> {
> - struct dentry *root;
> - struct dentry *file;
> -
> - root = debugfs_create_dir("c8sectpfe", NULL);
> - if (!root)
> - goto err;
> -
> - fei->root = root;
> -
> fei->regset = devm_kzalloc(fei->dev, sizeof(*fei->regset), GFP_KERNEL);
> if (!fei->regset)
> - goto err;
> + return;
>
> fei->regset->regs = fei_sys_regs;
> fei->regset->nregs = ARRAY_SIZE(fei_sys_regs);
> fei->regset->base = fei->io;
>
> - file = debugfs_create_regset32("registers", S_IRUGO, root,
> - fei->regset);
> - if (!file) {
> - dev_err(fei->dev,
> - "%s not able to create 'registers' debugfs\n"
> - , __func__);
> - goto err;
> - }
> -
> - return;
> -
> -err:
> - debugfs_remove_recursive(root);
> + fei->root = debugfs_create_dir("c8sectpfe", NULL);
> + debugfs_create_regset32("registers", S_IRUGO, fei->root, fei->regset);
> }
>
> void c8sectpfe_debugfs_exit(struct c8sectpfei *fei)
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
Thanks
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
prev parent reply other threads:[~2019-11-07 9:59 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-07 8:52 [PATCH] media: c8sectpfe: no need to check return value of debugfs_create functions Greg Kroah-Hartman
2019-11-07 9:58 ` Patrice CHOTARD [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=e27c1351-3ca8-ccf3-bcb6-adab33be8889@st.com \
--to=patrice.chotard@st.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@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;
as well as URLs for NNTP newsgroup(s).