From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751416AbdGQROK (ORCPT ); Mon, 17 Jul 2017 13:14:10 -0400 Received: from mail-lf0-f44.google.com ([209.85.215.44]:34472 "EHLO mail-lf0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751293AbdGQROI (ORCPT ); Mon, 17 Jul 2017 13:14:08 -0400 Subject: Re: [PATCH] timer-of: handle of_irq_get() result correctly To: Daniel Lezcano , Thomas Gleixner References: <20170716195609.570376795@cogentembedded.com> Cc: linux-kernel@vger.kernel.org From: Sergei Shtylyov Organization: Cogent Embedded Message-ID: Date: Mon, 17 Jul 2017 20:14:04 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <20170716195609.570376795@cogentembedded.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello! On 07/16/2017 10:55 PM, Sergei Shtylyov wrote: > of_irq_get_byname() may return a negative error number as well as 0 on > failure, while timer_irq_init() only checks for 0, blithely continuing with > the call to request_[percpu_]irq() -- those functions expect *unsigned int*, > so would probably fail anyway when a large IRQ number resulting from a > conversion of a negative error number is passed to them... This, however, > is incorrect behavior -- error number is not IRQ number. > > Fileter out the negative error numbers, complain, and return them to the Oops, a typo. And the subject should have of_irq_get_byname(). I'll repost. > timer_irq_init()'s callers... > > Fixes: dc11bae78529 ("clocksource/drivers: Add timer-of common init routine") > Signed-off-by: Sergei Shtylyov [...] MBR, Sergei