[Stgt-devel] [Patch 1/8 ] Setup .device_init, device_shutdown & device_config to the device template.

FUJITA Tomonori fujita.tomonori
Wed May 30 02:11:27 CEST 2007


Thanks for the patches. Sorry for the delay.

> diff --git a/usr/mmc.c b/usr/mmc.c
> index e9cc479..d53d0f3 100644
> --- a/usr/mmc.c
> +++ b/usr/mmc.c
> @@ -121,10 +121,24 @@ static int mmc_read_capacity(int host_no, struct scsi_cmd *cmd)
>  	return SAM_STAT_GOOD;
>  }
>  

trailing spaces


> +static int device_mmc_init(struct scsi_lu *lu)
> +{
> +	lu->d_sense = 1;
> +	return 0;
> +}
> +
> +static int device_mmc_shutdown(struct scsi_lu *lu)
> +{
> +	return 0;
> +}

In general, the kernel uses init/exit pair, I guess. So I prefer it.


>  struct device_type_template mmc_template = {
>  	.type	= TYPE_ROM,
>  	.name	= "cdrom/dvd",
>  	.pid	= "VIRTUAL-CDROM",
> +	.device_init = device_mmc_init,
> +	.device_shutdown = device_mmc_shutdown,
> +	.device_config = spc_device_config,

lu_init/lu_exit/lu_config looks better?

Yeah, it would be better to rename device_* functions too. I take care
about that.


>  	.ops	= {
>  		{spc_test_unit,},
>  		{spc_illegal_op,},
> diff --git a/usr/osd.c b/usr/osd.c
> index 46bf0a0..64e7b2a 100644
> --- a/usr/osd.c
> +++ b/usr/osd.c
> @@ -145,15 +145,22 @@ static int osd_varlen_cdb(int host_no, struct scsi_cmd *cmd)
>  	return cmd->c_target->bst->bs_cmd_submit(cmd);
>  }
>  

trailing spaces

All the patches seem to have tons of trailing spaces.


> +int spc_mode_sense(int host_no, struct scsi_cmd *cmd, struct list_head * mode_head)
> +{
> +	int		ret = SAM_STAT_GOOD, len;

Should be:

int ret = SAM_STAT_GOOD, len;


> +	uint8_t		pcode = cmd->scb[2] & 0x3f;
> +	uint64_t	size;
> +	uint8_t		*data = NULL;
> +	unsigned char	key = ILLEGAL_REQUEST;
> +	uint16_t	asc_ascq = E_INVALID_FIELD_IN_CDB;
> +	struct	mode	* m;

Can you read the Linux coding style document, fix and resubmit the
patches? If this is the last patchset that you send (hopefully not),
I'll fix them this time.

Please try `git-apply --whitespace=error` before submitting a patch to
avoid trailing spaces.



More information about the stgt mailing list