Skip to content

Commit

Permalink
scsi: tcmu: misc nl code cleanup
Browse files Browse the repository at this point in the history
Some misc cleanup of the nl rework patches.

1. Fix space instead of tabs use and extra newline

2. Drop initializing variables to 0 when not needed

3. Just pass the skb_buff and msg_header pointers to
   tcmu_netlink_event_send.

Signed-off-by: Mike Christie <mchristi@redhat.com>
Tested-by: Xiubo Li <xiubli@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
  • Loading branch information
Mike Christie authored and Martin K. Petersen committed Jun 26, 2018
1 parent 9de3a1e commit 06add77
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions drivers/target/target_core_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -1628,11 +1628,9 @@ static int tcmu_netlink_event_init(struct tcmu_dev *udev,

static int tcmu_netlink_event_send(struct tcmu_dev *udev,
enum tcmu_genl_cmd cmd,
struct sk_buff **buf, void **hdr)
struct sk_buff *skb, void *msg_header)
{
int ret = 0;
struct sk_buff *skb = *buf;
void *msg_header = *hdr;
int ret;

genlmsg_end(skb, msg_header);

Expand All @@ -1644,7 +1642,7 @@ static int tcmu_netlink_event_send(struct tcmu_dev *udev,

ret = genlmsg_multicast_allns(&tcmu_genl_family, skb, 0,
TCMU_MCGRP_CONFIG, GFP_KERNEL);
/* We don't care if no one is listening */
/* We don't care if no one is listening */
if (ret == -ESRCH)
ret = 0;
if (!ret)
Expand All @@ -1662,9 +1660,8 @@ static int tcmu_send_dev_add_event(struct tcmu_dev *udev)
&msg_header);
if (ret < 0)
return ret;
return tcmu_netlink_event_send(udev, TCMU_CMD_ADDED_DEVICE, &skb,
&msg_header);

return tcmu_netlink_event_send(udev, TCMU_CMD_ADDED_DEVICE, skb,
msg_header);
}

static int tcmu_send_dev_remove_event(struct tcmu_dev *udev)
Expand All @@ -1678,7 +1675,7 @@ static int tcmu_send_dev_remove_event(struct tcmu_dev *udev)
if (ret < 0)
return ret;
return tcmu_netlink_event_send(udev, TCMU_CMD_REMOVED_DEVICE,
&skb, &msg_header);
skb, msg_header);
}

static int tcmu_update_uio_info(struct tcmu_dev *udev)
Expand Down Expand Up @@ -2197,7 +2194,7 @@ static int tcmu_send_dev_config_event(struct tcmu_dev *udev,
return ret;
}
return tcmu_netlink_event_send(udev, TCMU_CMD_RECONFIG_DEVICE,
&skb, &msg_header);
skb, msg_header);
}


Expand Down Expand Up @@ -2259,7 +2256,7 @@ static int tcmu_send_dev_size_event(struct tcmu_dev *udev, u64 size)
return ret;
}
return tcmu_netlink_event_send(udev, TCMU_CMD_RECONFIG_DEVICE,
&skb, &msg_header);
skb, msg_header);
}

static ssize_t tcmu_dev_size_store(struct config_item *item, const char *page,
Expand Down Expand Up @@ -2341,7 +2338,7 @@ static int tcmu_send_emulate_write_cache(struct tcmu_dev *udev, u8 val)
return ret;
}
return tcmu_netlink_event_send(udev, TCMU_CMD_RECONFIG_DEVICE,
&skb, &msg_header);
skb, msg_header);
}

static ssize_t tcmu_emulate_write_cache_store(struct config_item *item,
Expand Down

0 comments on commit 06add77

Please sign in to comment.