Search Linux Wireless

Re: [PATCH 33/40] wl12xx: track freed packets in FW by AC

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

 



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


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux