On Tue, Feb 26, 2019 at 03:39:54PM +0100, Hannes Reinecke wrote:
> On 2/26/19 3:35 PM, Christoph Hellwig wrote:
> > > static u32 adpt_cmd_to_context(struct scsi_cmnd *cmd)
> > > {
> > > - return (u32)cmd->serial_number;
> > > + return (u32)cmd->request->tag + 1;
> >
> > Why the +1 (with the corresponding -1 later)? Also why keep
> > this rather confusing helper?
> >
> Because the original driver always checked for a non-zero serial number, and
> it might well be a firmware limitation (treating commands with a zero
> identifier as invalid commands).
> So to keep the original behaviour I've added the '+ 1' to the tag number.
Please add a comment explaining this then.