Re: [PATCH] target: add support for START_STOP_UNIT SCSI opcode

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jul 21, 2015 at 03:07:53PM -0700, Spencer Baugh wrote:
> +static sense_reason_t
> +sbc_emulate_startstop(struct se_cmd *cmd)
> +{
> +	unsigned char *cdb = cmd->t_task_cdb;
> +
> +	/* From SBC-3:
> +	 * Immediate bit should be set since there is nothing to complete
> +	 * POWER CONDITION MODIFIER 0h
> +	 */

Mot of the target code mentions the exact document and section, e.g.

drivers/target/target_core_alua.c: * See sbc3r35 section 5.23
drivers/target/target_core_sbc.c:        * Set Thin Provisioning Enable bit following sbc3r22 in section
drivers/target/target_core_sbc.c:        * From sbc3r22.pdf section 5.48 XDWRITEREAD (10) command

Also if you fix thing up anyway the Linux style is to keep the opening
"/*" on a separate line.

> +	if (!(cdb[1] & 1) || (cdb[2] | cdb[3]))
> +		return TCM_INVALID_CDB_FIELD;

The mix of || and | here is odd, why not just:

 if (!(cdb[1] & 1) || cdb[2] || cdb[3])

> +	if (!(cdb[4] & 1) || ((cdb[4] & 2) | (cdb[4] & 4)))

Same here.

But except for this nitpicking the patch looks good:


Reviewed-by: Christoph Hellwig <hch@xxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux