/* Return value: 1 if autosense was available / 0 if not  */
static int ipr_get_autosense(struct ipr_cmnd *ipr_cmd)
/* Return value: 1 if autosense was available / 0 if not  */
static int ipr_get_autosense(struct ipr_cmnd *ipr_cmd)
{
	struct ipr_ioasa *ioasa = &ipr_cmd->ioasa;
	if ((be32_to_cpu(ioasa->ioasc_specific) & IPR_AUTOSENSE_VALID) == 0)
		return 0;
	memcpy(ipr_cmd->scsi_cmd->sense_buffer, ioasa->auto_sense.data,
	       min_t(u16, be16_to_cpu(ioasa->auto_sense.auto_sense_len),
		   SCSI_SENSE_BUFFERSIZE));
	return 1;
}