On Mon, 26 Dec 2016, Raz Manor wrote:

> Hello all,
> Linus is right, I should remove all debug prints and keep
> whit-spacing conventions.
> 
> As for the real part of the patch, it is correct that it is only the
> tmp reuse problem, and I couldn't agree more that it is a bad idea to
> reuse a variable, or name it tmp.
> It is also correct that the same problem exists at the other if
> statements in this function. However, these other places don't need
> the previous value of tmp, so the problem is masked away.
> 
> I tried to get the HW specs from the company, but the product was
> discontinued and they provide no support for it. Therefor I also
> don’t know if maybe the original code was intentional. So, if any
> of you could shed some light on the problem, it would be a great
> help. Any documentation or specs you may have on the PLX NET2280
> hardware would be very much appreciated.
> 
> As for the patch Linus sent- it solves the problem as it does exactly
> what my patch does, but with much cleaner code.
> 
> Looking forward to your input,

I'll send you the HW specs in a separate message, off the mailing list.

Note that the usage of tmp in the "if (unlikely(req->td->dmadesc == 0)) {"
branch really is not conflicting, because that branch breaks out of the 
enclosing "while" loop.  But the usage of tmp in the "else" branch does 
conflict.

Renaming the different usages is obviously a good idea.  It's not 
clear that Linus's patch is entirely correct, but I haven't checked the 
spec to make certain.

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to