From: Bart Van Assche <Bart.VanAssche@wdc.com>
To: "linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"jaegeuk@kernel.org" <jaegeuk@kernel.org>,
"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
Stanislav Nijnikov <Stanislav.Nijnikov@wdc.com>
Cc: Alex Lemberg <Alex.Lemberg@wdc.com>
Subject: Re: [PATCH v5 08/11] scsi: host template attribute groups
Date: Tue, 6 Feb 2018 19:06:12 +0000 [thread overview]
Message-ID: <1517943971.2905.8.camel@wdc.com> (raw)
In-Reply-To: <1517933183-30892-9-git-send-email-stanislav.nijnikov@wdc.com>
On Tue, 2018-02-06 at 18:06 +0200, Stanislav Nijnikov wrote:
> + if (sdev->host->hostt->sdev_groups) {
> + error = sysfs_create_groups(&sdev->sdev_gendev.kobj,
> + sdev->host->hostt->sdev_groups);
> + if (error)
> + return error;
> + }
Please follow the indentation style that is used elsewhere in the kernel and
move the sdev->host->hostt->sdev_groups argument to the right such that it
starts one position to the right of the sysfs_create_groups() opening
parenthesis. Please also indent the if (error) statement correctly.
> @@ -1326,6 +1333,11 @@ void __scsi_remove_device(struct scsi_device *sdev)
> if (sdev->sdev_state == SDEV_DEL)
> return;
>
> + if (sdev->host->hostt->sdev_groups) {
> + sysfs_remove_groups(&sdev->sdev_gendev.kobj,
> + sdev->host->hostt->sdev_groups);
> + }
If sdev->is_visible is false then the device_add() call for sdev->sdev_gendev
may have failed so calling sysfs_remove_groups() is not necessary. Please move
this call down to just before the device_del(dev) since that call also removes
sysfs attributes. Additionally, I think that checkpatch will complain about the
above code and will report that braces are not necessary for single-line
statements?
Thanks,
Bart.
next prev parent reply other threads:[~2018-02-06 19:06 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-06 16:06 [PATCH v5 00/11] ufs: sysfs: read-only access to device Stanislav Nijnikov
2018-02-06 16:06 ` [PATCH v5 01/11] scsi: ufs: sysfs: attribute group for existing sysfs entries Stanislav Nijnikov
2018-02-12 1:06 ` Jaegeuk Kim
2018-02-12 9:31 ` Philippe Ombredanne
2018-02-12 11:06 ` Stanislav Nijnikov
2018-02-06 16:06 ` [PATCH v5 02/11] scsi: ufs: sysfs: device descriptor Stanislav Nijnikov
2018-02-12 1:07 ` Jaegeuk Kim
2018-02-12 11:21 ` Stanislav Nijnikov
2018-02-12 18:00 ` Jaegeuk Kim
2018-02-06 16:06 ` [PATCH v5 03/11] scsi: ufs: sysfs: interconnect descriptor Stanislav Nijnikov
2018-02-06 16:06 ` [PATCH v5 04/11] scsi: ufs: sysfs: geometry descriptor Stanislav Nijnikov
2018-02-06 16:06 ` [PATCH v5 05/11] scsi: ufs: sysfs: health descriptor Stanislav Nijnikov
2018-02-06 16:06 ` [PATCH v5 06/11] scsi: ufs: sysfs: power descriptor Stanislav Nijnikov
2018-02-06 16:06 ` [PATCH v5 07/11] scsi: ufs: sysfs: string descriptors Stanislav Nijnikov
2018-02-06 16:06 ` [PATCH v5 08/11] scsi: host template attribute groups Stanislav Nijnikov
2018-02-06 19:06 ` Bart Van Assche [this message]
2018-02-06 16:06 ` [PATCH v5 09/11] scsi: ufs: sysfs: unit descriptor Stanislav Nijnikov
2018-02-06 16:06 ` [PATCH v5 10/11] scsi: ufs: sysfs: flags Stanislav Nijnikov
2018-02-06 16:06 ` [PATCH v5 11/11] scsi: ufs: sysfs: attributes Stanislav Nijnikov
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=1517943971.2905.8.camel@wdc.com \
--to=bart.vanassche@wdc.com \
--cc=Alex.Lemberg@wdc.com \
--cc=Stanislav.Nijnikov@wdc.com \
--cc=gregkh@linuxfoundation.org \
--cc=jaegeuk@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.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
all inboxes | Powered by JetHome®