From patchwork Sun Jul 2 12:24:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lynn Lei X-Patchwork-Id: 9821117 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 40568602F0 for ; Sun, 2 Jul 2017 12:24:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2510426E76 for ; Sun, 2 Jul 2017 12:24:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 17DE12846B; Sun, 2 Jul 2017 12:24:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B157B26E76 for ; Sun, 2 Jul 2017 12:24:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751624AbdGBMYj (ORCPT ); Sun, 2 Jul 2017 08:24:39 -0400 Received: from mail-pg0-f67.google.com ([74.125.83.67]:34415 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751611AbdGBMYi (ORCPT ); Sun, 2 Jul 2017 08:24:38 -0400 Received: by mail-pg0-f67.google.com with SMTP id j186so20247272pge.1; Sun, 02 Jul 2017 05:24:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mime-version:content-disposition; bh=ZBc4Oa2rcTClWHDalksgu7nAw0ASSikWCMipLu2ezo0=; b=dI3H+EkKMSA66Gqrzk2ZcYseqtZmGITmmNw1kPmpbYHI5XUNtRFl0542CgB9lbH0We u2oJFGjykWGM/h06ph/IUQZCo/NHxpYbgH6yGGmO5rtaKAx/XwqRtf6nIdlEl4nyvsbK X73YQnXmbMSck/Stt+MRepACACq5UjX6uOuzCjlpwBiy3TL0KuZFYImEEPiyTYcwMSWy yOUwyfE8HDTjeZKLLhQdmqloHShYfXr8vC4Qy1tZ1OcBGt9ECwJlih0qsIfN8PBdzTDh beaJ6+a4KeRCbA/JXGTOWB979ArruI/vXh32o25xDXiwH1r9OudnckTMk6JtYO4MQhRy 6Npg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition; bh=ZBc4Oa2rcTClWHDalksgu7nAw0ASSikWCMipLu2ezo0=; b=q3SGBJFR5yV8fkSj26fcFGdPEnIOz86OtE9u9IkNA9N1e4h89MaJqalg+CIhcQRoCF gyd1UOEVOWrrPmn5jrncS3ySRKCu//59zIZ5AKEZue8itSA2K+CcwsghZDsIFhKDqcpT vZGmqsNzufHyRV5bke+8EEUpCXiiQnFJE0cbvUbjd+i9+U/LbZkf9W1eQxh9PJFGFBMR TCdgMvgCfufNjRxW7BIseNBLFqqZcbcfrzQD+mhA+zfhNj23Gy6n2iILe2zTstK1ZJVC 1LavVa8YRso7DLXWXA/EObG4v2QIn2GW834xqfnlCD8iayNRv9JsEduoP/AH2J/oa3/B 6pFg== X-Gm-Message-State: AIVw113tsneAI2ecnA5z3JBwDm37JzI6J50ZsC3GdYVGWNXXKuEbHcqj DM2X0mCEcFdKEg== X-Received: by 10.84.217.217 with SMTP id d25mr5152546plj.145.1498998278090; Sun, 02 Jul 2017 05:24:38 -0700 (PDT) Received: from lynnl.wit ([112.64.216.51]) by smtp.gmail.com with ESMTPSA id o13sm30711537pfa.120.2017.07.02.05.24.34 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 02 Jul 2017 05:24:36 -0700 (PDT) Date: Sun, 2 Jul 2017 20:24:26 +0800 From: Lynn Lei To: sudipm.mukherjee@gmail.com Cc: teddy.wang@siliconmotion.com, gregkh@linuxfoundation.org, linux-fbdev@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: [PATCH] staging: sm750fb: refactor the clock frequency calculation method Message-ID: <20170702122426.GA17561@lynnl.wit> MIME-Version: 1.0 Content-Disposition: inline Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP speed up calculation by merging two divisions into one. 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)); } /*