Received: by 2002:a05:7412:f589:b0:e2:908c:2ebd with SMTP id eh9csp147168rdb; Tue, 31 Oct 2023 03:38:48 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGiHO62sLiBiHLtjY2n8G5L3TeJ55/7ghYVbdtqrC5FB9aRlPaOUxh0rEg4bRhxOFW0fFIv X-Received: by 2002:a05:6a20:12c5:b0:15e:4084:6480 with SMTP id v5-20020a056a2012c500b0015e40846480mr2894422pzg.27.1698748728613; Tue, 31 Oct 2023 03:38:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698748728; cv=none; d=google.com; s=arc-20160816; b=qkxmRtnNT0dho0/jkM2/UB92/jlVvnq2QuDtteU3fi+98FkDKGJ9tsUxHPGfdXJt9P cOsWv1H9iX6TyABjHujauoxrkPzr8rJ3IIlrequxpOCNJCSkWf68A/P7pMy9iS5ufdv3 lSvA2eUr4Cx9GvYrhflKJbXCAIyzEAE4lrZS32RGNTbqIsCz8Q2qrqBC4Yz8tQYI1u9J /Pv5DI/SjgdNYq1EEyfXsY2zVSMV94/jPLFQFkqz66Ew17G5wJHPuKxOIgZieldybxh0 cqvOpwgMMF65Smvy2vr1yIKoDeFzy3V48QpW2m5zZt4AYsGI6VKkZ2Az211eCbaXdcFN f2Cg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=46SlJpQ6xc6/In9TVpGCi0PxxroA+rb9us2BSH2MKBk=; fh=/WrmyaLDeUIGZLM2cb/L0JladnCq1V446GKdpCoBWLQ=; b=Tgek4DjbE9vsab/ahM2YgWzuGwf9HfDRjrw+e38Uq1OcogZm0h4EJuSLPJLP0LviyR 16HMApyE7Ts90dpqMAT6kWgjCvT/f3NnaF9lln85/ieBkyRpZgIdI7TgCdYo/4KeSY8q pBIU5FDjEMr3zvodr5B9TIKAgjDr53a+rIr3uIctMeSWMaj/Emycr3IOdUVYlzJNjOYj 6Fw/sQg7MgZFnz8iIN3QNxq4Ga0HFsc0K8qTcfuVbtYVovF9VzCW55eim8gs6erXj549 DUeMbc5JIzhbOwmwNCO9mUF07dIZjAiVcivXY4cQC4n8aHimg5vUoPbKFfkhRzrehV4c ++Zg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=CLSwr6Et; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id x29-20020aa7957d000000b006be3c302801si798392pfq.397.2023.10.31.03.38.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Oct 2023 03:38:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=CLSwr6Et; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id AB576802642C; Tue, 31 Oct 2023 03:38:45 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343973AbjJaKig (ORCPT + 99 others); Tue, 31 Oct 2023 06:38:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33350 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343946AbjJaKie (ORCPT ); Tue, 31 Oct 2023 06:38:34 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AB35D83; Tue, 31 Oct 2023 03:38:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1698748712; x=1730284712; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=3YWDf1NX0vV0KjfCqqHzU9+x4C2KVyU+FzOd4nHXStM=; b=CLSwr6EtM5la8O5+sd1oBF5Rx6g8C77mT0KrasNGgW4ZWIvHHLm99VKW J4DQuqjOxDj5cXqYLvwUv5r7p2Sy1gkwW4HybUrfWjbZBsIuB/Ajw3cys Pvut640gxM1GtPcGshcJLgThCIsUNyLyc5Ia/XHvzbbcf5DW6d5hIto7c N4hv4JTiFX5kjn5Us4b9v4HoHF6HhA1jUX4H1NdBSAaafF2dWbHrvs/Dr XpWxggKo4poquzKg3625BtPBsE2mdXLTwU7kJUI9enfDXKnigiptXD7U7 1TeoQ1aEtvD88GcDodMHpSc4N1SISa5YonEojvwHW9ta6fQtAOz7mpQgK A==; X-IronPort-AV: E=McAfee;i="6600,9927,10879"; a="452535567" X-IronPort-AV: E=Sophos;i="6.03,265,1694761200"; d="scan'208";a="452535567" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Oct 2023 03:38:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10879"; a="904306946" X-IronPort-AV: E=Sophos;i="6.03,265,1694761200"; d="scan'208";a="904306946" Received: from smile.fi.intel.com ([10.237.72.54]) by fmsmga001.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Oct 2023 03:38:28 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.97-RC3) (envelope-from ) id 1qxm8f-0000000A7Cp-0bVz; Tue, 31 Oct 2023 12:38:25 +0200 Date: Tue, 31 Oct 2023 12:38:24 +0200 From: Andy Shevchenko To: Matti Vaittinen Cc: Jonathan Cameron , Subhajit Ghosh , Lars-Peter Clausen , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Paul Gazzillo , Matt Ranostay , Stefan Windfeldt-Prytz , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 2/2] iio: light: Add support for APDS9306 Light Sensor Message-ID: References: <20231027074545.6055-1-subhajit.ghosh@tweaklogic.com> <20231027074545.6055-3-subhajit.ghosh@tweaklogic.com> <20231028162025.4259f1cc@jic23-huawei> <84d7c283-e8e5-4c98-835c-fe3f6ff94f4b@gmail.com> <6a697c62-6a7c-4b31-bc8e-10f40db0363d@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Tue, 31 Oct 2023 03:38:45 -0700 (PDT) On Tue, Oct 31, 2023 at 09:11:37AM +0200, Matti Vaittinen wrote: > On 10/30/23 12:21, Matti Vaittinen wrote: > > On 10/29/23 17:51, Matti Vaittinen wrote: > > > On 10/28/23 18:20, Jonathan Cameron wrote: ... > tmp = gts->max_scale; > > rem = do_div(tmp, total_gain); > if (total_gain > 1 && rem >= total_gain / 2) > tmp += 1ULL; ...which is NIH DIV_ROUND_CLOSEST_ULL() -- With Best Regards, Andy Shevchenko