linux-doc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: "Andi Shyti" <andi.shyti@kernel.org>,
	"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
Cc: linux-pci@vger.kernel.org, "Bjorn Helgaas" <bhelgaas@google.com>,
	"Krzysztof Wilczyński" <kw@linux.com>,
	"Christian König" <christian.koenig@amd.com>,
	"Michał Winiarski" <michal.winiarski@intel.com>,
	"Alex Deucher" <alexander.deucher@amd.com>,
	amd-gfx@lists.freedesktop.org, "David Airlie" <airlied@gmail.com>,
	dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org,
	intel-xe@lists.freedesktop.org,
	"Joonas Lahtinen" <joonas.lahtinen@linux.intel.com>,
	"Lucas De Marchi" <lucas.demarchi@intel.com>,
	"Rodrigo Vivi" <rodrigo.vivi@intel.com>,
	"Simona Vetter" <simona@ffwll.ch>,
	"Tvrtko Ursulin" <tursulin@ursulin.net>,
	?UTF-8?q?Thomas=20Hellstr=C3=B6m?=
	<thomas.hellstrom@linux.intel.com>,
	"Michael J . Ruhl" <mjruhl@habana.ai>,
	linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org
Subject: Re: [PATCH v2 05/11] PCI: Add pci_rebar_size_supported() helper
Date: Tue, 16 Sep 2025 11:07:07 +0300	[thread overview]
Message-ID: <eb0bbfbcb963174bbb625268b0e5385deb8a2c62@intel.com> (raw)
In-Reply-To: <cduh4ave3lbdgd2kutfhgf3obf3wuskgxf6rrhggsiksw7wrwa@lqly5npj5g3r>

On Mon, 15 Sep 2025, Andi Shyti <andi.shyti@kernel.org> 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.shyti@linux.intel.com>
>
> Andi

-- 
Jani Nikula, Intel

  reply	other threads:[~2025-09-16  8:07 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-15  9:13 [PATCH v2 00/11] PCI: Resizable BAR improvements Ilpo Järvinen
2025-09-15  9:13 ` [PATCH v2 01/11] PCI: Move Resizable BAR code into rebar.c Ilpo Järvinen
2025-09-15  9:13 ` [PATCH v2 02/11] PCI: Cleanup pci_rebar_bytes_to_size() and move " Ilpo Järvinen
2025-09-15  9:13 ` [PATCH v2 03/11] PCI: Move pci_rebar_size_to_bytes() and export it Ilpo Järvinen
2025-09-15  9:13 ` [PATCH v2 04/11] PCI: Improve Resizable BAR functions kernel doc Ilpo Järvinen
2025-09-15  9:13 ` [PATCH v2 05/11] PCI: Add pci_rebar_size_supported() helper Ilpo Järvinen
2025-09-15 17:28   ` Andi Shyti
2025-09-16  8:07     ` Jani Nikula [this message]
2025-09-15  9:13 ` [PATCH v2 06/11] drm/i915/gt: Use pci_rebar_size_supported() Ilpo Järvinen
2025-09-15 12:42   ` Jani Nikula
2025-09-15 17:24     ` Andi Shyti
2025-09-15 20:14       ` Rodrigo Vivi
2025-09-16  8:12         ` Jani Nikula
2025-09-16  8:57           ` Christian König
2025-09-16 16:05             ` Rodrigo Vivi
2025-09-15 17:22   ` Andi Shyti
2025-09-15  9:13 ` [PATCH v2 07/11] drm/xe/vram: Use PCI rebar helpers in resize_vram_bar() Ilpo Järvinen
2025-09-15 20:15   ` Rodrigo Vivi
2025-09-15  9:13 ` [PATCH v2 08/11] PCI: Add pci_rebar_get_max_size() Ilpo Järvinen
2025-09-15  9:13 ` [PATCH v2 09/11] drm/xe/vram: Use pci_rebar_get_max_size() Ilpo Järvinen
2025-09-15 20:14   ` Rodrigo Vivi
2025-09-15  9:13 ` [PATCH v2 10/11] drm/amdgpu: " Ilpo Järvinen
2025-09-15  9:13 ` [PATCH v2 11/11] PCI: Convert BAR sizes bitmasks to u64 Ilpo Järvinen
2025-09-15 17:04 ` [PATCH v2 00/11] PCI: Resizable BAR improvements Lucas De Marchi
2025-09-15 17:24   ` Ilpo Järvinen
2025-09-16 18:11     ` Lucas De Marchi
2025-09-17 13:00       ` Ilpo Järvinen
2025-09-17 19:11         ` Lucas De Marchi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=eb0bbfbcb963174bbb625268b0e5385deb8a2c62@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=airlied@gmail.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=andi.shyti@kernel.org \
    --cc=bhelgaas@google.com \
    --cc=christian.koenig@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=joonas.lahtinen@linux.intel.com \
    --cc=kw@linux.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lucas.demarchi@intel.com \
    --cc=michal.winiarski@intel.com \
    --cc=mjruhl@habana.ai \
    --cc=rodrigo.vivi@intel.com \
    --cc=simona@ffwll.ch \
    --cc=thomas.hellstrom@linux.intel.com \
    --cc=tursulin@ursulin.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).