From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.5 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3CEF5C10F13 for ; Tue, 16 Apr 2019 11:49:38 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0F8B020872 for ; Tue, 16 Apr 2019 11:49:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="b7o1ywxZ"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="x7nxRR35" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0F8B020872 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linuxfoundation.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=I9wCHLFpmNHv+uHoS8CZ8RnfdMf56UKIZsf6beRtz9o=; b=b7o1ywxZs7/LHS ppBP7UXQGbbBV5GSR8ulVmquUZT1jTDrC3DJL3C+VUmutgLFaUwe6DYjEJZ8G2N5W4+25qAa3Mb6I SJx5uHDjmh/0TzI1THhuN5jhgYYq2ok6cGtkBiOxJmylfBeQjV/gUeHaoPlo1tmS3cEWqCi1jp5jM rV5P5YHxd4SiYG0twnFGzVDu0NYnPeunt38f5+WoCuWMXrj6eIERyE/qPbOUYJXSp9ES7m5JdKiwk 7Gy332ZxuWitRlo7jIhB3mrLyh3UEEJzKb5hIGBZ6vxPF/65QbTZcE9yr1onhwHHj84vM8BsaGRb4 wxpeESJGOZx/rR7ipFfA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hGMah-0001a3-V4; Tue, 16 Apr 2019 11:49:31 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hGMad-0001ZM-Mi; Tue, 16 Apr 2019 11:49:30 +0000 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A430820821; Tue, 16 Apr 2019 11:49:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555415367; bh=tBug0k26lfhe+YjlBGweMCvHQ8XmI6Cu/5UrIpNkXig=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=x7nxRR35dBzN0pfxwUuOArgYIWB9SXxCVnmODQNeqCBApKsiFLlc73umxzrFVAORU 9mie9ZKaCzOW2ham1QO+Z/3QprQTweyV8P6Ro45Ex4yd6NKlr5/mOUaU037u3slM91 MTIrJBw9zSniqD9C8KI8AvLd0OTqYsys3DPuLGbM= Date: Tue, 16 Apr 2019 13:44:27 +0200 From: Greg KH To: Madhumitha Prabakaran Subject: Re: [PATCH] Staging: mt7621-mmc: Use DIV_ROUND_UP in function msdc_set_mclk Message-ID: <20190416114427.GA17623@kroah.com> References: <20190403151608.27326-1-madhumithabiw@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20190403151608.27326-1-madhumithabiw@gmail.com> User-Agent: Mutt/1.11.4 (2019-03-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190416_044927_792301_227BCE73 X-CRM114-Status: GOOD ( 14.76 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: matthias.bgg@gmail.com, devel@driverdev.osuosl.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Apr 03, 2019 at 10:16:08AM -0500, Madhumitha Prabakaran wrote: > Use DIV_ROUND_UP to make code simple and more understandable. > > Signed-off-by: Madhumitha Prabakaran > --- > drivers/staging/mt7621-mmc/sd.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/staging/mt7621-mmc/sd.c b/drivers/staging/mt7621-mmc/sd.c > index 4b26ec896a96..b12ed2c988fd 100644 > --- a/drivers/staging/mt7621-mmc/sd.c > +++ b/drivers/staging/mt7621-mmc/sd.c > @@ -240,7 +240,7 @@ static void msdc_set_mclk(struct msdc_host *host, int ddr, unsigned int hz) > div = 1; /* mean div = 1/4 */ > sclk = hclk >> 2; /* sclk = clk / 4 */ > } else { > - div = (hclk + ((hz << 2) - 1)) / (hz << 2); > + div = DIV_ROUND_UP(hclk, (hz << 2)); > sclk = (hclk >> 2) / div; > } > } else if (hz >= hclk) { /* bug fix */ > @@ -253,7 +253,7 @@ static void msdc_set_mclk(struct msdc_host *host, int ddr, unsigned int hz) > div = 0; /* mean div = 1/2 */ > sclk = hclk >> 1; /* sclk = clk / 2 */ > } else { > - div = (hclk + ((hz << 2) - 1)) / (hz << 2); > + div = DIV_ROUND_UP(hclk, (hz << 2)); > sclk = (hclk >> 2) / div; > } > } This file is no longer in the kernel tree :( _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel