[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20120424.002808.1711965470884592541.davem@davemloft.net>
Date: Tue, 24 Apr 2012 00:28:08 -0400 (EDT)
From: David Miller <davem@...emloft.net>
To: inguin@....de
Cc: netdev@...r.kernel.org
Subject: Re: [PATCH] Fix tx transfer padding for full-speed USB
From: Ingo van Lil <inguin@....de>
Date: Fri, 20 Apr 2012 12:00:21 +0200
> - padlen = ((skb->len + 4) % 512) ? 0 : 4;
> + padlen = ((skb->len + 4) % dev->maxpacket) ? 0 : 4;
This is now an expensive modulus operation, instead of
a cheap mask.
Since you know that dev->maxpacket is always a power of two, tell the
compiler this so it can still optimize the expression by changing this
to "& (dev->maxpacket - 1)" and we'll thus avoid the costly modulus.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists