From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B5520C433E0 for ; Thu, 7 Jan 2021 23:54:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 81C2123403 for ; Thu, 7 Jan 2021 23:54:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728632AbhAGXyd (ORCPT ); Thu, 7 Jan 2021 18:54:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60340 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727858AbhAGXyd (ORCPT ); Thu, 7 Jan 2021 18:54:33 -0500 X-Greylist: delayed 698 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Thu, 07 Jan 2021 15:53:52 PST Received: from spam.moreofthesa.me.uk (moreofthesa.me.uk [IPv6:2001:8b0:897:1651::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9862BC0612F4 for ; Thu, 7 Jan 2021 15:53:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=moreofthesa.me.uk; s=201708; h=Content-Type:MIME-Version:References: In-Reply-To:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=+a3oh3wC3I221Ztlf7urGUM58XE28rfJHOe9CwssR00=; b=EUnmdP2WZgqI/FebH6B5R7oFN /r7sb4BSqhIRgyXLxBMsn42kArDpHJlLyp9J4cA7B6dZzoBVV/6STdnypuA67ZKfc/4uWPEcOZWHg KWgHFfotQ2YG+L1TcIfOHFcPK2nGLsmXTnbBBkNl/r6PZcloIXKh8or9qnV1ozYfyA3VaJmzjfyYZ BTkx44vTpXvb4aVdQoM3J1/HOaXSY63t2VGm8jxoldSxu0QFsLeUOSO3rtdqhIvYDbyBn59zwu+Xd MNIA/CEBq1TkpfTjL7CsJlXoZzd/Jt3rAYPeGyZY48x4wgswNiVUlSnXqj2iO2HhnKK8o9hnSPOjK KItTGW89A==; Received: from [2001:8b0:897:1650::2] by spam.moreofthesa.me.uk with esmtp (Exim 4.92) (envelope-from ) id 1kxeun-0008SP-AH; Thu, 07 Jan 2021 23:42:01 +0000 Date: Thu, 07 Jan 2021 23:31:36 +0000 From: Darren Salt To: Bjorn Helgaas Cc: , , , , , Subject: Re: [PATCH 2/4] PCI: Add pci_rebar_bytes_to_size() Message-ID: <58F0BFBCD0%devspam@moreofthesa.me.uk> In-Reply-To: <20210107211757.GA1391831@bjorn-Precision-5520> References: <20210107211757.GA1391831@bjorn-Precision-5520> Mail-Followup-To: , , , , , , , User-Agent: Messenger-Pro/2.73.6.4250 (Qt/5.11.3) (Linux-x86_64) X-No-Archive: no X-Orwell-Date: Thu, 13187 Dec 1984 23:31:36 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SA-Exim-Connect-IP: 2001:8b0:897:1650::2 X-SA-Exim-Mail-From: devspam@moreofthesa.me.uk X-SA-Exim-Scanned: No (on spam.moreofthesa.me.uk); SAEximRunCond expanded to false Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org I demand that Bjorn Helgaas may or may not have written... >> +static inline int pci_rebar_bytes_to_size(u64 bytes) >> +{ >> + bytes = roundup_pow_of_two(bytes); >> + return max(ilog2(bytes), 20) - 20; > This isn't returning a "size", is it? It looks like it's returning the > log2 of the number of MB the BAR will be, i.e., the encoding used by the > Resizable BAR Control register "BAR Size" field. Needs a brief comment to > that effect and/or a different function name. Given that, it seems to me that pci_rebar_size_to_bytes should be similarly commented and/or renamed.