diff mbox series

[v2,1/9] net: ip_rt_get_source() - use new style struct initializer instead of memset

Message ID 20180930064454.187537-1-zenczykowski@gmail.com
State Accepted, archived
Delegated to: David Miller
Headers show
Series [v2,1/9] net: ip_rt_get_source() - use new style struct initializer instead of memset | expand

Commit Message

Maciej Żenczykowski Sept. 30, 2018, 6:44 a.m. UTC
From: Maciej Żenczykowski <maze@google.com>

(allows for better compiler optimization)

Signed-off-by: Maciej Żenczykowski <maze@google.com>
---
 net/ipv4/route.c | 21 +++++++++------------
 1 file changed, 9 insertions(+), 12 deletions(-)

Comments

David Ahern Oct. 1, 2018, 3:20 p.m. UTC | #1
On 9/30/18 12:44 AM, Maciej Żenczykowski wrote:
> From: Maciej Żenczykowski <maze@google.com>
> 
> (allows for better compiler optimization)
> 
> Signed-off-by: Maciej Żenczykowski <maze@google.com>
> ---
>  net/ipv4/route.c | 21 +++++++++------------
>  1 file changed, 9 insertions(+), 12 deletions(-)
> 

Reviewed-by: David Ahern <dsahern@gmail.com>
David Miller Oct. 2, 2018, 11:13 p.m. UTC | #2
All 9 patches applied, thanks.

Please provide a proper "0/N" header posting in furture patch series
submissions.

Thank you.
Maciej Żenczykowski Oct. 2, 2018, 11:25 p.m. UTC | #3
> Please provide a proper "0/N" header posting in furture patch series
> submissions.
>
> Thank you.

Seeing as all but 2 of these patches were entirely independent should
I have sent them as individual patches instead (with one patch pair)?

Or are series preferred even if I ended up reuploading 9 of 11 with no
changes after the NAK on the two in v1?

Thanks,
Maciej
David Miller Oct. 3, 2018, 12:01 a.m. UTC | #4
From: Maciej Żenczykowski <zenczykowski@gmail.com>
Date: Tue, 2 Oct 2018 16:25:39 -0700

>> Please provide a proper "0/N" header posting in furture patch series
>> submissions.
>>
>> Thank you.
> 
> Seeing as all but 2 of these patches were entirely independent should
> I have sent them as individual patches instead (with one patch pair)?

They are logically related, so a series is best in this case.
diff mbox series

Patch

diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index dce2ed66ebe1..02482b71498b 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -1217,18 +1217,15 @@  void ip_rt_get_source(u8 *addr, struct sk_buff *skb, struct rtable *rt)
 		src = ip_hdr(skb)->saddr;
 	else {
 		struct fib_result res;
-		struct flowi4 fl4;
-		struct iphdr *iph;
-
-		iph = ip_hdr(skb);
-
-		memset(&fl4, 0, sizeof(fl4));
-		fl4.daddr = iph->daddr;
-		fl4.saddr = iph->saddr;
-		fl4.flowi4_tos = RT_TOS(iph->tos);
-		fl4.flowi4_oif = rt->dst.dev->ifindex;
-		fl4.flowi4_iif = skb->dev->ifindex;
-		fl4.flowi4_mark = skb->mark;
+		struct iphdr *iph = ip_hdr(skb);
+		struct flowi4 fl4 = {
+			.daddr = iph->daddr,
+			.saddr = iph->saddr,
+			.flowi4_tos = RT_TOS(iph->tos),
+			.flowi4_oif = rt->dst.dev->ifindex,
+			.flowi4_iif = skb->dev->ifindex,
+			.flowi4_mark = skb->mark,
+		};
 
 		rcu_read_lock();
 		if (fib_lookup(dev_net(rt->dst.dev), &fl4, &res, 0) == 0)