mlx4_core: Fix confusion between mlx4_event and mlx4_dev_event enums
The struct mlx4_interface.event() method was supposed to get an enum mlx4_dev_event, but the driver code was actually passing in the hardware enum mlx4_event values. Fix up the callers of mlx4_dispatch_event() so that they pass in the right type of value, and fix up the event method in mlx4_ib so that it can handle the enum mlx4_dev_event values. This eliminates the need for the subtype parameter to the event method, so remove it. This also fixes the sparse warning drivers/net/mlx4/intf.c:127:48: warning: mixing different enum types drivers/net/mlx4/intf.c:127:48: int enum mlx4_event versus drivers/net/mlx4/intf.c:127:48: int enum mlx4_dev_event Signed-off-by: Roland Dreier <rolandd@cisco.com>
This commit is contained in:
@@ -675,18 +675,20 @@ static void mlx4_ib_remove(struct mlx4_dev *dev, void *ibdev_ptr)
|
||||
}
|
||||
|
||||
static void mlx4_ib_event(struct mlx4_dev *dev, void *ibdev_ptr,
|
||||
enum mlx4_dev_event event, int subtype,
|
||||
int port)
|
||||
enum mlx4_dev_event event, int port)
|
||||
{
|
||||
struct ib_event ibev;
|
||||
|
||||
switch (event) {
|
||||
case MLX4_EVENT_TYPE_PORT_CHANGE:
|
||||
ibev.event = subtype == MLX4_PORT_CHANGE_SUBTYPE_ACTIVE ?
|
||||
IB_EVENT_PORT_ACTIVE : IB_EVENT_PORT_ERR;
|
||||
case MLX4_DEV_EVENT_PORT_UP:
|
||||
ibev.event = IB_EVENT_PORT_ACTIVE;
|
||||
break;
|
||||
|
||||
case MLX4_EVENT_TYPE_LOCAL_CATAS_ERROR:
|
||||
case MLX4_DEV_EVENT_PORT_DOWN:
|
||||
ibev.event = IB_EVENT_PORT_ERR;
|
||||
break;
|
||||
|
||||
case MLX4_DEV_EVENT_CATASTROPHIC_ERROR:
|
||||
ibev.event = IB_EVENT_DEVICE_FATAL;
|
||||
break;
|
||||
|
||||
|
Reference in New Issue
Block a user