Re: [PATCH 03/18] scsi: add scsi_{get,put}_internal_cmd() helper

Bart Van Assche
2021-06-23T16:09:42Z

On 5/3/21 8:03 AM, Hannes Reinecke wrote:
> +struct scsi_cmnd *scsi_get_internal_cmd(struct scsi_device *sdev,
> + unsigned int op, blk_mq_req_flags_t flags)
> +{
> + struct request *rq;
> + struct scsi_cmnd *scmd;
> +
> + WARN_ON_ONCE(((op & REQ_OP_MASK) != REQ_OP_SCSI_IN) &&
> + ((op & REQ_OP_MASK) != REQ_OP_SCSI_OUT));

Consider using blk_op_is_scsi() instead of open-coding it.

Thanks,

Bart.