Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp2027427lqo; Mon, 13 May 2024 06:05:09 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXR1vzMOk/cHhsa8C5aVsoRQW2WHTny+ozf8IQuZKTvwvnVf5u2XAd3THGHdUFziyL8imGl0GKeki9hnBczmlQJ42boDWGVUKgnEnQQjA== X-Google-Smtp-Source: AGHT+IEQvVQk34oqTZvHGRXGyNoNvOsRIDvdL6aLy7cYSjHJPTjbMfYNNi/xxUGShbfmUjW90vtD X-Received: by 2002:a17:90a:c7d1:b0:2b6:2067:dde0 with SMTP id 98e67ed59e1d1-2b6cc342832mr8054018a91.5.1715605509555; Mon, 13 May 2024 06:05:09 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715605509; cv=pass; d=google.com; s=arc-20160816; b=yr6ysgwkPSOWCukb9wjyNfSui4SNr2YZoa1yW9jUwY0IyiU0itTFjYssISUSghQZKY 7wU+pBvEtw2aXTKKVSIcx79G2lqatOnDWhKzv64eplzHwmzQzWIUVC8R7I6Q1s06UQcw qHgc8fQTbKfXID5Ozmqvs1vRioOSzqFshcLPBEYB2tn6pzjAims3v3l+AvPs9B4VwJ40 5p4x4Mmwswt+E54/MyI3bkdoTte9LeUSzinwqVARPyrQoHJWeDgtLy809ko8g2AooGce L01upxU8Yx4NXYNK1fahaG7iq7RnAHNUWx2yjqvc8YLNYrBDH7GBupY+tAOEhcjV3e2U t2Eg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=ev5eSmS3thwVNeY1xnA3bMkVddacaqfahgCUWZ2n/54=; fh=KhZyWZsaxQE5Sy8uLko6qIgPJ+YDpsu+LnKeYbWyqVg=; b=vpde9kFovtCsbV+UzxFUhqD0XG540h/1zc4uzUWsG/yMma22C8J+BuDvh0IKwBq/Uy rzUHmgDXKslovKSM5dkpT9qnxX34NSs2mwhD5Xseb7u0E/aiA+mgfkk2iikHer+yS2nE Thoi4Rjpk3CZypevH+s/7tepu06Y+45+QPHLB1tEV+yhuBkv/F2Bu//mh7PAgUHYGI+N wo5IBCp/L1dEM3LTsb4xc4eV8UiYIZbowXL4Hf167H9PpiRYuJ2p/dUnPH4Lx06usuFa jW+COGM/nt0/rmdQR8fXU4SWWdmNqJfJIianhsSU77PGZU/nvaDbyrjpZbXHxYz/40hd 9Quw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=A6ajshkX; arc=pass (i=1 spf=pass spfdomain=ti.com dkim=pass dkdomain=ti.com dmarc=pass fromdomain=ti.com); spf=pass (google.com: domain of linux-kernel+bounces-177603-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-177603-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id 98e67ed59e1d1-2b628869587si11367559a91.1.2024.05.13.06.05.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 May 2024 06:05:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-177603-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=A6ajshkX; arc=pass (i=1 spf=pass spfdomain=ti.com dkim=pass dkdomain=ti.com dmarc=pass fromdomain=ti.com); spf=pass (google.com: domain of linux-kernel+bounces-177603-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-177603-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 25127B2230B for ; Mon, 13 May 2024 13:05:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3B23C1509BF; Mon, 13 May 2024 13:04:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="A6ajshkX" Received: from fllv0016.ext.ti.com (fllv0016.ext.ti.com [198.47.19.142]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CE40573502; Mon, 13 May 2024 13:04:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.47.19.142 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715605492; cv=none; b=Q0vlPuBGCK31OGIlxrsPLmful05OqcYgGFrt7Lkdo3VIgpr5ZOqHdKwNpyakqbQFiRt20B7Pq48II2U27pBgr0nJc2nK8nE5Y5fIBvlV3xHzUB/R5d+SGU3YmpnimAsJHJkcg2pYtphlrjL/5XUtOdrylLRbjBPhMzFb6VGFUDQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715605492; c=relaxed/simple; bh=7UCTCALAcwJZy/zFSv4mMa5RQSyTJwukKVfzBqwvx10=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=BfAGmSqvDMzou9C6PPP0x0xBajIS+SVL303BCHjxETvdgOs9Y+PlvK3mWQ3/duSTovi7PrIv0A0bfmOGS3nomz5xmQ+uD4iQbVH2Xbvx5HuPP202AyFILQNJDuQ6ItsnwrkQQ8D8BJF7JJjqLWbaHmZmzZHyxNrykRfi5L9KzNo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com; spf=pass smtp.mailfrom=ti.com; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b=A6ajshkX; arc=none smtp.client-ip=198.47.19.142 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ti.com Received: from fllv0035.itg.ti.com ([10.64.41.0]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 44DD4SOU117576; Mon, 13 May 2024 08:04:28 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1715605468; bh=ev5eSmS3thwVNeY1xnA3bMkVddacaqfahgCUWZ2n/54=; h=Date:Subject:To:CC:References:From:In-Reply-To; b=A6ajshkXex93BSA4K+rTjGlUXN0Qz4i7jsHMGlobqLBPTGOKa6SsZNPI/O/cvwrDJ xwy3fMkUbZ+cdlksV1YqmU+o/+1eXGoQSqnK9RCYTm/oBdBlNYH5DNOTNdRqEagbcq EeF2Ss9vU5dWYQaS9n9L4T0Ljz7dAjqKw8yby9Uc= Received: from DLEE103.ent.ti.com (dlee103.ent.ti.com [157.170.170.33]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 44DD4S44061240 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 13 May 2024 08:04:28 -0500 Received: from DLEE102.ent.ti.com (157.170.170.32) by DLEE103.ent.ti.com (157.170.170.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Mon, 13 May 2024 08:04:28 -0500 Received: from lelvsmtp6.itg.ti.com (10.180.75.249) by DLEE102.ent.ti.com (157.170.170.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Mon, 13 May 2024 08:04:27 -0500 Received: from [172.24.227.193] (devarsht.dhcp.ti.com [172.24.227.193] (may be forged)) by lelvsmtp6.itg.ti.com (8.15.2/8.15.2) with ESMTP id 44DD4Kf9109966; Mon, 13 May 2024 08:04:20 -0500 Message-ID: Date: Mon, 13 May 2024 18:34:19 +0530 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [PATCH v7 6/8] math.h Add macros to round to closest specified power of 2 Content-Language: en-US To: Andy Shevchenko CC: Jani Nikula , , , , , , , , , , , , , , , , , , , , , , , , , References: <20240509183952.4064331-1-devarsht@ti.com> <87fruphf55.fsf@intel.com> <5ebcf480-81c6-4c2d-96e8-727d44f21ca9@ti.com> <6557050e-6b18-2628-cbab-1a811b2190ba@ti.com> From: Devarsh Thakkar In-Reply-To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Hi Andy, On 13/05/24 17:55, Andy Shevchenko wrote: > On Mon, May 13, 2024 at 04:55:58PM +0530, Devarsh Thakkar wrote: >> On 13/05/24 14:29, Andy Shevchenko wrote: >>> On Sat, May 11, 2024 at 11:11:14PM +0530, Devarsh Thakkar wrote: >>>> On 10/05/24 20:45, Jani Nikula wrote: > > [...] > - align naming (with the existing round*() macros) I think round_closest_up/round_closest_down align already and inspired by the existing naming convention used for round*() and DIV_ROUND_CLOSEST() macros in math.h as explained below (copied from my previous reply [1]) "Coming back to naming, this is as per existing convention used for naming round_up, round_down (notice the `_` being used for macros working with pow of 2) and DIV_ROUND_CLOSEST (notice the work `closest` used to specify the answer to be nearest to specified value)" But do let me know if you have any other suggestions for naming? > - add examples into commit message of the math.h patch Agreed > - add test cases (you need to create lib/math_kunit.c for that) Agreed. > - elaborate in the commit message of the IPU3 change what you posted above > (some kind of a summary) Agreed. [1]: https://lore.kernel.org/all/ZkIG0-01pz632l4R@smile.fi.intel.com/ Regards Devarsh