* [PATCH] net: appletalk: cleanup brace styling
@ 2022-04-25 2:35 Ian Cowan
2022-04-25 15:44 ` Jakub Kicinski
0 siblings, 1 reply; 2+ messages in thread
From: Ian Cowan @ 2022-04-25 2:35 UTC (permalink / raw)
To: David S. Miller
Cc: Jakub Kicinski, Paolo Abeni, netdev, linux-kernel, Ian Cowan
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 <ian@linux.cowan.aero>
---
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] net: appletalk: cleanup brace styling
2022-04-25 2:35 [PATCH] net: appletalk: cleanup brace styling Ian Cowan
@ 2022-04-25 15:44 ` Jakub Kicinski
0 siblings, 0 replies; 2+ messages in thread
From: Jakub Kicinski @ 2022-04-25 15:44 UTC (permalink / raw)
To: Ian Cowan; +Cc: David S. Miller, Paolo Abeni, netdev, linux-kernel
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 <ian@linux.cowan.aero>
Please don't send pure style cleanups to networking, especially
to dinosaur code. Thanks!
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-04-25 15:44 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-25 2:35 [PATCH] net: appletalk: cleanup brace styling Ian Cowan
2022-04-25 15:44 ` Jakub Kicinski
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.