From patchwork Mon May 2 20:25:39 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfram Sang X-Patchwork-Id: 8995571 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 990019F1C1 for ; Mon, 2 May 2016 20:26:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C3B312014A for ; Mon, 2 May 2016 20:26:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E520C201C7 for ; Mon, 2 May 2016 20:26:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755155AbcEBU0I (ORCPT ); Mon, 2 May 2016 16:26:08 -0400 Received: from sauhun.de ([89.238.76.85]:33994 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755003AbcEBU0I (ORCPT ); Mon, 2 May 2016 16:26:08 -0400 Received: from nl10x.mullvad.net ([37.48.113.81]:38858 helo=localhost) by pokefinder.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1axKPs-0005VY-Bc; Mon, 02 May 2016 22:26:04 +0200 From: Wolfram Sang To: linux-mmc@vger.kernel.org Cc: Wolfram Sang , linux-renesas-soc@vger.kernel.org, Geert Uytterhoeven , Ulf Hansson Subject: [RFC 1/4] mmc: sh_mobile_sdhi: make clk_update function more compact Date: Mon, 2 May 2016 22:25:39 +0200 Message-Id: <1462220742-4426-2-git-send-email-wsa@the-dreams.de> X-Mailer: git-send-email 2.6.2 In-Reply-To: <1462220742-4426-1-git-send-email-wsa@the-dreams.de> References: <1462220742-4426-1-git-send-email-wsa@the-dreams.de> Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Spam-Status: No, score=-7.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, 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: Wolfram Sang Save a few lines, the codebase is large enough. Signed-off-by: Wolfram Sang --- drivers/mmc/host/sh_mobile_sdhi.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c index f8ea3d1d6de382..6857e4ba724415 100644 --- a/drivers/mmc/host/sh_mobile_sdhi.c +++ b/drivers/mmc/host/sh_mobile_sdhi.c @@ -165,12 +165,9 @@ static unsigned int sh_mobile_sdhi_clk_update(struct tmio_mmc_host *host, unsigned int new_clock) { struct sh_mobile_sdhi *priv = host_to_priv(host); - unsigned int freq, best_freq, diff_min, diff; + unsigned int freq, diff, best_freq = 0, diff_min = ~0; int i; - diff_min = ~0; - best_freq = 0; - /* * We want the bus clock to be as close as possible to, but no * greater than, new_clock. As we can divide by 1 << i for