[PATCH 1/7] ath10k: simplify HTC credits calculation

Michal Kazior michal.kazior at tieto.com
Wed Sep 11 01:06:46 EDT 2013


On 10 September 2013 16:14, Bob Copeland <me at bobcopeland.com> wrote:
> On Tue, Sep 10, 2013 at 03:49:57PM +0200, Michal Kazior wrote:
>> +             skb = __skb_dequeue(&ep->tx_queue);
>> +
>> +             if (ep->tx_credit_flow_enabled) {
>> +                     /* integer division w/ round-up */
>> +                     credits = (skb->len + htc->target_credit_size - 1) /
>> +                               htc->target_credit_size;
>
> There's a macro for that...
>
>             credits = DIV_ROUND_UP(skb->len, htc->target_credit_size);

I didn't know that. Thanks!


Michał.



More information about the ath10k mailing list