On 07/12/2014 04:26 AM, Kevin Hao wrote:
- for (i = 0; i < ATA_MAX_QUEUE; i++) { - tag = (i + ap->last_tag + 1) % ATA_MAX_QUEUE; + for (i = 0, tag = ap->last_tag + 1; i < max_queue; i++, tag++) { + tag = tag < max_queue ? tag : 0;
Assigning 'tag' back to 'tag' is quite stupid, don't you think? Why not:
if (tag >= max_queue) tag = 0;
Since I am an idiot, it is very possible for me to write stupid code. But I don't believe this is one. I don't think the above code is more readable.
Perhaps I'm an idiot (I even seldom doubt it) but to me it looks like clear abuse of the ?: operator. But that's probably just me...
Thanks, Kevin
MBR, Sergei -- To unsubscribe from this list: send the line "unsubscribe linux-ide" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html