From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753528AbcDCLSH (ORCPT ); Sun, 3 Apr 2016 07:18:07 -0400 Received: from hqemgate15.nvidia.com ([216.228.121.64]:19610 "EHLO hqemgate15.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752618AbcDCLSF (ORCPT ); Sun, 3 Apr 2016 07:18:05 -0400 X-PGP-Universal: processed; by hqnvupgp08.nvidia.com on Sun, 03 Apr 2016 04:16:40 -0700 Message-ID: <5700F966.4000802@nvidia.com> Date: Sun, 3 Apr 2016 16:37:18 +0530 From: Laxman Dewangan User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: Mark Brown CC: kbuild test robot , , , , Lee Jones Subject: Re: [PATCH] regulator: pwm: Try to avoid voltage error in duty cycle calculation References: <201604011425.40GkbuYp%fengguang.wu@intel.com> <56FE15F3.3060805@nvidia.com> <20160402165311.GF2350@sirena.org.uk> In-Reply-To: <20160402165311.GF2350@sirena.org.uk> X-Originating-IP: [10.19.65.30] X-ClientProxiedBy: DRUKMAIL102.nvidia.com (10.25.59.20) To bgmail102.nvidia.com (10.25.59.11) Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Saturday 02 April 2016 10:23 PM, Mark Brown wrote: > * PGP Signed by an unknown key > > On Fri, Apr 01, 2016 at 12:02:19PM +0530, Laxman Dewangan wrote: >> On Friday 01 April 2016 11:55 AM, kbuild test robot wrote: >>>>> pwm-regulator.c:(.text+0x1728d4): undefined reference to `__umoddi3' >>>>> pwm-regulator.c:(.text+0x1728fd): undefined reference to `__udivdi3' >> Seems build error is coming from logic >> u64 req_period >> unsigned int diff; >> unsigned int period >> unsigned int req_diff >> req_period = req_diff * period; >> if (req_period % diff == 0) >> used u64 to avoid overflow in multiplication. > Yes, you're doing a 64 bit divide so that's kind of expected... > Is there any way to resolve this issue? Otherwise, need to divide by 100 first for the req_diff to get 10x of mV (instead of uV) and then do calculation with unsigned int only. That way I can restrict the number to unsigned int.