浏览代码

mlxsw: spectrum_router: Properly name netevent work struct

The struct containing the work item queued from the netevent handler is
named after the only event it is currently used for, which is neighbour
updates.

Use a more appropriate name for the struct, as we are going to use it
for more events.

Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Reviewed-by: Petr Machata <petrm@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Ido Schimmel 7 年之前
父节点
当前提交
ceb8881ddf
共有 1 个文件被更改,包括 13 次插入13 次删除
  1. 13 13
      drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c

+ 13 - 13
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c

@@ -2026,7 +2026,7 @@ mlxsw_sp_neigh_entry_counter_update(struct mlxsw_sp *mlxsw_sp,
 	mlxsw_sp_neigh_entry_update(mlxsw_sp, neigh_entry, true);
 	mlxsw_sp_neigh_entry_update(mlxsw_sp, neigh_entry, true);
 }
 }
 
 
-struct mlxsw_sp_neigh_event_work {
+struct mlxsw_sp_netevent_work {
 	struct work_struct work;
 	struct work_struct work;
 	struct mlxsw_sp *mlxsw_sp;
 	struct mlxsw_sp *mlxsw_sp;
 	struct neighbour *n;
 	struct neighbour *n;
@@ -2034,11 +2034,11 @@ struct mlxsw_sp_neigh_event_work {
 
 
 static void mlxsw_sp_router_neigh_event_work(struct work_struct *work)
 static void mlxsw_sp_router_neigh_event_work(struct work_struct *work)
 {
 {
-	struct mlxsw_sp_neigh_event_work *neigh_work =
-		container_of(work, struct mlxsw_sp_neigh_event_work, work);
-	struct mlxsw_sp *mlxsw_sp = neigh_work->mlxsw_sp;
+	struct mlxsw_sp_netevent_work *net_work =
+		container_of(work, struct mlxsw_sp_netevent_work, work);
+	struct mlxsw_sp *mlxsw_sp = net_work->mlxsw_sp;
 	struct mlxsw_sp_neigh_entry *neigh_entry;
 	struct mlxsw_sp_neigh_entry *neigh_entry;
-	struct neighbour *n = neigh_work->n;
+	struct neighbour *n = net_work->n;
 	unsigned char ha[ETH_ALEN];
 	unsigned char ha[ETH_ALEN];
 	bool entry_connected;
 	bool entry_connected;
 	u8 nud_state, dead;
 	u8 nud_state, dead;
@@ -2074,13 +2074,13 @@ static void mlxsw_sp_router_neigh_event_work(struct work_struct *work)
 out:
 out:
 	rtnl_unlock();
 	rtnl_unlock();
 	neigh_release(n);
 	neigh_release(n);
-	kfree(neigh_work);
+	kfree(net_work);
 }
 }
 
 
 static int mlxsw_sp_router_netevent_event(struct notifier_block *unused,
 static int mlxsw_sp_router_netevent_event(struct notifier_block *unused,
 					  unsigned long event, void *ptr)
 					  unsigned long event, void *ptr)
 {
 {
-	struct mlxsw_sp_neigh_event_work *neigh_work;
+	struct mlxsw_sp_netevent_work *net_work;
 	struct mlxsw_sp_port *mlxsw_sp_port;
 	struct mlxsw_sp_port *mlxsw_sp_port;
 	struct mlxsw_sp *mlxsw_sp;
 	struct mlxsw_sp *mlxsw_sp;
 	unsigned long interval;
 	unsigned long interval;
@@ -2119,22 +2119,22 @@ static int mlxsw_sp_router_netevent_event(struct notifier_block *unused,
 		if (!mlxsw_sp_port)
 		if (!mlxsw_sp_port)
 			return NOTIFY_DONE;
 			return NOTIFY_DONE;
 
 
-		neigh_work = kzalloc(sizeof(*neigh_work), GFP_ATOMIC);
-		if (!neigh_work) {
+		net_work = kzalloc(sizeof(*net_work), GFP_ATOMIC);
+		if (!net_work) {
 			mlxsw_sp_port_dev_put(mlxsw_sp_port);
 			mlxsw_sp_port_dev_put(mlxsw_sp_port);
 			return NOTIFY_BAD;
 			return NOTIFY_BAD;
 		}
 		}
 
 
-		INIT_WORK(&neigh_work->work, mlxsw_sp_router_neigh_event_work);
-		neigh_work->mlxsw_sp = mlxsw_sp_port->mlxsw_sp;
-		neigh_work->n = n;
+		INIT_WORK(&net_work->work, mlxsw_sp_router_neigh_event_work);
+		net_work->mlxsw_sp = mlxsw_sp_port->mlxsw_sp;
+		net_work->n = n;
 
 
 		/* Take a reference to ensure the neighbour won't be
 		/* Take a reference to ensure the neighbour won't be
 		 * destructed until we drop the reference in delayed
 		 * destructed until we drop the reference in delayed
 		 * work.
 		 * work.
 		 */
 		 */
 		neigh_clone(n);
 		neigh_clone(n);
-		mlxsw_core_schedule_work(&neigh_work->work);
+		mlxsw_core_schedule_work(&net_work->work);
 		mlxsw_sp_port_dev_put(mlxsw_sp_port);
 		mlxsw_sp_port_dev_put(mlxsw_sp_port);
 		break;
 		break;
 	}
 	}