Skip to content

Commit

Permalink
rxe: Minor formatting changes to rxe_net
Browse files Browse the repository at this point in the history
Added line breaks to lines where width was >80 and remove an unecessary pointer
assignment temporary variable.
  • Loading branch information
psebexen committed Apr 28, 2015
1 parent cae6ad5 commit 327a12c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
15 changes: 9 additions & 6 deletions drivers/infiniband/hw/rxe/rxe_net.c
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,8 @@ static int rxe_udp_encap_recv(struct sock *sk, struct sk_buff *skb)
{
struct udphdr *udph;
struct net_device *ndev = skb->dev;
struct rxe_net_info_list *net_info_item = net_info_list_get(&net_info_list, ndev->ifindex);
struct rxe_dev *rxe = net_info_item->rxe;
struct rxe_net_info_list *net_info_item =
net_info_list_get(&net_info_list, ndev->ifindex);
struct rxe_pkt_info *pkt = SKB_TO_PKT(skb);

if (!rxe)
Expand All @@ -191,7 +191,7 @@ static int rxe_udp_encap_recv(struct sock *sk, struct sk_buff *skb)
}

udph = udp_hdr(skb);
pkt->rxe = rxe;
pkt->rxe = net_info_item->rxe;
pkt->port_num = net_info_item->port;
pkt->hdr = (u8 *)(udph + 1);
pkt->mask = RXE_GRH_MASK;
Expand Down Expand Up @@ -555,7 +555,8 @@ static int rxe_notify(struct notifier_block *not_blk,
return NOTIFY_OK;
}

struct rxe_net_info_list *net_info_list_add(struct rxe_net_info_list *info_list, int index)
struct rxe_net_info_list *net_info_list_add(struct rxe_net_info_list *info_list,
int index)
{
struct rxe_net_info_list *net_info_item;

Expand All @@ -572,7 +573,8 @@ struct rxe_net_info_list *net_info_list_add(struct rxe_net_info_list *info_list,
return net_info_item;
}

struct rxe_net_info_list *net_info_list_get(struct rxe_net_info_list *info_list, int index)
struct rxe_net_info_list *net_info_list_get(struct rxe_net_info_list *info_list,
int index)
{
struct rxe_net_info_list *net_info_item;

Expand Down Expand Up @@ -631,7 +633,8 @@ void rxe_net_exit(void)
if (addr_info.sock4)
rxe_release_udp_tunnel(addr_info.sock4);

list_for_each_entry_safe(net_info_item, net_info_temp, &net_info_list.list, list) {
list_for_each_entry_safe(net_info_item, net_info_temp,
&net_info_list.list, list) {
list_del(&net_info_item->list);
kfree(net_info_item);
}
Expand Down
6 changes: 4 additions & 2 deletions drivers/infiniband/hw/rxe/rxe_net.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,10 @@ extern struct rxe_addr_info addr_info;
extern struct rxe_net_info_list net_info_list;
extern spinlock_t net_info_lock;

struct rxe_net_info_list *net_info_list_add(struct rxe_net_info_list *info_list, int ifindex);
struct rxe_net_info_list *net_info_list_get(struct rxe_net_info_list *info_list, int ifindex);
struct rxe_net_info_list *net_info_list_add(struct rxe_net_info_list *info_list,
int ifindex);
struct rxe_net_info_list *net_info_list_get(struct rxe_net_info_list *info_list,
int ifindex);
void rxe_net_add(struct net_device *ndev);
void rxe_net_up(struct net_device *ndev);
void rxe_net_down(struct net_device *ndev);
Expand Down
3 changes: 2 additions & 1 deletion drivers/infiniband/hw/rxe/rxe_net_sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ static int rxe_param_set_add(const char *val, struct kernel_param *kp)
intf);
else {
rxe_net_add(ndev);
if (net_info_list_get(&net_info_list, ndev->ifindex)->rxe) {
if (net_info_list_get(&net_info_list,
ndev->ifindex)->rxe) {
rxe_set_port_state(ndev);
} else {
pr_err("rxe: add appears to have failed for %s (index %d)\n",
Expand Down

0 comments on commit 327a12c

Please sign in to comment.