From: Jiri Pirko <jiri@resnulli.us>
To: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Cc: davem@davemloft.net, netdev@vger.kernel.org
Subject: Re: [RFC net-next PATCH] ipv6: New define for reoccurring code
Date: Sat, 18 Jan 2020 08:10:13 +0100 [thread overview]
Message-ID: <20200118071013.GL2131@nanopsycho> (raw)
In-Reply-To: <20200117215642.2029945-1-jeffrey.t.kirsher@intel.com>
Fri, Jan 17, 2020 at 10:56:42PM CET, jeffrey.t.kirsher@intel.com wrote:
>Through out the kernel, sizeof() is used to determine the size of the IPv6
>address structure, so create a define for the commonly used code.
>
>s/sizeof(struct in6_addr)/ipv6_addr_size/g
>
>This is just a portion of the instances in the kernel and before cleaning
>up all the occurrences, wanted to make sure that this was a desired change
>or if this obfuscates the code.
>
>Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
>---
> include/uapi/linux/in6.h | 1 +
> net/core/filter.c | 2 +-
> net/core/pktgen.c | 2 +-
> net/ipv6/addrconf.c | 14 +++++++-------
> net/ipv6/addrlabel.c | 2 +-
> net/ipv6/exthdrs.c | 4 ++--
> net/ipv6/fib6_rules.c | 6 +++---
> net/ipv6/ila/ila_lwt.c | 2 +-
> net/ipv6/ip6_gre.c | 18 +++++++++---------
> net/ipv6/ip6_output.c | 2 +-
> net/ipv6/ip6_tunnel.c | 14 +++++++-------
> net/ipv6/ip6_vti.c | 14 +++++++-------
> net/ipv6/ip6mr.c | 10 +++++-----
> net/ipv6/ipcomp6.c | 4 ++--
> net/ipv6/ndisc.c | 4 ++--
> net/ipv6/netfilter/ip6t_rpfilter.c | 2 +-
> net/ipv6/netfilter/ip6t_srh.c | 4 ++--
> net/ipv6/netfilter/nft_dup_ipv6.c | 2 +-
> net/ipv6/seg6.c | 4 ++--
> net/ipv6/seg6_iptunnel.c | 4 ++--
> net/ipv6/seg6_local.c | 12 ++++++------
> net/ipv6/sit.c | 4 ++--
> net/openvswitch/conntrack.c | 4 ++--
> net/openvswitch/flow_netlink.c | 4 ++--
> net/sched/cls_flower.c | 16 ++++++++--------
> net/socket.c | 2 +-
> security/selinux/netnode.c | 2 +-
> tools/lib/traceevent/event-parse.c | 2 +-
> tools/testing/selftests/bpf/test_sock_addr.c | 2 +-
> .../networking/timestamping/txtimestamp.c | 2 +-
> 30 files changed, 83 insertions(+), 82 deletions(-)
>
>diff --git a/include/uapi/linux/in6.h b/include/uapi/linux/in6.h
>index 9f2273a08356..24547a51e715 100644
>--- a/include/uapi/linux/in6.h
>+++ b/include/uapi/linux/in6.h
>@@ -44,6 +44,7 @@ struct in6_addr {
> #define s6_addr32 in6_u.u6_addr32
> #endif
> };
>+#define ipv6_addr_size sizeof(struct in6_addr)
Shouldn't it be rather "in6_addr_size" to be aligned with the struct
name? Also, as it is a define shouldn't it be rather "IN6_ADDR_SIZE"?
[...]
prev parent reply other threads:[~2020-01-18 7:10 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-17 21:56 [RFC net-next PATCH] ipv6: New define for reoccurring code Jeff Kirsher
2020-01-17 22:17 ` Eric Dumazet
2020-01-17 23:36 ` Alexei Starovoitov
2020-01-18 7:10 ` Jiri Pirko [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200118071013.GL2131@nanopsycho \
--to=jiri@resnulli.us \
--cc=davem@davemloft.net \
--cc=jeffrey.t.kirsher@intel.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox