From mboxrd@z Thu Jan 1 00:00:00 1970 From: Willem de Bruijn Subject: Re: [PATCH v2 6/8] socket: Add SO_TIMESTAMP[NS]_NEW Date: Wed, 12 Dec 2018 10:35:23 -0500 Message-ID: References: <20181211202520.16799-1-deepa.kernel@gmail.com> <20181211202520.16799-7-deepa.kernel@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Return-path: In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org To: Deepa Dinamani Cc: David Miller , LKML , Network Development , Arnd Bergmann , y2038 Mailman List , jejb@parisc-linux.org, ralf@linux-mips.org, rth@twiddle.net, linux-alpha@vger.kernel.org, linux-mips@linux-mips.org, linux-parisc@vger.kernel.org, linux-rdma@vger.kernel.org, sparclinux@vger.kernel.org List-Id: linux-rdma@vger.kernel.org > 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 */ } } From mboxrd@z Thu Jan 1 00:00:00 1970 From: Willem de Bruijn Date: Wed, 12 Dec 2018 15:35:23 +0000 Subject: Re: [PATCH v2 6/8] socket: Add SO_TIMESTAMP[NS]_NEW Message-Id: List-Id: References: <20181211202520.16799-1-deepa.kernel@gmail.com> <20181211202520.16799-7-deepa.kernel@gmail.com> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Deepa Dinamani Cc: David Miller , LKML , Network Development , Arnd Bergmann , y2038 Mailman List , jejb@parisc-linux.org, ralf@linux-mips.org, rth@twiddle.net, linux-alpha@vger.kernel.org, linux-mips@linux-mips.org, linux-parisc@vger.kernel.org, linux-rdma@vger.kernel.org, sparclinux@vger.kernel.org > 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 */ } }