The patch titled forcedeth: suggested cleanups has been removed from the -mm tree. Its filename is forcedeth-suggested-cleanups.patch This patch was probably dropped from -mm because it has now been merged into a subsystem tree or into Linus's tree, or because it was folded into its parent patch in the -mm tree. ------------------------------------------------------ Subject: forcedeth: suggested cleanups From: Ingo Oeser <ioe-lkml@xxxxxxxxxx> general: - endian annotation of the ring descriptors nv_getlen(): - use htons() instead of __constant_htons() to improvde readability and let the compiler constant fold it. nv_rx_process(): - use a real for() loop in processing instead of goto and break - consolidate rx_errors increment - count detected rx_length_errors Signed-off-by: Ingo Oeser <ioe-lkml@xxxxxxxxxx> Cc: Manfred Spraul <manfred@xxxxxxxxxxxxxxxx> Cc: Ayaz Abdulla <aabdulla@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxx> --- drivers/net/forcedeth.c | 57 +++++++++++++++++--------------------- 1 files changed, 26 insertions(+), 31 deletions(-) diff -puN drivers/net/forcedeth.c~forcedeth-suggested-cleanups drivers/net/forcedeth.c --- devel/drivers/net/forcedeth.c~forcedeth-suggested-cleanups 2006-05-24 18:40:46.000000000 -0700 +++ devel-akpm/drivers/net/forcedeth.c 2006-05-24 18:41:15.000000000 -0700 @@ -377,17 +377,18 @@ enum { #define NVREG_POWERSTATE2_POWERUP_REV_A3 0x0001 }; -/* Big endian: should work, but is untested */ +/* Big endian: should work, but is untested. + * So give arch maintainers a hint here. -ioe */ struct ring_desc { - u32 PacketBuffer; - u32 FlagLen; + __le32 PacketBuffer; + __le32 FlagLen; }; struct ring_desc_ex { - u32 PacketBufferHigh; - u32 PacketBufferLow; - u32 TxVlan; - u32 FlagLen; + __le32 PacketBufferHigh; + __le32 PacketBufferLow; + __le32 TxVlan; + __le32 FlagLen; }; typedef union _ring_type { @@ -1845,7 +1846,7 @@ static int nv_getlen(struct net_device * int protolen; /* length as stored in the proto field */ /* 1) calculate len according to header */ - if ( ((struct vlan_ethhdr *)packet)->h_vlan_proto == __constant_htons(ETH_P_8021Q)) { + if (((struct vlan_ethhdr *)packet)->h_vlan_proto == htons(ETH_P_8021Q)) { protolen = ntohs( ((struct vlan_ethhdr *)packet)->h_vlan_encapsulated_proto ); hdrlen = VLAN_HLEN; } else { @@ -1894,7 +1895,7 @@ static void nv_rx_process(struct net_dev u32 Flags; u32 vlanflags = 0; - for (;;) { + for ( ; np->cur_rx - np->refill_rx < RX_RING; np->cur_rx++) { struct sk_buff *skb; int len; int i; @@ -1939,33 +1940,29 @@ static void nv_rx_process(struct net_dev /* look at what we actually got: */ if (np->desc_ver == DESC_VER_1) { if (!(Flags & NV_RX_DESCRIPTORVALID)) - goto next_pkt; + continue; if (Flags & NV_RX_ERROR) { if (Flags & NV_RX_MISSEDFRAME) { np->stats.rx_missed_errors++; - np->stats.rx_errors++; - goto next_pkt; + goto error_pkt; } if (Flags & (NV_RX_ERROR1|NV_RX_ERROR2|NV_RX_ERROR3)) { - np->stats.rx_errors++; - goto next_pkt; + goto error_pkt; } if (Flags & NV_RX_CRCERR) { np->stats.rx_crc_errors++; - np->stats.rx_errors++; - goto next_pkt; + goto error_pkt; } if (Flags & NV_RX_OVERFLOW) { np->stats.rx_over_errors++; - np->stats.rx_errors++; - goto next_pkt; + goto error_pkt; } if (Flags & NV_RX_ERROR4) { len = nv_getlen(dev, np->rx_skbuff[i]->data, len); if (len < 0) { - np->stats.rx_errors++; - goto next_pkt; + np->stats.rx_length_errors++; + goto error_pkt; } } /* framing errors are soft errors. */ @@ -1977,28 +1974,25 @@ static void nv_rx_process(struct net_dev } } else { if (!(Flags & NV_RX2_DESCRIPTORVALID)) - goto next_pkt; + continue; if (Flags & NV_RX2_ERROR) { if (Flags & (NV_RX2_ERROR1|NV_RX2_ERROR2|NV_RX2_ERROR3)) { - np->stats.rx_errors++; - goto next_pkt; + goto error_pkt; } if (Flags & NV_RX2_CRCERR) { np->stats.rx_crc_errors++; - np->stats.rx_errors++; - goto next_pkt; + goto error_pkt; } if (Flags & NV_RX2_OVERFLOW) { np->stats.rx_over_errors++; - np->stats.rx_errors++; - goto next_pkt; + goto error_pkt; } if (Flags & NV_RX2_ERROR4) { len = nv_getlen(dev, np->rx_skbuff[i]->data, len); if (len < 0) { - np->stats.rx_errors++; - goto next_pkt; + np->stats.rx_length_errors++; + goto error_pkt; } } /* framing errors are soft errors */ @@ -2036,8 +2030,9 @@ static void nv_rx_process(struct net_dev dev->last_rx = jiffies; np->stats.rx_packets++; np->stats.rx_bytes += len; -next_pkt: - np->cur_rx++; + continue; +error_pkt: + np->stats.rx_errors++; } } _ Patches currently in -mm which might be from ioe-lkml@xxxxxxxxxx are s390_hypfs-filesystem.patch forcedeth-suggested-cleanups.patch strstrip-api.patch - To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html