lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YOK1Fq45P/DeqxAA@kroah.com>
Date:   Mon, 5 Jul 2021 09:30:30 +0200
From:   Greg KH <gregkh@...uxfoundation.org>
To:     Dipen Patel <dipenp@...dia.com>
Cc:     thierry.reding@...il.com, jonathanh@...dia.com,
        linux-kernel@...r.kernel.org, linux-tegra@...r.kernel.org,
        linux-gpio@...r.kernel.org, linus.walleij@...aro.org,
        bgolaszewski@...libre.com, warthog618@...il.com,
        devicetree@...r.kernel.org, linux-doc@...r.kernel.org,
        robh+dt@...nel.org
Subject: Re: [RFC 02/11] drivers: Add HTE subsystem

On Fri, Jun 25, 2021 at 04:55:23PM -0700, Dipen Patel wrote:
> +static void hte_chip_dbgfs_init(struct hte_device *gdev)
> +{
> +	const struct hte_chip *chip = gdev->chip;
> +	const char *name = chip->name ? chip->name : dev_name(chip->dev);
> +
> +	gdev->dbg_root = debugfs_create_dir(name, hte_root);
> +	if (!gdev->dbg_root)
> +		return;

No need to check for this, if it fails, your other debugfs calls
will handle it just fine.


> +
> +	debugfs_create_atomic_t("ts_requested", 0444, gdev->dbg_root,
> +				&gdev->ts_req);
> +	debugfs_create_u32("total_ts", 0444, gdev->dbg_root,
> +			   &gdev->nlines);
> +}
> +
> +static void hte_ts_dbgfs_init(const char *name, struct hte_ts_info *ei)
> +{
> +	if (!ei->gdev->dbg_root || !name)
> +		return;
> +
> +	ei->ts_dbg_root = debugfs_create_dir(name, ei->gdev->dbg_root);
> +	if (!ei->ts_dbg_root)
> +		return;

Again, no need to check.

> +
> +	debugfs_create_size_t("ts_buffer_depth", 0444, ei->ts_dbg_root,
> +			      &ei->buf->datum_len);
> +	debugfs_create_size_t("ts_buffer_watermark", 0444, ei->ts_dbg_root,
> +			      &ei->buf->watermark);
> +	debugfs_create_atomic_t("dropped_timestamps", 0444, ei->ts_dbg_root,
> +				&ei->dropped_ts);
> +}
> +
> +static inline void hte_dbgfs_deinit(struct dentry *root)
> +{
> +	if (!root)
> +		return;

No need to check this.

> +
> +	debugfs_remove_recursive(root);

Do not wrap a single call with another call :)


thanks,

greg k-h

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ