Commit:     f0b5a0dcf125ce43855961ef4f965a91112bea23
Parent:     4cec72c890d3a465eed08c24a4a2bfe25650318f
Author:     Eric Dumazet <[EMAIL PROTECTED]>
AuthorDate: Tue Jan 8 23:54:43 2008 -0800
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Mon Jan 28 15:01:06 2008 -0800

    [VLAN]: Avoid expensive divides
    We can avoid divides (as seen with CONFIG_CC_OPTIMIZE_FOR_SIZE=y on
    x86) changing vlan_group_get_device()/vlan_group_set_device() id
    parameter from signed to unsigned.
    Signed-off-by: Eric Dumazet <[EMAIL PROTECTED]>
    Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
 include/linux/if_vlan.h |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h
index 976d4b1..4562105 100644
--- a/include/linux/if_vlan.h
+++ b/include/linux/if_vlan.h
@@ -81,14 +81,16 @@ struct vlan_group {
        struct rcu_head         rcu;
-static inline struct net_device *vlan_group_get_device(struct vlan_group *vg, 
int vlan_id)
+static inline struct net_device *vlan_group_get_device(struct vlan_group *vg,
+                                                      unsigned int vlan_id)
        struct net_device **array;
        array = vg->vlan_devices_arrays[vlan_id / VLAN_GROUP_ARRAY_PART_LEN];
        return array[vlan_id % VLAN_GROUP_ARRAY_PART_LEN];
-static inline void vlan_group_set_device(struct vlan_group *vg, int vlan_id,
+static inline void vlan_group_set_device(struct vlan_group *vg,
+                                        unsigned int vlan_id,
                                         struct net_device *dev)
        struct net_device **array;
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at

Reply via email to