From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752522AbdGCGVz (ORCPT ); Mon, 3 Jul 2017 02:21:55 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:58856 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750793AbdGCGVw (ORCPT ); Mon, 3 Jul 2017 02:21:52 -0400 Date: Mon, 3 Jul 2017 08:21:52 +0200 From: Greg KH To: Lynn Lei Cc: sudipm.mukherjee@gmail.com, devel@driverdev.osuosl.org, linux-fbdev@vger.kernel.org, teddy.wang@siliconmotion.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] staging: sm750fb: refactor the clock frequency calculation method Message-ID: <20170703062152.GC13523@kroah.com> References: <20170702122426.GA17561@lynnl.wit> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170702122426.GA17561@lynnl.wit> User-Agent: Mutt/1.8.3 (2017-05-23) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jul 02, 2017 at 08:24:26PM +0800, Lynn Lei wrote: > speed up calculation by merging two divisions into one. How much did you speed it up? Please provide proof of anything like this if you say it is a speed up. > > Signed-off-by: Lynn Lei > --- > drivers/staging/sm750fb/ddk750_chip.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/staging/sm750fb/ddk750_chip.c b/drivers/staging/sm750fb/ddk750_chip.c > index c51761221131..5970c3792f27 100644 > --- a/drivers/staging/sm750fb/ddk750_chip.c > +++ b/drivers/staging/sm750fb/ddk750_chip.c > @@ -44,7 +44,7 @@ static unsigned int get_mxclk_freq(void) > OD = (pll_reg & PLL_CTRL_OD_MASK) >> PLL_CTRL_OD_SHIFT; > POD = (pll_reg & PLL_CTRL_POD_MASK) >> PLL_CTRL_POD_SHIFT; > > - return DEFAULT_INPUT_CLOCK * M / N / (1 << OD) / (1 << POD); > + return DEFAULT_INPUT_CLOCK * M / N / (1 << (OD + POD)); Are you sure that gcc didn't already do this for you? It's a constant number, I doubt this did anything at all. thanks, greg k-h