[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Wed, 12 Dec 2018 10:35:23 -0500
From: Willem de Bruijn <willemdebruijn.kernel@...il.com>
To: Deepa Dinamani <deepa.kernel@...il.com>
Cc: David Miller <davem@...emloft.net>,
LKML <linux-kernel@...r.kernel.org>,
Network Development <netdev@...r.kernel.org>,
Arnd Bergmann <arnd@...db.de>,
y2038 Mailman List <y2038@...ts.linaro.org>,
jejb@...isc-linux.org, ralf@...ux-mips.org, rth@...ddle.net,
linux-alpha@...r.kernel.org, linux-mips@...ux-mips.org,
linux-parisc@...r.kernel.org, linux-rdma@...r.kernel.org,
sparclinux@...r.kernel.org
Subject: Re: [PATCH v2 6/8] socket: Add SO_TIMESTAMP[NS]_NEW
> This did not address yet the previous comments on consistency and
> unnecessary code churn.
>
> The existing logic to differentiate SO_TIMESTAMP from SO_TIMESTAMPNS
> in both tcp_recv_timestamp and __sock_recv_timestamp is
>
> if (sock_flag(sk, SOCK_RCVTSTAMP)) {
> if (sock_flag(sk, SOCK_RCVTSTAMPNS))
> /* timespec case */
> else
> /* timeval case */
> }
>
> A new level of nesting needs to be added to differentiate .._OLD from .._NEW.
>
> Even if massively changing the original functions, please do so
> consistently, either
>
> if (sock_flag(sk, SOCK_RCVTSTAMP)) {
> if (sock_flag(sk, SOCK_TSTAMP_NEW) {
> /* new code */
> } else {
> if (sock_flag(sk, SOCK_RCVTSTAMPNS))
> /* timespec case */
> else
> /* timeval case */
> }
> }
This first example is wrong. I meant
if (sock_flag(sk, SOCK_RCVTSTAMP)) {
if (sock_flag(sk, SOCK_RCVTSTAMPNS)) {
if (sock_flag(sk, SOCK_TSTAMP_NEW)
/* new code */
else
/* timespec case */
} else {
if (sock_flag(sk, SOCK_TSTAMP_NEW)
/* new code */
else
/* timeval case */
}
}
Powered by blists - more mailing lists