From: David Miller <davem@davemloft.net>
To: inguin@gmx.de
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH] Fix tx transfer padding for full-speed USB
Date: Tue, 24 Apr 2012 00:28:08 -0400 (EDT) [thread overview]
Message-ID: <20120424.002808.1711965470884592541.davem@davemloft.net> (raw)
In-Reply-To: <1334916021-9124-1-git-send-email-inguin@gmx.de>
From: Ingo van Lil <inguin@gmx.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.
next prev parent reply other threads:[~2012-04-24 4:28 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-20 10:00 [PATCH] Fix tx transfer padding for full-speed USB Ingo van Lil
2012-04-24 4:28 ` David Miller [this message]
2012-04-24 8:05 ` Ingo van Lil
2012-04-24 8:12 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120424.002808.1711965470884592541.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=inguin@gmx.de \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox