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 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 74BC2CAC599 for ; Tue, 16 Sep 2025 08:07:20 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0B3E710E30B; Tue, 16 Sep 2025 08:07:20 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="Z3G7eih/"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.19]) by gabe.freedesktop.org (Postfix) with ESMTPS id 53C1C10E30B; Tue, 16 Sep 2025 08:07:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1758010039; x=1789546039; h=from:to:cc:subject:in-reply-to:references:date: message-id:mime-version; bh=Y8J/F7oKrl3zjCh+oB+s8eg1WIz+389ZWBoMt2NLWbc=; b=Z3G7eih/d2i9H3QRfFhkzFd3y3Hh1iL5yCxtGo9nR96nMQt7ay+FIaTn NJ8iM+Vvdk8yRgA3CJNz3s7GIhApOG+0/DymK0cwKxNFu80PR4INtJX5R fdeq4DuSKxg1FXq9eSPPrEsfy49B9cY4EB2IjA0JiNY/k2Q4jNux7iaAy 248mPwaSvYCN9vMmw9bOvFdZA2TJNb1uE3gPe4zmUxvUTU9WBzZbARhEG rcDkXL4pnqb39dgGrRTS8Kse6e98EFFCFC/XZkd4zyQXmG7y2g9o6Hwlq h8Nup+LbBKgdcWxN6hgea3DoUun37K0LyXsvFb0y9o+8GFhJo3HkUSlTK A==; X-CSE-ConnectionGUID: Il/uEFUgThS2AFGFkd1Yzw== X-CSE-MsgGUID: 8kdQHb0jSoaRSug94bOGtA== X-IronPort-AV: E=McAfee;i="6800,10657,11554"; a="59326755" X-IronPort-AV: E=Sophos;i="6.18,268,1751266800"; d="scan'208";a="59326755" Received: from fmviesa003.fm.intel.com ([10.60.135.143]) by fmvoesa113.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Sep 2025 01:07:17 -0700 X-CSE-ConnectionGUID: JyflTA6ySzGmtCMp5c36wg== X-CSE-MsgGUID: bcQf46JZTxGbHCsvp5kmDQ== X-ExtLoop1: 1 Received: from slindbla-desk.ger.corp.intel.com (HELO localhost) ([10.245.246.81]) by fmviesa003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Sep 2025 01:07:10 -0700 From: Jani Nikula To: Andi Shyti , Ilpo =?utf-8?Q?J=C3=A4rvinen?= Cc: linux-pci@vger.kernel.org, Bjorn Helgaas , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Christian =?utf-8?Q?K=C3=B6nig?= , =?utf-8?Q?Micha=C5=82?= Winiarski , Alex Deucher , amd-gfx@lists.freedesktop.org, David Airlie , dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org, Joonas Lahtinen , Lucas De Marchi , Rodrigo Vivi , Simona Vetter , Tvrtko Ursulin , ?UTF-8?q?Thomas=20Hellstr=C3=B6m?= , "Michael J . Ruhl" , linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org Subject: Re: [PATCH v2 05/11] PCI: Add pci_rebar_size_supported() helper In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo References: <20250915091358.9203-1-ilpo.jarvinen@linux.intel.com> <20250915091358.9203-6-ilpo.jarvinen@linux.intel.com> Date: Tue, 16 Sep 2025 11:07:07 +0300 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On Mon, 15 Sep 2025, Andi Shyti wrote: > Hi Ilpo, > >> +/** >> + * pci_rebar_size_supported - check if size is supported for BAR >> + * @pdev: PCI device >> + * @bar: BAR to check >> + * @size: size as defined in the PCIe spec (0=1MB, 31=128TB) >> + * >> + * Return: %true if @bar is resizable and @size is a supported, otherwise >> + * %false. >> + */ >> +bool pci_rebar_size_supported(struct pci_dev *pdev, int bar, int size) >> +{ >> + u64 sizes = pci_rebar_get_possible_sizes(pdev, bar); >> + >> + return BIT(size) & sizes; > > I would return here "!!(BIT(size) & sizes)", but it doesn't > really matter. If the patch had that, I'd ask to drop the superfluous negations and parens... BR, Jani. > > Reviewed-by: Andi Shyti > > Andi -- Jani Nikula, Intel