Skip to content

Commit

Permalink
net: hsr: fix multiple blank lines in the code
Browse files Browse the repository at this point in the history
This patch fixes multiple blank lines in the code. This is seen
when ran checkpatch.pl -f option for files under net/hsr

Signed-off-by: Murali Karicheri <m-karicheri2@ti.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Murali Karicheri authored and davem330 committed Apr 7, 2019
1 parent d595b85 commit d473077
Show file tree
Hide file tree
Showing 7 changed files with 0 additions and 55 deletions.
10 changes: 0 additions & 10 deletions net/hsr/hsr_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
#include "hsr_main.h"
#include "hsr_forward.h"


static bool is_admin_up(struct net_device *dev)
{
return dev && (dev->flags & IFF_UP);
Expand Down Expand Up @@ -82,7 +81,6 @@ static bool hsr_check_carrier(struct hsr_port *master)
return has_carrier;
}


static void hsr_check_announce(struct net_device *hsr_dev,
unsigned char old_operstate)
{
Expand Down Expand Up @@ -136,7 +134,6 @@ int hsr_get_max_mtu(struct hsr_priv *hsr)
return mtu_max - HSR_HLEN;
}


static int hsr_dev_change_mtu(struct net_device *dev, int new_mtu)
{
struct hsr_priv *hsr;
Expand Down Expand Up @@ -191,14 +188,12 @@ static int hsr_dev_open(struct net_device *dev)
return 0;
}


static int hsr_dev_close(struct net_device *dev)
{
/* Nothing to do here. */
return 0;
}


static netdev_features_t hsr_features_recompute(struct hsr_priv *hsr,
netdev_features_t features)
{
Expand Down Expand Up @@ -231,7 +226,6 @@ static netdev_features_t hsr_fix_features(struct net_device *dev,
return hsr_features_recompute(hsr, features);
}


static int hsr_dev_xmit(struct sk_buff *skb, struct net_device *dev)
{
struct hsr_priv *hsr = netdev_priv(dev);
Expand All @@ -244,7 +238,6 @@ static int hsr_dev_xmit(struct sk_buff *skb, struct net_device *dev)
return NETDEV_TX_OK;
}


static const struct header_ops hsr_header_ops = {
.create = eth_header,
.parse = eth_header_parse,
Expand Down Expand Up @@ -324,7 +317,6 @@ static void send_hsr_supervision_frame(struct hsr_port *master,
kfree_skb(skb);
}


/* Announce (supervision frame) timer function
*/
static void hsr_announce(struct timer_list *t)
Expand Down Expand Up @@ -357,7 +349,6 @@ static void hsr_announce(struct timer_list *t)
rcu_read_unlock();
}


/* According to comments in the declaration of struct net_device, this function
* is "Called from unregister, can be used to call free_netdev". Ok then...
*/
Expand Down Expand Up @@ -423,7 +414,6 @@ void hsr_dev_setup(struct net_device *dev)
dev->features |= NETIF_F_NETNS_LOCAL;
}


/* Return true if dev is a HSR master; return false otherwise.
*/
inline bool is_hsr_master(struct net_device *dev)
Expand Down
8 changes: 0 additions & 8 deletions net/hsr/hsr_forward.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
#include "hsr_main.h"
#include "hsr_framereg.h"


struct hsr_node;

struct hsr_frame_info {
Expand All @@ -32,7 +31,6 @@ struct hsr_frame_info {
bool is_local_exclusive;
};


/* The uses I can see for these HSR supervision frames are:
* 1) Use the frames that are sent after node initialization ("HSR_TLV.Type =
* 22") to reset any sequence_nr counters belonging to that node. Useful if
Expand Down Expand Up @@ -90,7 +88,6 @@ static bool is_supervision_frame(struct hsr_priv *hsr, struct sk_buff *skb)
return true;
}


static struct sk_buff *create_stripped_skb(struct sk_buff *skb_in,
struct hsr_frame_info *frame)
{
Expand Down Expand Up @@ -128,7 +125,6 @@ static struct sk_buff *frame_get_stripped_skb(struct hsr_frame_info *frame,
return skb_clone(frame->skb_std, GFP_ATOMIC);
}


static void hsr_fill_tag(struct sk_buff *skb, struct hsr_frame_info *frame,
struct hsr_port *port, u8 protoVersion)
{
Expand Down Expand Up @@ -203,7 +199,6 @@ static struct sk_buff *frame_get_tagged_skb(struct hsr_frame_info *frame,
return create_tagged_skb(frame->skb_std, frame, port);
}


static void hsr_deliver_master(struct sk_buff *skb, struct net_device *dev,
struct hsr_node *node_src)
{
Expand Down Expand Up @@ -238,7 +233,6 @@ static int hsr_xmit(struct sk_buff *skb, struct hsr_port *port,
return dev_queue_xmit(skb);
}


/* Forward the frame through all devices except:
* - Back through the receiving device
* - If it's a HSR frame: through a device where it has passed before
Expand Down Expand Up @@ -297,7 +291,6 @@ static void hsr_forward_do(struct hsr_frame_info *frame)
}
}


static void check_local_dest(struct hsr_priv *hsr, struct sk_buff *skb,
struct hsr_frame_info *frame)
{
Expand All @@ -317,7 +310,6 @@ static void check_local_dest(struct hsr_priv *hsr, struct sk_buff *skb,
}
}


static int hsr_fill_frame_info(struct hsr_frame_info *frame,
struct sk_buff *skb, struct hsr_port *port)
{
Expand Down
12 changes: 0 additions & 12 deletions net/hsr/hsr_framereg.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#include "hsr_framereg.h"
#include "hsr_netlink.h"


struct hsr_node {
struct list_head mac_list;
unsigned char MacAddressA[ETH_ALEN];
Expand All @@ -35,10 +34,8 @@ struct hsr_node {
struct rcu_head rcu_head;
};


/* TODO: use hash lists for mac addresses (linux/jhash.h)? */


/* seq_nr_after(a, b) - return true if a is after (higher in sequence than) b,
* false otherwise.
*/
Expand All @@ -56,7 +53,6 @@ static bool seq_nr_after(u16 a, u16 b)
#define seq_nr_after_or_eq(a, b) (!seq_nr_before((a), (b)))
#define seq_nr_before_or_eq(a, b) (!seq_nr_after((a), (b)))


bool hsr_addr_is_self(struct hsr_priv *hsr, unsigned char *addr)
{
struct hsr_node *node;
Expand Down Expand Up @@ -91,7 +87,6 @@ static struct hsr_node *find_node_by_AddrA(struct list_head *node_db,
return NULL;
}


/* Helper for device init; the self_node_db is used in hsr_rcv() to recognize
* frames from self that's been looped over the HSR ring.
*/
Expand Down Expand Up @@ -270,7 +265,6 @@ void hsr_handle_sup_frame(struct sk_buff *skb, struct hsr_node *node_curr,
skb_push(skb, sizeof(struct hsrv1_ethhdr_sp));
}


/* 'skb' is a frame meant for this host, that is to be passed to upper layers.
*
* If the frame was sent by a node's B interface, replace the source
Expand Down Expand Up @@ -321,7 +315,6 @@ void hsr_addr_subst_dest(struct hsr_node *node_src, struct sk_buff *skb,
ether_addr_copy(eth_hdr(skb)->h_dest, node_dst->MacAddressB);
}


void hsr_register_frame_in(struct hsr_node *node, struct hsr_port *port,
u16 sequence_nr)
{
Expand Down Expand Up @@ -354,7 +347,6 @@ int hsr_register_frame_out(struct hsr_port *port, struct hsr_node *node,
return 0;
}


static struct hsr_port *get_late_port(struct hsr_priv *hsr,
struct hsr_node *node)
{
Expand All @@ -375,7 +367,6 @@ static struct hsr_port *get_late_port(struct hsr_priv *hsr,
return NULL;
}


/* Remove stale sequence_nr records. Called by timer every
* HSR_LIFE_CHECK_INTERVAL (two seconds or so).
*/
Expand Down Expand Up @@ -431,7 +422,6 @@ void hsr_prune_nodes(struct timer_list *t)
rcu_read_unlock();
}


void *hsr_get_next_node(struct hsr_priv *hsr, void *_pos,
unsigned char addr[ETH_ALEN])
{
Expand All @@ -454,7 +444,6 @@ void *hsr_get_next_node(struct hsr_priv *hsr, void *_pos,
return NULL;
}


int hsr_get_node_data(struct hsr_priv *hsr,
const unsigned char *addr,
unsigned char addr_b[ETH_ALEN],
Expand All @@ -468,7 +457,6 @@ int hsr_get_node_data(struct hsr_priv *hsr,
struct hsr_port *port;
unsigned long tdiff;


rcu_read_lock();
node = find_node_by_AddrA(&hsr->node_db, addr);
if (!node) {
Expand Down
3 changes: 0 additions & 3 deletions net/hsr/hsr_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#include "hsr_framereg.h"
#include "hsr_slave.h"


static int hsr_netdev_notify(struct notifier_block *nb, unsigned long event,
void *ptr)
{
Expand Down Expand Up @@ -98,7 +97,6 @@ static int hsr_netdev_notify(struct notifier_block *nb, unsigned long event,
return NOTIFY_DONE;
}


struct hsr_port *hsr_port_get_hsr(struct hsr_priv *hsr, enum hsr_port_type pt)
{
struct hsr_port *port;
Expand All @@ -113,7 +111,6 @@ static struct notifier_block hsr_nb = {
.notifier_call = hsr_netdev_notify, /* Slave event notifications */
};


static int __init hsr_init(void)
{
int res;
Expand Down
7 changes: 0 additions & 7 deletions net/hsr/hsr_main.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#include <linux/netdevice.h>
#include <linux/list.h>


/* Time constants as specified in the HSR specification (IEC-62439-3 2010)
* Table 8.
* All values in milliseconds.
Expand All @@ -24,25 +23,21 @@
#define HSR_NODE_FORGET_TIME 60000 /* ms */
#define HSR_ANNOUNCE_INTERVAL 100 /* ms */


/* By how much may slave1 and slave2 timestamps of latest received frame from
* each node differ before we notify of communication problem?
*/
#define MAX_SLAVE_DIFF 3000 /* ms */
#define HSR_SEQNR_START (USHRT_MAX - 1024)
#define HSR_SUP_SEQNR_START (HSR_SEQNR_START / 2)


/* How often shall we check for broken ring and remove node entries older than
* HSR_NODE_FORGET_TIME?
*/
#define PRUNE_PERIOD 3000 /* ms */


#define HSR_TLV_ANNOUNCE 22
#define HSR_TLV_LIFE_CHECK 23


/* HSR Tag.
* As defined in IEC-62439-3:2010, the HSR tag is really { ethertype = 0x88FB,
* path, LSDU_size, sequence Nr }. But we let eth_header() create { h_dest,
Expand Down Expand Up @@ -99,7 +94,6 @@ struct hsr_ethhdr {
struct hsr_tag hsr_tag;
} __packed;


/* HSR Supervision Frame data types.
* Field names as defined in the IEC:2010 standard for HSR.
*/
Expand Down Expand Up @@ -145,7 +139,6 @@ struct hsrv1_ethhdr_sp {
struct hsr_sup_tag hsr_sup;
} __packed;


enum hsr_port_type {
HSR_PT_NONE = 0, /* Must be 0, used by framereg */
HSR_PT_SLAVE_A,
Expand Down
12 changes: 0 additions & 12 deletions net/hsr/hsr_netlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ static const struct nla_policy hsr_policy[IFLA_HSR_MAX + 1] = {
[IFLA_HSR_SEQ_NR] = { .type = NLA_U16 },
};


/* Here, it seems a netdevice has already been allocated for us, and the
* hsr_dev_setup routine has been executed. Nice!
*/
Expand Down Expand Up @@ -121,8 +120,6 @@ static struct rtnl_link_ops hsr_link_ops __read_mostly = {
.fill_info = hsr_fill_info,
};



/* attribute policy */
static const struct nla_policy hsr_genl_policy[HSR_A_MAX + 1] = {
[HSR_A_NODE_ADDR] = { .len = ETH_ALEN },
Expand All @@ -140,8 +137,6 @@ static const struct genl_multicast_group hsr_mcgrps[] = {
{ .name = "hsr-network", },
};



/* This is called if for some node with MAC address addr, we only get frames
* over one of the slave interfaces. This would indicate an open network ring
* (i.e. a link has failed somewhere).
Expand Down Expand Up @@ -204,7 +199,6 @@ void hsr_nl_nodedown(struct hsr_priv *hsr, unsigned char addr[ETH_ALEN])
if (!msg_head)
goto nla_put_failure;


res = nla_put(skb, HSR_A_NODE_ADDR, ETH_ALEN, addr);
if (res < 0)
goto nla_put_failure;
Expand All @@ -224,7 +218,6 @@ void hsr_nl_nodedown(struct hsr_priv *hsr, unsigned char addr[ETH_ALEN])
rcu_read_unlock();
}


/* HSR_C_GET_NODE_STATUS lets userspace query the internal HSR node table
* about the status of a specific node in the network, defined by its MAC
* address.
Expand Down Expand Up @@ -269,9 +262,7 @@ static int hsr_get_node_status(struct sk_buff *skb_in, struct genl_info *info)
if (!is_hsr_master(hsr_dev))
goto invalid;


/* Send reply */

skb_out = genlmsg_new(NLMSG_GOODSIZE, GFP_KERNEL);
if (!skb_out) {
res = -ENOMEM;
Expand Down Expand Up @@ -397,9 +388,7 @@ static int hsr_get_node_list(struct sk_buff *skb_in, struct genl_info *info)
if (!is_hsr_master(hsr_dev))
goto invalid;


/* Send reply */

skb_out = genlmsg_new(NLMSG_GOODSIZE, GFP_KERNEL);
if (!skb_out) {
res = -ENOMEM;
Expand Down Expand Up @@ -449,7 +438,6 @@ static int hsr_get_node_list(struct sk_buff *skb_in, struct genl_info *info)
return res;
}


static const struct genl_ops hsr_ops[] = {
{
.cmd = HSR_C_GET_NODE_STATUS,
Expand Down
Loading

0 comments on commit d473077

Please sign in to comment.