Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp446919ybl; Wed, 4 Dec 2019 05:30:27 -0800 (PST) X-Google-Smtp-Source: APXvYqzY8eK2K7Rrw1+mU7vij0iunS6Cn4jQJlabpUG54p0NQ4d4pjIU/a8+hLcXip0GENyKMUjR X-Received: by 2002:aca:2207:: with SMTP id b7mr2546742oic.109.1575466227266; Wed, 04 Dec 2019 05:30:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575466227; cv=none; d=google.com; s=arc-20160816; b=g9hx6u160yeOgTBW9xX3k6hxpF1jw9WIsQ2V6DUMkEVC9Ht/kakvjfC8WDbvOIgs1o rjCTAIyKS5UGfgi80JUHwanqAqfETNzBwsIgzrGBaHL35NHkZXsyH9FAEIBXfHM/+wz7 WTfa2NRJoDDrfL5lW57zC/Zz6r3JXMZr3v8hWxiSh7zl3PR8iilwqH2Nf0ENiCmYgEt0 YS/DWXWkXU01OtlmVF74lokyJaafhmNhVWWAFkoLpL5y6uaB6OTOhTeGchjGn24LGJfM JKy/WZzMLyiQEOsMSvNcSEimbioSi387n+g1ZV7GPm7Z25QD7WR9XS+HmP2gBBR6Nvwc 9l3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from; bh=4PX8jQuEvmQ3g2iYiAt1rKkdLanlpygyVvmFGgDRr/A=; b=kAQr/bA5XtpDQzxsPjfwWGjiDdBnXLjEIkceMRvsqg+7OGyo7xfo8rPI6vV0qEXEgc vADhVxe9iXPsInrsUxLRsLYRSTsV5Sz6aKNxVmv02gGEJzfg8F93qwyOzH7Hzs7/Bs3d ZG/W8KvtBvhJBmpA9PN+MOnuVWx1F+YMxG3HvWsvnLin4ClEPGWorCXFyV1hn+yjdNHT 0vyJbN1M79yNohINiJVIYCctzVjw64Q+ZSPVaXuQJLsTtK5gjU1L3awHV1mjKrlfaboN Wew9tNXBvTQZzEwZUOGNSJT29OO/Yamr3ySh7Ug/BQo470iFAEsAOyYGlvUnPqMWhzjg dzFA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w5si2250628oib.134.2019.12.04.05.30.13; Wed, 04 Dec 2019 05:30:27 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727910AbfLDN3H (ORCPT + 99 others); Wed, 4 Dec 2019 08:29:07 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:57022 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727530AbfLDN3H (ORCPT ); Wed, 4 Dec 2019 08:29:07 -0500 Received: from localhost ([127.0.0.1] helo=vostro.local) by Galois.linutronix.de with esmtp (Exim 4.80) (envelope-from ) id 1icUi2-0000ZT-Cy; Wed, 04 Dec 2019 14:28:50 +0100 From: John Ogness To: Petr Mladek Cc: linux-kernel@vger.kernel.org, Peter Zijlstra , Sergey Senozhatsky , Steven Rostedt , Linus Torvalds , Greg Kroah-Hartman , Andrea Parri , Thomas Gleixner , Sergey Senozhatsky , Brendan Higgins , kexec@lists.infradead.org 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> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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