All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Li Zetao <lizetao1@huawei.com>
Cc: hverkuil-cisco@xs4all.nl, mchehab@kernel.org,
	laurent.pinchart+renesas@ideasonboard.com, ricardo@marliere.net,
	ruanjinjie@huawei.com, linux-media@vger.kernel.org
Subject: Re: [PATCH -next v2 2/2] media: siano: remove redundant null pointer checks in cec_devnode_init()
Date: Sat, 7 Sep 2024 07:48:57 +0200	[thread overview]
Message-ID: <2024090737-pavement-santa-b360@gregkh> (raw)
In-Reply-To: <20240907034400.3693797-2-lizetao1@huawei.com>

On Sat, Sep 07, 2024 at 11:44:00AM +0800, Li Zetao wrote:
> Since the debugfs_create_dir() never returns a null pointer, checking
> the return value for a null pointer is redundant, Remove this check
> since debugfs_create_file can handle IS_ERR pointers.
> 
> Signed-off-by: Li Zetao <lizetao1@huawei.com>
> ---
> v1 -> v2: Remove this check since debugfs_create_file can
> handle IS_ERR pointers.
> v1:
> https://lore.kernel.org/all/20240903143607.2004802-2-lizetao1@huawei.com/
> 
>  drivers/media/common/siano/smsdvb-debugfs.c | 4 ----
>  1 file changed, 4 deletions(-)
> 
> diff --git a/drivers/media/common/siano/smsdvb-debugfs.c b/drivers/media/common/siano/smsdvb-debugfs.c
> index 73990e469df9..9db38ae4ecee 100644
> --- a/drivers/media/common/siano/smsdvb-debugfs.c
> +++ b/drivers/media/common/siano/smsdvb-debugfs.c
> @@ -411,10 +411,6 @@ void smsdvb_debugfs_register(void)
>  	 * subsystem.
>  	 */
>  	d = debugfs_create_dir("smsdvb", usb_debug_root);
> -	if (IS_ERR_OR_NULL(d)) {
> -		pr_err("Couldn't create sysfs node for smsdvb\n");
> -		return;
> -	}
>  	smsdvb_debugfs_usb_root = d;

Why is d even needed here, just assign it to smsdvb_debugfs_usb_root
directly, right?

thanks,

greg k-h

  reply	other threads:[~2024-09-07  5:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-07  3:43 [PATCH -next v2 1/2] media: cec: remove redundant null pointer checks in cec_devnode_init() Li Zetao
2024-09-07  3:44 ` [PATCH -next v2 2/2] media: siano: " Li Zetao
2024-09-07  5:48   ` Greg KH [this message]
2024-09-09 11:49 ` [PATCH -next v2 1/2] media: cec: " Hans Verkuil
  -- strict thread matches above, loose matches on Subject: below --
2024-09-07  3:09 [PATCH net-next v2 00/10] net: Convert using devm_clk_get_enabled()/devm_clk_get_optional_enabled() Li Zetao
2024-09-07  3:10 ` [PATCH -next v2 2/2] media: siano: remove redundant null pointer checks in cec_devnode_init() Li Zetao
2024-09-07  3:10   ` Li Zetao

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=2024090737-pavement-santa-b360@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=hverkuil-cisco@xs4all.nl \
    --cc=laurent.pinchart+renesas@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=lizetao1@huawei.com \
    --cc=mchehab@kernel.org \
    --cc=ricardo@marliere.net \
    --cc=ruanjinjie@huawei.com \
    /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.