From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from galois.linutronix.de ([2a0a:51c0:0:12e:550::1]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1icUiB-0007F6-2j for kexec@lists.infradead.org; Wed, 04 Dec 2019 13:29:00 +0000 From: John Ogness Subject: Re: [RFC PATCH v5 2/3] printk-rb: new printk ringbuffer implementation (reader) References: <20191128015235.12940-1-john.ogness@linutronix.de> <20191128015235.12940-3-john.ogness@linutronix.de> <20191203120622.zux33do54rmjafns@pathway.suse.cz> <87pnh5bjz4.fsf@linutronix.de> <20191204125450.ob5b7xi3gevor4qz@pathway.suse.cz> Date: Wed, 04 Dec 2019 14:28:48 +0100 In-Reply-To: <20191204125450.ob5b7xi3gevor4qz@pathway.suse.cz> (Petr Mladek's message of "Wed, 4 Dec 2019 13:54:50 +0100") Message-ID: <87a788fcdr.fsf@linutronix.de> MIME-Version: 1.0 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "kexec" Errors-To: kexec-bounces+dwmw2=infradead.org@lists.infradead.org To: Petr Mladek Cc: Andrea Parri , Sergey Senozhatsky , Peter Zijlstra , Greg Kroah-Hartman , Brendan Higgins , linux-kernel@vger.kernel.org, Steven Rostedt , Sergey Senozhatsky , Thomas Gleixner , Linus Torvalds , kexec@lists.infradead.org On 2019-12-04, Petr Mladek wrote: >> + } else if ((DATA_WRAPS(data_ring, blk_lpos->begin) + 1 == >> + DATA_WRAPS(data_ring, blk_lpos->next)) || >> + ((DATA_WRAPS(data_ring, blk_lpos->begin) == >> + DATA_WRAPS(data_ring, -1UL)) && >> + (DATA_WRAPS(data_ring, blk_lpos->next) == 0))) { > > I wonder if the following might be easier to understand even for > people like me ;-) > > } else if (DATA_WRAPS(data_ring, blk_lpos->begin + DATA_SIZE(data_ring)) == > DATA_WRAPS(data_ring, blk_lpos->next)) { Yes, this is clear and covers both cases. Thanks. John _______________________________________________ kexec mailing list kexec@lists.infradead.org http://lists.infradead.org/mailman/listinfo/kexec