From mboxrd@z Thu Jan 1 00:00:00 1970 From: daniel.lezcano@linaro.org (Daniel Lezcano) Date: Tue, 1 Aug 2017 13:34:44 +0200 Subject: [PATCH] clocksource: arm_arch_timer: Fix mem frame loop initialization In-Reply-To: <20170801111222.GC9347@leverpostej> References: <20170731183728.61087-1-mka@chromium.org> <20170801111222.GC9347@leverpostej> Message-ID: <20170801113444.GB1919@mai> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Tue, Aug 01, 2017 at 12:12:23PM +0100, Mark Rutland wrote: > On Mon, Jul 31, 2017 at 11:37:28AM -0700, Matthias Kaehlcke wrote: > > The loop to find the best memory frame in arch_timer_mem_acpi_init() > > initializes the loop counter with itself ('i = i'), which is suspicious > > in the first place and pointed out by clang. The loop condition is > > 'i < timer_count' and a prior for loop exits when 'i' reaches > > 'timer_count', therefore the second loop is never executed. > > > > Initialize the loop counter with 0 to iterate over all timers, which > > supposedly was the intention before the typo monster attacked. > > > > Fixes: c2743a36765d3 ("clocksource: arm_arch_timer: add GTDT support for memory-mapped timer") > > Signed-off-by: Matthias Kaehlcke > > Ard also spotted this issue [1], along with another issue we still need > to solve. In the mean time it would be nice to have this fixed, so: > > Reported-by: Ard Biesheuvel > Acked-by: Mark Rutland > > Daniel, Thomas, > > Could one of you please pick this up as a fix, with the above tags? Hi Mark, picked as a fix with the above tags. Thanks. -- Daniel From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751779AbdHALeu (ORCPT ); Tue, 1 Aug 2017 07:34:50 -0400 Received: from mail-wm0-f41.google.com ([74.125.82.41]:37980 "EHLO mail-wm0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751352AbdHALet (ORCPT ); Tue, 1 Aug 2017 07:34:49 -0400 Date: Tue, 1 Aug 2017 13:34:44 +0200 From: Daniel Lezcano To: Mark Rutland Cc: Matthias Kaehlcke , Thomas Gleixner , Fu Wei , Marc Zyngier , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Doug Anderson , ard.biesheuvel@linaro.org Subject: Re: [PATCH] clocksource: arm_arch_timer: Fix mem frame loop initialization Message-ID: <20170801113444.GB1919@mai> References: <20170731183728.61087-1-mka@chromium.org> <20170801111222.GC9347@leverpostej> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170801111222.GC9347@leverpostej> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 01, 2017 at 12:12:23PM +0100, Mark Rutland wrote: > On Mon, Jul 31, 2017 at 11:37:28AM -0700, Matthias Kaehlcke wrote: > > The loop to find the best memory frame in arch_timer_mem_acpi_init() > > initializes the loop counter with itself ('i = i'), which is suspicious > > in the first place and pointed out by clang. The loop condition is > > 'i < timer_count' and a prior for loop exits when 'i' reaches > > 'timer_count', therefore the second loop is never executed. > > > > Initialize the loop counter with 0 to iterate over all timers, which > > supposedly was the intention before the typo monster attacked. > > > > Fixes: c2743a36765d3 ("clocksource: arm_arch_timer: add GTDT support for memory-mapped timer") > > Signed-off-by: Matthias Kaehlcke > > Ard also spotted this issue [1], along with another issue we still need > to solve. In the mean time it would be nice to have this fixed, so: > > Reported-by: Ard Biesheuvel > Acked-by: Mark Rutland > > Daniel, Thomas, > > Could one of you please pick this up as a fix, with the above tags? Hi Mark, picked as a fix with the above tags. Thanks. -- Daniel