Re: [PATCH v2 01/18] ata: libata: allow ata_scsi_set_sense() to not set CHECK_CONDITION

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

 



>  void ata_scsi_set_sense(struct ata_device *dev, struct scsi_cmnd *cmd,
> -			u8 sk, u8 asc, u8 ascq)
> +			bool check_condition, u8 sk, u8 asc, u8 ascq)
>  {
>  	bool d_sense = (dev->flags & ATA_DFLAG_D_SENSE);
>  
>  	if (!cmd)
>  		return;
>  
> -	scsi_build_sense(cmd, d_sense, sk, asc, ascq);
> +	scsi_build_sense_buffer(d_sense, cmd->sense_buffer, sk, asc, ascq);
> +	if (check_condition)
> +		set_status_byte(cmd, SAM_STAT_CHECK_CONDITION);
>  }

Adding a bool parameter do do something conditional at the end
of a function is always a bad idea.  Just split out a
__ata_scsi_set_sense helper that doesn't set the flag.



[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