Received: from eggs.gnu.org ([2001:4830:134:3::10]:52636) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aNn3O-0006L1-N0 for qemu-devel@nongnu.org; Mon, 25 Jan 2016 14:43:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aNn3N-0001Ct-TR for qemu-devel@nongnu.org; Mon, 25 Jan 2016 14:43:58 -0500 References: <9fb47bb0f1355221ef074766d5cc49f2de97e79b.1453402860.git.digetx@gmail.com> From: Dmitry Osipenko Message-ID: <56A67ACA.4090801@gmail.com> Date: Mon, 25 Jan 2016 22:43:06 +0300 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH v11 2/7] hw/ptimer: Perform counter wrap around if timer already expired List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Crosthwaite Cc: Peter Maydell , qemu-arm , QEMU Developers Hello Peter, 24.01.2016 08:29, Peter Crosthwaite пишет: [snip] >> + if (expired && (counter != 0)) { >> + /* Wrap around periodic counter. */ >> + counter = s->limit - counter % s->limit; >> + } Noticed another nit here. This should be: counter = s->limit - (counter - 1) % s->limit; So wraparound for counter = -1 is counter = limit (not limit - 1). Will fix it in V12. I suppose your r-b is still valid, otherwise please let me know. -- Dmitry