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: <ZBHeJOlwKD4v41kC@infradead.org>
Date:   Wed, 15 Mar 2023 08:03:00 -0700
From:   Christoph Hellwig <hch@...radead.org>
To:     Thomas Weißschuh <linux@...ssschuh.net>
Cc:     Jens Axboe <axboe@...nel.dk>, linux-block@...r.kernel.org,
        linux-kernel@...r.kernel.org,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        "Martin K. Petersen" <martin.petersen@...cle.com>
Subject: Re: [PATCH v2 2/4] blk-integrity: convert to struct device_attribute

> +		container_of(attr, struct device_attribute, attr);
>  	ssize_t ret = 0;
>  
> +	if (dev_attr->store)
> +		ret = dev_attr->store(dev, dev_attr, page, count);
>  
>  	return ret;

This can be simplified to:

	if (!rev_attr->store)
		return 0;
	return dev_attr->store(dev, dev_attr, page, count);

(I'm still confused why 0 is the right return value here, but that's not
 new in your patch, so better don't rock that boat).

> +static ssize_t format_show(struct device *dev, struct device_attribute *attr, char *page)

Please avoid the overly long line here. an in the other methods.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ