From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sascha Hauer Subject: Re: [PATCH] gpu: host1x: clk_round_rate() can return a zero upon error Date: Wed, 11 Dec 2013 08:51:17 +0100 Message-ID: <20131211075117.GA24559@pengutronix.de> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: Sender: linux-tegra-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Paul Walmsley Cc: Mikko Perttunen , Arto Merilainen , Thierry Reding , Terje =?iso-8859-15?Q?Bergstr=F6m?= , linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org List-Id: dri-devel@lists.freedesktop.org On Mon, Dec 09, 2013 at 06:00:12PM -0800, Paul Walmsley wrote: > > Treat both negative and zero return values from clk_round_rate() as > errors. This is needed since subsequent patches will convert > clk_round_rate()'s return value to be an unsigned type, rather than a > signed type, since some clock sources can generate rates higher than > (2^31)-1 Hz. > > Eventually, when calling clk_round_rate(), only a return value of zero > will be considered a error. All other values will be considered valid > rates. The comparison against values less than 0 is kept to preserve > the correct behavior in the meantime. Shouldn't it be an error when the result is not within sensible limits instead? What do you do with a rate of 1Hz? Sascha -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |