Received: from eggs.gnu.org ([2001:4830:134:3::10]:35587) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1baX1b-0002NV-Hn for qemu-devel@nongnu.org; Thu, 18 Aug 2016 19:47:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1baX1Y-0004j5-Dk for qemu-devel@nongnu.org; Thu, 18 Aug 2016 19:47:03 -0400 Received: from mail-out.m-online.net ([2001:a60:0:28:0:1:25:1]:48511) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1baX1Y-0004iG-72 for qemu-devel@nongnu.org; Thu, 18 Aug 2016 19:47:00 -0400 References: <1469708878-9453-1-git-send-email-marex@denx.de> <1469708878-9453-5-git-send-email-marex@denx.de> <8441a477-57c4-7deb-6531-98ab125cc3b3@gmail.com> <40332f61-6523-9c59-6c35-ed59aeb6fef4@denx.de> <7e76da71-3037-bb9b-dfaf-2146a0a465b0@denx.de> <4123941b-73a0-fec3-4af8-ada701832f48@gmail.com> <0f952ce0-e9f3-5335-4fcc-899cb6f70ad0@denx.de> <9227bfa4-a356-5960-5723-e06c4e0f3337@gmail.com> From: Marek Vasut Message-ID: <1e89db9a-b440-cdf7-a000-e072a1789014@denx.de> Date: Fri, 19 Aug 2016 01:24:11 +0200 MIME-Version: 1.0 In-Reply-To: <9227bfa4-a356-5960-5723-e06c4e0f3337@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 5/7] nios2: Add periodic timer emulation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Dmitry Osipenko , qemu-devel@nongnu.org Cc: Jeff Da Silva , Chris Wulff , Sandra Loosemore , Yves Vandervennet , Ley Foon Tan , Juro Bystricky On 08/18/2016 11:49 AM, Dmitry Osipenko wrote: > On 17.08.2016 23:19, Marek Vasut wrote: >> On 08/16/2016 11:38 PM, Dmitry Osipenko wrote: >> >> [...] >> >>>>>> Well what is sane clock frequency for hardware which can have arbitrary >>>>>> frequency configured in ? >>>>>> >>>>> >>>>> You could set to the one that is used by "10M50 GHRD" patch for example. >>>> >>>> That doesn't sound right . I can set it to 1 (Hz) , that should make it >>>> slow enough to signalize that something is broken while providing valid >>>> number. >>>> >>> >>> I'm not sure about it. Explicitly showing that something is wrong would be better. >>> >>>> +static void altera_timer_realize(DeviceState *dev, Error **errp) >>>> +{ >>>> + AlteraTimer *t = ALTERA_TIMER(dev); >>>> + SysBusDevice *sbd = SYS_BUS_DEVICE(dev); >>>> + >>>> + assert(t->freq_hz != 0); >>> >>> If you would prefer to keep error'ing out, then I can suggest to add some >>> verbose message instead of the assertion, like: >>> >>> if (!t->freq_hz) { >>> error_setg(errp, "altera_timer: \"clock-frequency\" property " \ >>> "must be provided"); >>> return; >>> } >> >> That's better, thanks. >> >> btw breaking strings is frowned upon in linux/u-boot as it makes it >> impossible to git grep for error message. Does the same apply to qemu? >> > > Actually, "altera_timer: " prefix isn't needed, as it should be already included > in the error message produced by by the error_setg(), so that string could be > squeezed into one line. And, of course, it could be rephrased more concisely. Even better, prefix dropped. Thanks So what about patches 1..5 ? Anything I should change there ? -- Best regards, Marek Vasut