From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755609Ab1BASrp (ORCPT ); Tue, 1 Feb 2011 13:47:45 -0500 Received: from www.tglx.de ([62.245.132.106]:45444 "EHLO www.tglx.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751503Ab1BASro (ORCPT ); Tue, 1 Feb 2011 13:47:44 -0500 Date: Tue, 1 Feb 2011 19:47:36 +0100 (CET) From: Thomas Gleixner To: John Stultz cc: LKML , Jamie Lokier , Alexander Shishkin , =?ISO-8859-15?Q?Arve_Hj=F8nnev=E5g?= Subject: Re: [PATCH 1/2] hrtimers: extend hrtimer base code to handle more then 2 clockids In-Reply-To: <1296585448.3336.16.camel@work-vm> Message-ID: References: <1296531837-12879-1-git-send-email-john.stultz@linaro.org> <1296531837-12879-2-git-send-email-john.stultz@linaro.org> <1296585448.3336.16.camel@work-vm> User-Agent: Alpine 2.00 (LFD 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 1 Feb 2011, John Stultz wrote: > On Tue, 2011-02-01 at 15:10 +0100, Thomas Gleixner wrote: > > On Mon, 31 Jan 2011, John Stultz wrote: > > > +static inline int hrtimer_clockid_to_base(clockid_t clock_id) > > > +{ > > > + int ret = hrtimer_clock_to_base_table[clock_id]; > > > + > > > + if(ret == -1) { > > > + WARN_ON(1); > > > + /* We just hit an invalid clock base, > > > + * but returning -1 isn't safe, so > > > + * return the _REALTIME base > > > + */ > > > > How can this happen ? > > It can't right now. I'm just worried someone will try to put a clockid > that doesn't have an hrtimer base into that function sometime in the > future. We can wrap it in a debug config maybe? Hmm. That would have exploded the current code as well. So I won't worry too much about. Thanks, tglx