From: Jeff Kirsher Date: Fri, 13 Jan 2006 00:51:12 +0000 (-0800) Subject: [PATCH] e1000: Fixed frame size logic X-Git-Tag: v2.6.16-rc2~366^2~28 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=ce7393b93502f52e2ef7259e9e9bc3b1a1fd6799;p=linux-2.6-omap-h63xx.git [PATCH] e1000: Fixed frame size logic Simplified the logic used to assign the frame_size. Signed-off-by: Jeff Kirsher Signed-off-by: Jesse Brandeburg Signed-off-by: John Ronciak Signed-off-by: Jeff Garzik --- diff --git a/drivers/net/e1000/e1000_ethtool.c b/drivers/net/e1000/e1000_ethtool.c index ad9ca2ac25f..8363d8d8631 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 *skb, unsigned int frame_size) 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)) {