mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
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 v4 08/10] ufs: sysfs: unit descriptor
Date: Fri, 2 Feb 2018 00:38:25 +0000	[thread overview]
Message-ID: <1517531903.2746.33.camel@wdc.com> (raw)
In-Reply-To: <1517501746-19075-9-git-send-email-stanislav.nijnikov@wdc.com>

On Thu, 2018-02-01 at 18:15 +0200, Stanislav Nijnikov wrote:
> diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c
> index cbc0fe2..69a6a1f 100644
> --- a/drivers/scsi/scsi_sysfs.c
> +++ b/drivers/scsi/scsi_sysfs.c
> @@ -1309,6 +1309,14 @@ int scsi_sysfs_add_sdev(struct scsi_device *sdev)
>  		}
>  	}
>  
> +	if (sdev->host->hostt->sdev_groups) {
> +		error = sysfs_create_groups(&sdev->sdev_gendev.kobj,
> +			(const struct attribute_group **)
> +			sdev->host->hostt->sdev_groups);
> +			if (error)
> +				return error;
> +	}
> +
>  	scsi_autopm_put_device(sdev);
>  	return error;
>  }
> @@ -1326,6 +1334,12 @@ 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,
> +			(const struct attribute_group **)
> +			sdev->host->hostt->sdev_groups);
> +	}
> +
>  	if (sdev->is_visible) {
>  		/*
>  		 * If scsi_internal_target_block() is running concurrently,

Please split this patch into two patches, namely one patch that introduces
the sdev_groups attribute in the SCSI core and a second patch that does not
modify the SCSI core but only the UFS driver. That will make these changes
easier to review.

Additionally, it seems wrong to me to cast the third argument of
sysfs_create_groups() and sysfs_remove_groups() from a non-const to a const
pointer. Please consider to declare the sdev_groups member const and also
the corresponding data structures in the UFS driver.

Thanks,

Bart.

  reply	other threads:[~2018-02-02  0:38 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-01 16:15 [PATCH v4 00/10] ufs: sysfs: read-only access to device descriptors, attributes and flags Stanislav Nijnikov
2018-02-01 16:15 ` [PATCH v4 01/10] ufs: sysfs: attribute group for existing sysfs entries Stanislav Nijnikov
2018-02-01 16:59   ` Greg KH
2018-02-04 12:29     ` Stanislav Nijnikov
2018-02-04 12:33       ` Greg KH
2018-02-04 13:09         ` Stanislav Nijnikov
2018-02-04 13:15           ` Greg KH
2018-02-01 16:15 ` [PATCH v4 02/10] ufs: sysfs: device descriptor Stanislav Nijnikov
2018-02-01 17:00   ` Greg KH
2018-02-02  0:25   ` Bart Van Assche
2018-02-02  7:17     ` gregkh
2018-02-02 16:32       ` Bart Van Assche
2018-02-04  9:03         ` Stanislav Nijnikov
2018-02-04 10:44           ` gregkh
2018-02-02  0:29   ` Bart Van Assche
2018-02-01 16:15 ` [PATCH v4 03/10] ufs: sysfs: interconnect descriptor Stanislav Nijnikov
2018-02-01 17:01   ` Greg KH
2018-02-01 16:15 ` [PATCH v4 04/10] ufs: sysfs: geometry descriptor Stanislav Nijnikov
2018-02-01 16:15 ` [PATCH v4 05/10] ufs: sysfs: health descriptor Stanislav Nijnikov
2018-02-01 16:15 ` [PATCH v4 06/10] ufs: sysfs: power descriptor Stanislav Nijnikov
2018-02-01 16:15 ` [PATCH v4 07/10] ufs: sysfs: string descriptors Stanislav Nijnikov
2018-02-01 16:15 ` [PATCH v4 08/10] ufs: sysfs: unit descriptor Stanislav Nijnikov
2018-02-02  0:38   ` Bart Van Assche [this message]
2018-02-01 16:15 ` [PATCH v4 09/10] ufs: sysfs: flags Stanislav Nijnikov
2018-02-01 16:15 ` [PATCH v4 10/10] ufs: sysfs: attributes Stanislav Nijnikov
2018-02-01 17:03   ` Greg KH
2018-02-01 16:48 ` [PATCH v4 00/10] ufs: sysfs: read-only access to device descriptors, attributes and flags Eric W. Biederman

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=1517531903.2746.33.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®