From patchwork Thu Feb 11 14:11:20 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chanho Park X-Patchwork-Id: 8280001 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 87549BEEE5 for ; Thu, 11 Feb 2016 14:11:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A5E8F20306 for ; Thu, 11 Feb 2016 14:11:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 221AD2039E for ; Thu, 11 Feb 2016 14:11:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751235AbcBKOLf (ORCPT ); Thu, 11 Feb 2016 09:11:35 -0500 Received: from mail-pf0-f173.google.com ([209.85.192.173]:34612 "EHLO mail-pf0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751123AbcBKOLe (ORCPT ); Thu, 11 Feb 2016 09:11:34 -0500 Received: by mail-pf0-f173.google.com with SMTP id x65so30092572pfb.1 for ; Thu, 11 Feb 2016 06:11:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=Ahge4rC77GWj3xnR3NBnkm7/bXKaFYoM6wSjmmPkBKA=; b=iGINec9NU996+nkhON3ZGR9U9+Kwlb5XBz1bx3wLrvyuThRFgQVcxcRecAwtAZ3BAV oqwu31hMCLvggPVK2uOQfdvfQ0E7FcFHTLv/w7aSAeo/HFHE+GN5Z2TEnoOac4mkSERj if+AtWtPES26tOZhRd9Yp05uGsx0zjL7bXNNSLyV3C61BFc8cI9pDtaaBsR/F/a2i8lk MjL2Z3qaLviQc7GTgZvoIPwucOi2ZGfCOWcD7LRTy9sRiJUZGZ/3NMGuVINWBrsrmTk4 jVu3V9tcSvM4h4E2CmuxfkwNk/BuAiiJ2Y6B4zprGejbCD9IGl0fZzJt8Culy4k5ZtIO 8AVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=Ahge4rC77GWj3xnR3NBnkm7/bXKaFYoM6wSjmmPkBKA=; b=PYsfnf3IPu8Cw9WR3LYDtZ5IXBGCpTzqW6EIP1lCAzdmX++g60KgjFIN26IlHU7Ztx MIZ3/EIHZfSv2JnM2Igq2yGL8zT+rEM5FoulxaLkHUc59/KhchWFt0v5PrfTn+PqO1+x bdzs8RvqShTJf/rGMq8Wyf10nUp3Nm6EcJDg5htf+Gt3UefGLmoiY0fV1aOj+x5CkEO2 PVpzMbbDJZrGUi7nMs/FmvMEdIK+Uj4WAMKcco2524X0suy6/tI+Grb8zRgFMkE5nbgC 53uNAFoRpuWsSP4bH8BlGbaEH6gIXlfrZd4CTvewqXYEhuYEcBzuBE6B64U5LwlQ/MpL yeNw== X-Gm-Message-State: AG10YOTts6VccKJFcN99vs1+PGkYSQgTQha1M/KKe7lGxUxuYN72aZFoPVLaxSQU2+aJwQ== X-Received: by 10.98.33.131 with SMTP id o3mr67033396pfj.97.1455199894192; Thu, 11 Feb 2016 06:11:34 -0800 (PST) Received: from localhost.localdomain ([182.225.40.2]) by smtp.gmail.com with ESMTPSA id ah10sm12764697pad.23.2016.02.11.06.11.29 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 11 Feb 2016 06:11:32 -0800 (PST) From: Chanho Park To: inki.dae@samsung.com Cc: dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org, Chanho Park , Joonyoung Shim , Seung-Woo Kim Subject: [PATCH] drm/exynos: use DIV_ROUND_CLOSEST to find the closest div Date: Thu, 11 Feb 2016 23:11:20 +0900 Message-Id: <1455199880-4426-1-git-send-email-parkch98@gmail.com> X-Mailer: git-send-email 2.5.0 Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Chanho Park This patch uses DIV_ROUND_CLOSEST instead of DIV_ROUND_UP The DIV_ROUND_CLOSEST can be used to find the closest integer value when we divide some integers. Cc: Inki Dae Cc: Joonyoung Shim Cc: Seung-Woo Kim Signed-off-by: Chanho Park --- drivers/gpu/drm/exynos/exynos_drm_fimd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c index 4fb2952..da97f93 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c @@ -383,7 +383,7 @@ static u32 fimd_calc_clkdiv(struct fimd_context *ctx, } /* Find the clock divider value that gets us closest to ideal_clk */ - clkdiv = DIV_ROUND_UP(clk_get_rate(ctx->lcd_clk), ideal_clk); + clkdiv = DIV_ROUND_CLOSEST(clk_get_rate(ctx->lcd_clk), ideal_clk); return (clkdiv < 0x100) ? clkdiv : 0xff; }