Skip to content

Commit

Permalink
net: hsr: remove unnecessary space after a cast
Browse files Browse the repository at this point in the history
This patch removes unnecessary space after a cast. This is seen
when ran checkpatch.pl -f on files under net/hsr.

Signed-off-by: Murali Karicheri <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Murali Karicheri authored and davem330 committed Apr 7, 2019
1 parent 05ca6e6 commit 5fa9677
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
10 changes: 5 additions & 5 deletions net/hsr/hsr_forward.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ static bool is_supervision_frame(struct hsr_priv *hsr, struct sk_buff *skb)
struct hsrv1_ethhdr_sp *hsrV1Hdr;

WARN_ON_ONCE(!skb_mac_header_was_set(skb));
ethHdr = (struct ethhdr *) skb_mac_header(skb);
ethHdr = (struct ethhdr *)skb_mac_header(skb);

/* Correct addr? */
if (!ether_addr_equal(ethHdr->h_dest,
Expand All @@ -67,14 +67,14 @@ static bool is_supervision_frame(struct hsr_priv *hsr, struct sk_buff *skb)

/* Get the supervision header from correct location. */
if (ethHdr->h_proto == htons(ETH_P_HSR)) { /* Okay HSRv1. */
hsrV1Hdr = (struct hsrv1_ethhdr_sp *) skb_mac_header(skb);
hsrV1Hdr = (struct hsrv1_ethhdr_sp *)skb_mac_header(skb);
if (hsrV1Hdr->hsr.encap_proto != htons(ETH_P_PRP))
return false;

hsrSupTag = &hsrV1Hdr->hsr_sup;
} else {
hsrSupTag =
&((struct hsrv0_ethhdr_sp *) skb_mac_header(skb))->hsr_sup;
&((struct hsrv0_ethhdr_sp *)skb_mac_header(skb))->hsr_sup;
}

if (hsrSupTag->HSR_TLV_Type != HSR_TLV_ANNOUNCE &&
Expand Down Expand Up @@ -140,7 +140,7 @@ static void hsr_fill_tag(struct sk_buff *skb, struct hsr_frame_info *frame,
if (frame->is_vlan)
lsdu_size -= 4;

hsr_ethhdr = (struct hsr_ethhdr *) skb_mac_header(skb);
hsr_ethhdr = (struct hsr_ethhdr *)skb_mac_header(skb);

set_hsr_tag_path(&hsr_ethhdr->hsr_tag, lane_id);
set_hsr_tag_LSDU_size(&hsr_ethhdr->hsr_tag, lsdu_size);
Expand Down Expand Up @@ -320,7 +320,7 @@ static int hsr_fill_frame_info(struct hsr_frame_info *frame,
if (!frame->node_src)
return -1; /* Unknown node and !is_supervision, or no mem */

ethhdr = (struct ethhdr *) skb_mac_header(skb);
ethhdr = (struct ethhdr *)skb_mac_header(skb);
frame->is_vlan = false;
if (ethhdr->h_proto == htons(ETH_P_8021Q)) {
frame->is_vlan = true;
Expand Down
10 changes: 5 additions & 5 deletions net/hsr/hsr_framereg.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ static bool seq_nr_after(u16 a, u16 b)
/* Remove inconsistency where
* seq_nr_after(a, b) == seq_nr_before(a, b)
*/
if ((int) b - a == 32768)
if ((int)b - a == 32768)
return false;

return (((s16) (b - a)) < 0);
return (((s16)(b - a)) < 0);
}
#define seq_nr_before(a, b) seq_nr_after((b), (a))
#define seq_nr_after_or_eq(a, b) (!seq_nr_before((a), (b)))
Expand Down Expand Up @@ -176,7 +176,7 @@ struct hsr_node *hsr_get_node(struct hsr_port *port, struct sk_buff *skb,
if (!skb_mac_header_was_set(skb))
return NULL;

ethhdr = (struct ethhdr *) skb_mac_header(skb);
ethhdr = (struct ethhdr *)skb_mac_header(skb);

list_for_each_entry_rcu(node, node_db, mac_list) {
if (ether_addr_equal(node->MacAddressA, ethhdr->h_source))
Expand Down Expand Up @@ -218,7 +218,7 @@ void hsr_handle_sup_frame(struct sk_buff *skb, struct hsr_node *node_curr,
struct list_head *node_db;
int i;

ethhdr = (struct ethhdr *) skb_mac_header(skb);
ethhdr = (struct ethhdr *)skb_mac_header(skb);

/* Leave the ethernet header. */
skb_pull(skb, sizeof(struct ethhdr));
Expand All @@ -230,7 +230,7 @@ void hsr_handle_sup_frame(struct sk_buff *skb, struct hsr_node *node_curr,
/* And leave the HSR sup tag. */
skb_pull(skb, sizeof(struct hsr_sup_tag));

hsr_sp = (struct hsr_sup_payload *) skb->data;
hsr_sp = (struct hsr_sup_payload *)skb->data;

/* Merge node_curr (registered on MacAddressB) into node_real */
node_db = &port_rcv->hsr->node_db;
Expand Down
10 changes: 5 additions & 5 deletions net/hsr/hsr_main.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,22 +109,22 @@ struct hsr_sup_payload {

static inline u16 get_hsr_stag_path(struct hsr_sup_tag *hst)
{
return get_hsr_tag_path((struct hsr_tag *) hst);
return get_hsr_tag_path((struct hsr_tag *)hst);
}

static inline u16 get_hsr_stag_HSR_ver(struct hsr_sup_tag *hst)
{
return get_hsr_tag_LSDU_size((struct hsr_tag *) hst);
return get_hsr_tag_LSDU_size((struct hsr_tag *)hst);
}

static inline void set_hsr_stag_path(struct hsr_sup_tag *hst, u16 path)
{
set_hsr_tag_path((struct hsr_tag *) hst, path);
set_hsr_tag_path((struct hsr_tag *)hst, path);
}

static inline void set_hsr_stag_HSR_Ver(struct hsr_sup_tag *hst, u16 HSR_Ver)
{
set_hsr_tag_LSDU_size((struct hsr_tag *) hst, HSR_Ver);
set_hsr_tag_LSDU_size((struct hsr_tag *)hst, HSR_Ver);
}

struct hsrv0_ethhdr_sp {
Expand Down Expand Up @@ -179,7 +179,7 @@ static inline u16 hsr_get_skb_sequence_nr(struct sk_buff *skb)
{
struct hsr_ethhdr *hsr_ethhdr;

hsr_ethhdr = (struct hsr_ethhdr *) skb_mac_header(skb);
hsr_ethhdr = (struct hsr_ethhdr *)skb_mac_header(skb);
return ntohs(hsr_ethhdr->hsr_tag.sequence_nr);
}

Expand Down

0 comments on commit 5fa9677

Please sign in to comment.