Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp21310pxb; Wed, 1 Sep 2021 20:36:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJykRjyP9BFlDo6/6gwaGkEbtwsh4wvYyXS7AiZafxKn9Z/v1EUroR5oESo693nv39+LQ2FZ X-Received: by 2002:a05:6e02:f91:: with SMTP id v17mr752682ilo.0.1630553805700; Wed, 01 Sep 2021 20:36:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630553805; cv=none; d=google.com; s=arc-20160816; b=ghUCr04R2Vdnzx2m3DDUY63frtHq8jivL4UnQE1lgU1zTEy7cGmb0rZuxjzqqy4gh5 VzeTaRdXnYz8kAzxf3jwwMP3y1POqcawtolk8YIJ+KVu7a40cs82Xp04gajI1mZdUTZ0 MzB4OPFrH9cMLRxzXKAIuMBUSt7OFKT+9y0TG4sQkO2gLfKvJNe0lCsZMUzvuwny9pwG bOk7Ycj8hW6Yu2+dSzlwTscMMoKur15ynjmwuRnICtzrRpHhipL7eKneruGqVVHWZX0N 8gwW1Rsg9Kocq7bMeVX4WD3pjn6yDLMOF+8MJDsC1hykrr8QnyOXMt+7pxs3+ZaYX6tO RNAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=X0Qm4upf5CCJvixKNdKf+n5KDOXR1WMPmmOqEVYiz+0=; b=rQcUhvJ48MB5cLYBvngLUy6aOtYv743dX0yM2WhJqvFMMcpIQ5lpLyJKjc7aoQY4Rx 0ykMYraSOdCuc6J40ncjJAaxY7vRlVjz17O8vp4glwlx8T3GWYuDuZ73Q20HGKNtNJ2J 4gDTZiFuquHn+09UC/1LTFty24S3s/og2kTcHxOOWofpXn29mqFzoZaYKvzxL5L9gQEo v3EkAeifWZupGlr0LMeQMAzWq10HeSWXHwQAcgDwxgPLKKK6I051Wi/SR6MpFPYWayQI Uxh38WrT+j2X8/AaNU1mphvBxdtDDU23FD/Fb+Hj6aL/iPuoHZQbRlUnbLot/AidlP6t xKjA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w67si530585jaa.124.2021.09.01.20.36.30; Wed, 01 Sep 2021 20:36:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232877AbhIBDOR (ORCPT + 99 others); Wed, 1 Sep 2021 23:14:17 -0400 Received: from rosenzweig.io ([138.197.143.207]:45444 "EHLO rosenzweig.io" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233143AbhIBDON (ORCPT ); Wed, 1 Sep 2021 23:14:13 -0400 Date: Wed, 1 Sep 2021 21:35:40 -0400 From: Alyssa Rosenzweig To: Laurent Pinchart Cc: dri-devel@lists.freedesktop.org, Neil Armstrong , David Airlie , Daniel Vetter , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Rob Clark , Sean Paul , Sandy Huang , Heiko =?iso-8859-1?Q?St=FCbner?= , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Abhinav Kumar , Dmitry Baryshkov , Lee Jones , Stephen Boyd , Kalyan Thota , Ville =?iso-8859-1?Q?Syrj=E4l=E4?= , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/5] drm: Add drm_fixed_16_16 helper Message-ID: References: <20210901175431.14060-1-alyssa@rosenzweig.io> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > Missing documentation :-) Ack. > > +static inline int drm_fixed_16_16(s32 mult, s32 div) > > You should return a s32. Ack. > The function name isn't very explicit, and departs from the naming > scheme of other functions in the same file. As fixed-point numbers are > stored in a s64 for the drm_fixp_* helpers, we shouldn't rese the > drm_fixp_ prefix, maybe drm_fixp_s16_16_ would be a good prefix. The > function should probably be named drm_fixp_s16_16 from_fraction() then, > but then the same logic should possibly be replicated to ensure optimal > precision. I wonder if it wouldn't be best to simply use > drm_fixp_from_fraction() and shift the result right by 16 bits. Sure, I'm not attached to the naming ... will wait to hear what colours everyone else wants the bikehed painted. As for the implementation, I just went with what was used across multiple drivers already (no chance of regressions that way) but could reuse other helpers if it's better..? If the behaviour changes this goes from a trivial cleanup to a much more invasive changeset. I don't own half of the hardware here.