Skip to content
Snippets Groups Projects
Commit 8cca0235 authored by Myron Stowe's avatar Myron Stowe
Browse files

PCI: Fix BUILD_BUG_ON usage for old gcc

JIRA: https://issues.redhat.com/browse/RHEL-83611
Upstream Status: 472ff48e2c09e49f2f90eeb6922f747306559506

commit 472ff48e2c09e49f2f90eeb6922f747306559506
Author: Alex Williamson <alex.williamson@redhat.com>
Date:   Wed Feb 12 11:53:32 2025 -0700

    PCI: Fix BUILD_BUG_ON usage for old gcc

    As reported in the below link, it seems older versions of gcc cannot
    determine that the howmany variable is known for all callers.  Include
    a test so that newer compilers can enforce this sanity check and older
    compilers can still work.  Add __always_inline attribute to give the
    compiler an even better chance to know the inputs.

    Link: https://lore.kernel.org/r/20250212185337.293023-1-alex.williamson@redhat.com


    Fixes: 4453f360862e ("PCI: Batch BAR sizing operations")
Reported-by: default avatarOleg Nesterov <oleg@redhat.com>
    Link: https://lore.kernel.org/all/20250209154512.GA18688@redhat.com


Signed-off-by: default avatarAlex Williamson <alex.williamson@redhat.com>
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
Tested-by: default avatarOleg Nesterov <oleg@redhat.com>
Tested-by: default avatarMitchell Augustin <mitchell.augustin@canonical.com>

Signed-off-by: default avatarMyron Stowe <mstowe@redhat.com>
parent 93aad829
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment