Simplified the logic used to assign the frame_size.

Signed-off-by: Jeff Kirsher <[EMAIL PROTECTED]>
Signed-off-by: Jesse Brandeburg <[EMAIL PROTECTED]>
Signed-off-by: John Ronciak <[EMAIL PROTECTED]>
---

 drivers/net/e1000/e1000_ethtool.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/e1000/e1000_ethtool.c 
b/drivers/net/e1000/e1000_ethtool.c
index ad9ca2a..8363d8d 100644
--- a/drivers/net/e1000/e1000_ethtool.c
+++ b/drivers/net/e1000/e1000_ethtool.c
@@ -1401,7 +1401,7 @@ static void
 e1000_create_lbtest_frame(struct sk_buff *skb, unsigned int frame_size)
 {
        memset(skb->data, 0xFF, frame_size);
-       frame_size = (frame_size % 2) ? (frame_size - 1) : frame_size;
+       frame_size &= ~1;
        memset(&skb->data[frame_size / 2], 0xAA, frame_size / 2 - 1);
        memset(&skb->data[frame_size / 2 + 10], 0xBE, 1);
        memset(&skb->data[frame_size / 2 + 12], 0xAF, 1);
@@ -1410,7 +1410,7 @@ e1000_create_lbtest_frame(struct sk_buff
 static int
 e1000_check_lbtest_frame(struct sk_buff *skb, unsigned int frame_size)
 {
-       frame_size = (frame_size % 2) ? (frame_size - 1) : frame_size;
+       frame_size &= ~1;
        if(*(skb->data + 3) == 0xFF) {
                if((*(skb->data + frame_size / 2 + 10) == 0xBE) &&
                   (*(skb->data + frame_size / 2 + 12) == 0xAF)) {

-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to