From patchwork Wed Nov 4 04:09:58 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Pitre X-Patchwork-Id: 7548161 Return-Path: X-Original-To: patchwork-linux-omap@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 2D44B9F327 for ; Wed, 4 Nov 2015 04:10:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5A225205FA for ; Wed, 4 Nov 2015 04:10:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6B77A205E9 for ; Wed, 4 Nov 2015 04:10:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755182AbbKDEKI (ORCPT ); Tue, 3 Nov 2015 23:10:08 -0500 Received: from mail-qk0-f176.google.com ([209.85.220.176]:33554 "EHLO mail-qk0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755169AbbKDEKB (ORCPT ); Tue, 3 Nov 2015 23:10:01 -0500 Received: by qkas77 with SMTP id s77so12227136qka.0 for ; Tue, 03 Nov 2015 20:10:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro_org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:user-agent:mime-version :content-type; bh=bNUwao64NJBtiDROlQTfZgKmB5+4cJcqAuQrEQCvwvU=; b=iOPGgoUKUZ/W9FW9UegBlm76krJGX4+aeYwXJ5NTbKC+RLDCJ+T464cB2vYO0sSjzt wFsMW/NXjTNB5RWhXq57vgCjXg/30Lqw8WgOf0SZj8D6J9Y9wJb1xTIq2rbPMbJRvYSD nO5IX4LvVCKcGs1siYK29qweiD/ynGhByi23QsMATSO9pi+JPnHgJXR/JgYI62VgdMyh Towims41WiWlpxLmpIqW+X2onxTImEreVdBJ8hAuv/fiPT8tcApV05Y6S2PjC10J96t+ Q4SBSNTzghjH9CSaadhs29olWeZadufVKDJJDqTg75wZaJmEskXktrph652JWWi9Qk/9 xyVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:user-agent :mime-version:content-type; bh=bNUwao64NJBtiDROlQTfZgKmB5+4cJcqAuQrEQCvwvU=; b=YZa6wA8LwDs4a7c2PCtfJGEEwryjeY7T+t3hucUVXs88ogLcHoUf6rSSjPwsvhhX+i w1OB10vqgf+ynbHIdGcEU/Sya3EuCu9A6TZSydccQDmlPg2XXINDaSUpsV9ynnBYzrZ0 ESRvi7/BfRKntFfDrt4AHkQjA75R0cwZ+vN+KIIXjJXfus6qD5TUUhxaVwaebg1RT/sG 02O+P8GaiX6fEpT7C53k70siVPWBTfe2Dbb5rqtzTFtKfogdvU7c4ozelmJBLtI5vMkD Vb8jOKi9Z0L5ksTdNUBZerHPKk4AzSsbrZiq1vCEneenZg79acuxRA8YTSzfg9qxC0qL 26/A== X-Gm-Message-State: ALoCoQm89NfzZ3ig8pvO7dOSpvCmwbyi0RgRe3G7K1zRk8VfaDxVCyzV4tnbxHfTFtAz7Rs6hZnl X-Received: by 10.55.79.207 with SMTP id d198mr16474225qkb.49.1446610200341; Tue, 03 Nov 2015 20:10:00 -0800 (PST) Received: from xanadu.home (modemcable065.157-23-96.mc.videotron.ca. [96.23.157.65]) by smtp.gmail.com with ESMTPSA id 139sm10844837qht.32.2015.11.03.20.09.59 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Nov 2015 20:09:59 -0800 (PST) Date: Tue, 3 Nov 2015 23:09:58 -0500 (EST) From: Nicolas Pitre To: Tero Kristo , Michael Turquette cc: linux-omap@vger.kernel.org, linux-clk@vger.kernel.org Subject: [PATCH] ti/clkt_dpll: fix wrong do_div() usage Message-ID: User-Agent: Alpine 2.20 (LFD 67 2015-01-07) MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=unavailable 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 do_div() is meant to be used with an unsigned dividend. Signed-off-by: Nicolas Pitre --- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/clk/ti/clkt_dpll.c b/drivers/clk/ti/clkt_dpll.c index 9023ca9caf..b5cc6f66ae 100644 --- a/drivers/clk/ti/clkt_dpll.c +++ b/drivers/clk/ti/clkt_dpll.c @@ -240,7 +240,7 @@ u8 omap2_init_dpll_parent(struct clk_hw *hw) */ unsigned long omap2_get_dpll_rate(struct clk_hw_omap *clk) { - long long dpll_clk; + u64 dpll_clk; u32 dpll_mult, dpll_div, v; struct dpll_data *dd; @@ -262,7 +262,7 @@ unsigned long omap2_get_dpll_rate(struct clk_hw_omap *clk) dpll_div = v & dd->div1_mask; dpll_div >>= __ffs(dd->div1_mask); - dpll_clk = (long long)clk_get_rate(dd->clk_ref) * dpll_mult; + dpll_clk = (u64)clk_get_rate(dd->clk_ref) * dpll_mult; do_div(dpll_clk, dpll_div + 1); return dpll_clk;