On Thu, Nov 08 2007 at 15:03 +0200, FUJITA Tomonori <[EMAIL PROTECTED]> wrote:
> On Thu, 08 Nov 2007 11:24:36 +0200
> Boaz Harrosh <[EMAIL PROTECTED]> wrote:
> 
>>>> diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
>>>> index 18343a6..28cf6fe 100644
>>>> --- a/drivers/scsi/sd.c
>>>> +++ b/drivers/scsi/sd.c
>>>> @@ -448,9 +448,6 @@ static int sd_prep_fn(struct request_queue *q, struct 
>>>> request *rq)
>>>>    } else if (rq_data_dir(rq) == READ) {
>>>>            SCpnt->cmnd[0] = READ_6;
>>>>            SCpnt->sc_data_direction = DMA_FROM_DEVICE;
>>>> -  } else {
>>>> -          scmd_printk(KERN_ERR, SCpnt, "Unknown command %x\n", 
>>>> rq->cmd_flags);
>>>> -          goto out;
>>> This should go to the bidi patch?
>>>
>>>>    }
>>>>  
>> This is just a dead code cleanup. It is got nothing to do with bidi or 
>> scsi_data_buffer
>> for that matter. It could be in it's own patch, but surly it will not go 
>> into the bidi
>> patch. I will submit a new patch just for that code. Independent of these.
>> (I was hoping to save the extra effort)
> 
> Hm, is it dead code? I think it's kinda BUG_ON, that is, we should not
> hit that code. sd only accetps READ and WRITE requests. It prevents
> funcy requests like BIDI from accidentally comming.
It is dead code. The rq_data_dir(rq) does a (->flags & 0x1) inline
the compiler will remove the extra code.

Also with bidi rq_data_dir(rq) is decided to return WRITE, a bidi
request is blk_bidi_rq(rq).

(I have separated this to a patch of it's own.)

Boaz
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to