2022-04-25 07:02:34

by Ian Cowan

[permalink] [raw]
Subject: [PATCH] net: appletalk: cleanup brace styling

This cleans up some brace styling to meet the style guide. There is one
exception where the compiler wants unnecessary braces to prevent
multiple if/else ambiguity.

Signed-off-by: Ian Cowan <[email protected]>
---
net/appletalk/ddp.c | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/net/appletalk/ddp.c b/net/appletalk/ddp.c
index bf5736c1d458..2709d9621b25 100644
--- a/net/appletalk/ddp.c
+++ b/net/appletalk/ddp.c
@@ -161,8 +161,9 @@ static void atalk_destroy_timer(struct timer_list *t)
if (sk_has_allocations(sk)) {
sk->sk_timer.expires = jiffies + SOCK_DESTROY_TIME;
add_timer(&sk->sk_timer);
- } else
+ } else {
sock_put(sk);
+ }
}

static inline void atalk_destroy_socket(struct sock *sk)
@@ -174,8 +175,9 @@ static inline void atalk_destroy_socket(struct sock *sk)
timer_setup(&sk->sk_timer, atalk_destroy_timer, 0);
sk->sk_timer.expires = jiffies + SOCK_DESTROY_TIME;
add_timer(&sk->sk_timer);
- } else
+ } else {
sock_put(sk);
+ }
}

/**************************************************************************\
@@ -211,8 +213,9 @@ static void atif_drop_device(struct net_device *dev)
dev_put(dev);
kfree(tmp);
dev->atalk_ptr = NULL;
- } else
+ } else {
iface = &tmp->next;
+ }
}
write_unlock_bh(&atalk_interfaces_lock);
}
@@ -444,12 +447,13 @@ static struct atalk_route *atrtr_find(struct atalk_addr *target)
*/
if (r->target.s_node == target->s_node)
goto out;
- } else
+ } else {
/*
* this route will work if there isn't a
* direct host route, so cache it
*/
net_route = r;
+ }
}
}

@@ -615,8 +619,9 @@ static void atrtr_device_down(struct net_device *dev)
*r = tmp->next;
dev_put(dev);
kfree(tmp);
- } else
+ } else {
r = &tmp->next;
+ }
}
write_unlock_bh(&atalk_routes_lock);

@@ -1386,8 +1391,9 @@ static int atalk_route_packet(struct sk_buff *skb, struct net_device *dev,
struct sk_buff *nskb = skb_realloc_headroom(skb, 32);
kfree_skb(skb);
skb = nskb;
- } else
+ } else {
skb = skb_unshare(skb, GFP_ATOMIC);
+ }

/*
* If the buffer didn't vanish into the lack of space bitbucket we can
--
2.35.1


2022-04-25 23:56:27

by Jakub Kicinski

[permalink] [raw]
Subject: Re: [PATCH] net: appletalk: cleanup brace styling

On Sun, 24 Apr 2022 22:35:12 -0400 Ian Cowan wrote:
> This cleans up some brace styling to meet the style guide. There is one
> exception where the compiler wants unnecessary braces to prevent
> multiple if/else ambiguity.
>
> Signed-off-by: Ian Cowan <[email protected]>

Please don't send pure style cleanups to networking, especially
to dinosaur code. Thanks!