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

Re: [dm-devel] rdac.c patch not quite right.



On Thurs December 09, 2010 8:48 PM, Malahal Naineni wrote:
> > > I think this new patch has the same issue as the old one. In  other
> > > words, the second expression in the parenthesis is true if the first
> one
> > > is true. So you could as well just use the second expression. If you
> > > really want to use PQ as well as PDT with separate checks, you can do
> > > something like this:
> > >
> > >
> > > 	} else if (((inq.PQ_PDT & 0xE0) == 0x20) || (inq.PQ_PDT & 0x1F)) {
> > > 		/* LUN not connected or not a Direct Access device */
> > > 		ret = PATH_DOWN;
> > > 		goto done;
> > >
> > > Please note the 7f to 1F change and the comment change to reflect the
> code
> > > check.
> >
> > Malahal, Thanks for your review comment. First and second expression
> > are two different comparisons. In First expression we are explicitly
> > checking if PQ==001b. If the first expression is _FALSE_ then we check
> > for second expression in which we compare if PQ==011b and PDT==11111b
> > (i.e PQ_PDT = 01111111b=0x7F).
> 
> Vijay, in your patch, the second expression is not a comparison to be
> precise!  Based on your explanation, you really want (inq.PQ_PDT ==
> 0x7F) rather than the current expression (inq.PQ_PDT & 0x7F).
Yes, I agree with you. I will correct the patch with your inputs. Thanks.


Thanks,
Vijay


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