From: Christoph Hellwig <hch@infradead.org>
To: "Thomas Weißschuh" <linux@weissschuh.net>
Cc: Jens Axboe <axboe@kernel.dk>,
linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
"Martin K. Petersen" <martin.petersen@oracle.com>
Subject: Re: [PATCH v2 2/4] blk-integrity: convert to struct device_attribute
Date: Wed, 15 Mar 2023 08:03:00 -0700 [thread overview]
Message-ID: <ZBHeJOlwKD4v41kC@infradead.org> (raw)
In-Reply-To: <20230309-kobj_release-gendisk_integrity-v2-2-761a50d71900@weissschuh.net>
> + 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.
next prev parent reply other threads:[~2023-03-15 15:03 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-10 22:40 [PATCH v2 0/4] blk-integrity: drop integrity_kobj from gendisk Thomas Weißschuh
2023-03-10 22:40 ` [PATCH v2 1/4] blk-integrity: use sysfs_emit Thomas Weißschuh
2023-03-15 15:00 ` Christoph Hellwig
2023-03-10 22:40 ` [PATCH v2 2/4] blk-integrity: convert to struct device_attribute Thomas Weißschuh
2023-03-15 15:03 ` Christoph Hellwig [this message]
2023-03-18 16:54 ` Thomas Weißschuh
2023-03-10 22:40 ` [PATCH v2 3/4] blk-integrity: register sysfs attributes on struct device Thomas Weißschuh
2023-03-15 15:06 ` Christoph Hellwig
2023-03-18 16:56 ` Thomas Weißschuh
2023-03-10 22:40 ` [PATCH v2 4/4] blk-integrity: drop integrity_kobj from gendisk Thomas Weißschuh
2023-03-15 15:07 ` Christoph Hellwig
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=ZBHeJOlwKD4v41kC@infradead.org \
--to=hch@infradead.org \
--cc=axboe@kernel.dk \
--cc=gregkh@linuxfoundation.org \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@weissschuh.net \
--cc=martin.petersen@oracle.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 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).