On Thu, Aug 11, 2011 at 12:41, Eliad Peller <eliad@xxxxxxxxxx> wrote: >>> + for (i = 0; i < NUM_TX_QUEUES; i++) { >>> + /* prevent wrap-around in freed-packets counter */ >>> + wl->tx_allocated_pkts -= >>> + (status->tx_released_pkts[i] - >>> + wl->tx_pkts_freed[i] + 256) % 256; >> >> Isn't the "+ 256" useless here, since you'll mod the result anyway? >> > modulus of negative numbers is not well defined. > > Eliad. > -- > To unsubscribe from this list: send the line "unsubscribe linux-wireless" in > the body of a message to majordomo@xxxxxxxxxxxxxxx > More majordomo info at http://vger.kernel.org/majordomo-info.html > Actually (As pointed out by Ido) the whole (x+256) % 256 sequence can be replaced by (x & 0xFF). I suspect the assembly code already reflects this fact, but we can change it anyway. Arik -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html