ti: Remove no longer used functions and prototypes in the files, cpsw_ale.c and cpsw_ale.h
Subsystems (2)
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 198 lines · Nicholas Krause
This removes the function,
cpsw_ale_flushand its prototype from the filescpsw_ale.candcpsw_ale.hdue to having no more callers. Finally we also remove the functions,cpsw_ale_set_vlan_entry,cpsw_ale_flush_ucastandcpsw_ale_add_ucastand their prototypes due to their only caller being removed with the removal of the function,cpsw_ale.crespectfully.Signed-off-by Nicholas Krause <[email protected]>--- drivers/net/ethernet/ti/cpsw_ale.c | 162 ------------------------------------- drivers/net/ethernet/ti/cpsw_ale.h | 3 - 2 files changed, 165 deletions(-)drivers/net/ethernet/ti/cpsw_ale.c +0
-162@@ -147,27 +147,6 @@ static int cpsw_ale_write(struct cpsw_ale *ale, int idx, u32 *ale_entry)return idx; } -static int cpsw_ale_match_addr (struct cpsw_ale *ale,u8 *addr,u16 vid) -{ -u32 ale_entry[ALE_ENTRY_WORDS ]; -int type, idx; - -for (idx =0 ; idx < ale->params.ale_entries; idx++) { -u8 entry_addr[6 ]; - -cpsw_ale_read (ale, idx, ale_entry); - type =cpsw_ale_get_entry_type (ale_entry); -if (type !=ALE_TYPE_ADDR && type !=ALE_TYPE_VLAN_ADDR ) -continue ; -if (cpsw_ale_get_vlan_id (ale_entry) != vid) -continue ; -cpsw_ale_get_addr (ale_entry, entry_addr); -if (ether_addr_equal (entry_addr, addr)) -return idx; - } -return -ENOENT ; -} -static int cpsw_ale_match_vlan (struct cpsw_ale *ale,u16 vid) {u32 ale_entry[ALE_ENTRY_WORDS ];@@ -268,147 +247,6 @@ int cpsw_ale_flush_multicast(struct cpsw_ale *ale, int port_mask, int vid) }EXPORT_SYMBOL_GPL (cpsw_ale_flush_multicast); -static void cpsw_ale_flush_ucast (struct cpsw_ale *ale,u32 *ale_entry, -int port_mask) -{ -int port; - - port =cpsw_ale_get_port_num (ale_entry); -if ((BIT (port) & port_mask) ==0 ) -return ;/* ports dont intersect, not interested */ -cpsw_ale_set_entry_type (ale_entry,ALE_TYPE_FREE ); -} - -int cpsw_ale_flush (struct cpsw_ale *ale,int port_mask) -{ -u32 ale_entry[ALE_ENTRY_WORDS ]; -int ret, idx; - -for (idx =0 ; idx < ale->params.ale_entries; idx++) { -cpsw_ale_read (ale, idx, ale_entry); - ret =cpsw_ale_get_entry_type (ale_entry); -if (ret !=ALE_TYPE_ADDR && ret !=ALE_TYPE_VLAN_ADDR ) -continue ; - -if (cpsw_ale_get_mcast (ale_entry)) -cpsw_ale_flush_mcast (ale, ale_entry, port_mask); -else -cpsw_ale_flush_ucast (ale, ale_entry, port_mask); - -cpsw_ale_write (ale, idx, ale_entry); - } -return 0 ; -} -EXPORT_SYMBOL_GPL (cpsw_ale_flush); - -static inline void cpsw_ale_set_vlan_entry_type (u32 *ale_entry, -int flags,u16 vid) -{ -if (flags &ALE_VLAN ) { -cpsw_ale_set_entry_type (ale_entry,ALE_TYPE_VLAN_ADDR ); -cpsw_ale_set_vlan_id (ale_entry, vid); - }else { -cpsw_ale_set_entry_type (ale_entry,ALE_TYPE_ADDR ); - } -} - -int cpsw_ale_add_ucast (struct cpsw_ale *ale,u8 *addr,int port, -int flags,u16 vid) -{ -u32 ale_entry[ALE_ENTRY_WORDS ] = {0 ,0 ,0 }; -int idx; - -cpsw_ale_set_vlan_entry_type (ale_entry, flags, vid); - -cpsw_ale_set_addr (ale_entry, addr); -cpsw_ale_set_ucast_type (ale_entry,ALE_UCAST_PERSISTANT ); -cpsw_ale_set_secure (ale_entry, (flags &ALE_SECURE ) ?1 :0 ); -cpsw_ale_set_blocked (ale_entry, (flags &ALE_BLOCKED ) ?1 :0 ); -cpsw_ale_set_port_num (ale_entry, port); - - idx =cpsw_ale_match_addr (ale, addr, (flags &ALE_VLAN ) ? vid :0 ); -if (idx <0 ) - idx =cpsw_ale_match_free (ale); -if (idx <0 ) - idx =cpsw_ale_find_ageable (ale); -if (idx <0 ) -return -ENOMEM ; - -cpsw_ale_write (ale, idx, ale_entry); -return 0 ; -} -EXPORT_SYMBOL_GPL (cpsw_ale_add_ucast); - -int cpsw_ale_del_ucast (struct cpsw_ale *ale,u8 *addr,int port, -int flags,u16 vid) -{ -u32 ale_entry[ALE_ENTRY_WORDS ] = {0 ,0 ,0 }; -int idx; - - idx =cpsw_ale_match_addr (ale, addr, (flags &ALE_VLAN ) ? vid :0 ); -if (idx <0 ) -return -ENOENT ; - -cpsw_ale_set_entry_type (ale_entry,ALE_TYPE_FREE ); -cpsw_ale_write (ale, idx, ale_entry); -return 0 ; -} -EXPORT_SYMBOL_GPL (cpsw_ale_del_ucast); - -int cpsw_ale_add_mcast (struct cpsw_ale *ale,u8 *addr,int port_mask, -int flags,u16 vid,int mcast_state) -{ -u32 ale_entry[ALE_ENTRY_WORDS ] = {0 ,0 ,0 }; -int idx, mask; - - idx =cpsw_ale_match_addr (ale, addr, (flags &ALE_VLAN ) ? vid :0 ); -if (idx >=0 ) -cpsw_ale_read (ale, idx, ale_entry); - -cpsw_ale_set_vlan_entry_type (ale_entry, flags, vid); - -cpsw_ale_set_addr (ale_entry, addr); -cpsw_ale_set_super (ale_entry, (flags &ALE_BLOCKED ) ?1 :0 ); -cpsw_ale_set_mcast_state (ale_entry, mcast_state); - - mask =cpsw_ale_get_port_mask (ale_entry); - port_mask |= mask; -cpsw_ale_set_port_mask (ale_entry, port_mask); - -if (idx <0 ) - idx =cpsw_ale_match_free (ale); -if (idx <0 ) - idx =cpsw_ale_find_ageable (ale); -if (idx <0 ) -return -ENOMEM ; - -cpsw_ale_write (ale, idx, ale_entry); -return 0 ; -} -EXPORT_SYMBOL_GPL (cpsw_ale_add_mcast); - -int cpsw_ale_del_mcast (struct cpsw_ale *ale,u8 *addr,int port_mask, -int flags,u16 vid) -{ -u32 ale_entry[ALE_ENTRY_WORDS ] = {0 ,0 ,0 }; -int idx; - - idx =cpsw_ale_match_addr (ale, addr, (flags &ALE_VLAN ) ? vid :0 ); -if (idx <0 ) -return -EINVAL ; - -cpsw_ale_read (ale, idx, ale_entry); - -if (port_mask) -cpsw_ale_set_port_mask (ale_entry, port_mask); -else -cpsw_ale_set_entry_type (ale_entry,ALE_TYPE_FREE ); - -cpsw_ale_write (ale, idx, ale_entry); -return 0 ; -} -EXPORT_SYMBOL_GPL (cpsw_ale_del_mcast); -int cpsw_ale_add_vlan (struct cpsw_ale *ale,u16 vid,int port,int untag,int reg_mcast,int unreg_mcast) {drivers/net/ethernet/ti/cpsw_ale.h +0
-0
drivers/net/ethernet/ti/cpsw_ale.h void cpsw_ale_start(struct cpsw_ale *ale); · line 97
Quoted 10 lines
drivers/net/ethernet/ti/cpsw_ale.h +0
-3@@ -91,10 +91,7 @@ void cpsw_ale_start(struct cpsw_ale *ale);void cpsw_ale_stop (struct cpsw_ale *ale);int cpsw_ale_set_ageout (struct cpsw_ale *ale,int ageout); -int cpsw_ale_flush (struct cpsw_ale *ale,int port_mask);int cpsw_ale_flush_multicast (struct cpsw_ale *ale,int port_mask,int vid); -int cpsw_ale_add_ucast (struct cpsw_ale *ale,u8 *addr,int port, -int flags,u16 vid);int cpsw_ale_del_ucast (struct cpsw_ale *ale,u8 *addr,int port,int flags,u16 vid); int cpsw_ale_add_mcast(struct cpsw_ale *ale, u8 *addr, int port_mask,
So now there is a cpsw_ale_del_ucast but no cpsw_ale_add_ucast? That makes no sense. There are a lot of abilities in the ALE that the current driver isn't using, but which someone might want to use, and having the functions there could be very handy.
Also many of these are exported symbols, perhaps some currently out of tree code is using them. No idea.
This seems like a remove unused code just for the sake of doing something change. I am not convinced.
Signature · 1 line
Len Sorensen