From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753236AbbI3P1R (ORCPT ); Wed, 30 Sep 2015 11:27:17 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:25166 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750768AbbI3P1P (ORCPT ); Wed, 30 Sep 2015 11:27:15 -0400 Subject: Re: [PATCH 2/2] clocksource/drivers/keystone: Fix bad NO_IRQ usage To: Daniel Lezcano , tglx@linutronix.de References: <560BB452.1020000@linaro.org> <1443607710-10415-1-git-send-email-daniel.lezcano@linaro.org> <1443607710-10415-2-git-send-email-daniel.lezcano@linaro.org> Cc: linux@arm.linux.org.uk, Santosh Shilimkar , "moderated list:ARM/TEXAS INSTRUM..." , "open list:ARM/TEXAS INSTRUM..." From: santosh shilimkar Organization: Oracle Corporation Message-ID: <560BFF1F.6000201@oracle.com> Date: Wed, 30 Sep 2015 08:26:23 -0700 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <1443607710-10415-2-git-send-email-daniel.lezcano@linaro.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Source-IP: aserv0021.oracle.com [141.146.126.233] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/30/2015 3:08 AM, Daniel Lezcano wrote: > The current code assumes the 'irq_of_parse_and_map' will return NO_IRQ in case > of failure. Unfortunately, the NO_IRQ is not consistent across the different > architectures and we must not rely on it. > > NO_IRQ is equal to '-1' on ARM and 'irq_of_parse_and_map' returns '0' in case > of an error. Hence, the latter won't be detected and will lead to a crash. > > Fix this by just checking 'irq' is different from zero. > > Signed-off-by: Daniel Lezcano > --- > drivers/clocksource/timer-keystone.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > Acked-by: Santosh Shilimkar