Re: [PATCH 4/24][RFC] firewire & ieee1394: Simple convert to new scsi_eh_cpy_sense.

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

 



Boaz Harrosh wrote:
> --- a/drivers/ieee1394/sbp2.c
> +++ b/drivers/ieee1394/sbp2.c
> @@ -1672,8 +1673,11 @@ static int sbp2_send_command(struct sbp2_lu *lu, struct scsi_cmnd *SCpnt,
>   * Translates SBP-2 status into SCSI sense data for check conditions
>   */
>  static unsigned int sbp2_status_to_sense_data(unchar *sbp2_status,
> -					      unchar *sense_data)
> +					      struct scsi_cmnd *SCpnt)
>  {
> +	u8 sense_data[16];
> +
> +	memset(sense_data, 0, sizeof(sense_data));
>  	/* OK, it's pretty ugly... ;-) */
>  	sense_data[0] = 0x70;
>  	sense_data[1] = 0x0;
> @@ -1691,6 +1695,7 @@ static unsigned int sbp2_status_to_sense_data(unchar *sbp2_status,
>  	sense_data[13] = sbp2_status[11];
>  	sense_data[14] = sbp2_status[20];
>  	sense_data[15] = sbp2_status[21];
> +	scsi_eh_cpy_sense(SCpnt, sense_data, sizeof(sense_data));
>  
>  	return sbp2_status[8] & 0x3f;
>  }

You don't need the memset.

Also, here and in drivers/firewire/fw-sbp2.c, the SCSI sense data could
AFAICS be rewritten in-place in sbp2_status.  But I don't know if this
is a worthwhile optimization; it would reduce readability.
-- 
Stefan Richter
-=====-==--- --=- --=--
http://arcgraph.de/sr/
-
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