Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1674061

Re: [PATCH 2/3] pci: Add a generic, weakly-linked pcibios_align_resource

From Geert Uytterhoeven <geert@linux-m68k.org>
Newsgroups linux.kernel
Subject Re: [PATCH 2/3] pci: Add a generic, weakly-linked pcibios_align_resource
Date 2017-06-24 11:50 +0200
Message-ID <tVPRv-69X-3@gated-at.bofh.it> (permalink)
References <tVIGl-1JB-3@gated-at.bofh.it> <tVIGl-1JB-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hi Palmer,

On Sat, Jun 24, 2017 at 3:50 AM, Palmer Dabbelt <palmer@dabbelt.com> wrote:
> Multiple architectures define this as trivial function, and I'm adding
> another one as part of the RISC-V port.  This adds a __weak version of
> pcibios_align_resource and deletes the now obselete ones in a handful of
> ports.
>
> The only functional change should be that a handful of ports used to
> export pcibios_fixup_bus.  Only some architectures export this, so I
> just dropped it.
>
> Signed-off-by: Palmer Dabbelt <palmer@dabbelt.com>

This function is only ever used as a pointer passed to
pci_bus_alloc_resource()?

What about having

    #ifndef pcibios_fixup_bus
    #define pcibios_fixup_bus NULL
    #endif

in asm-generic/pci.h, letting the architecture with a non-trivial
implementation predefine the preprocessor symbol, and teaching
pci_bus_alloc_resource() to handle NULL?

[...]

Oh, the latter eventually calls into allocate_resource(), which already falls
back to simple_align_resource() if the alignment function is NULL, which
does the same thing.
So NULL should already work.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

pci: Add generic pcibios_{fixup_bus,align_resource} Palmer Dabbelt <palmer@dabbelt.com> - 2017-06-24 04:10 +0200
  [PATCH 2/3] pci: Add a generic, weakly-linked pcibios_align_resource Palmer Dabbelt <palmer@dabbelt.com> - 2017-06-24 04:10 +0200
    Re: [PATCH 2/3] pci: Add a generic, weakly-linked pcibios_align_resource Geert Uytterhoeven <geert@linux-m68k.org> - 2017-06-24 11:50 +0200
      Re: [PATCH 2/3] pci: Add a generic, weakly-linked pcibios_align_resource Palmer Dabbelt <palmer@dabbelt.com> - 2017-06-24 23:40 +0200
  [PATCH 1/3] pci: Add a generic, weakly-linked pcibios_fixup_bus Palmer Dabbelt <palmer@dabbelt.com> - 2017-06-24 04:10 +0200
    Re: [PATCH 1/3] pci: Add a generic, weakly-linked pcibios_fixup_bus Geert Uytterhoeven <geert@linux-m68k.org> - 2017-06-24 11:40 +0200
      Re: [PATCH 1/3] pci: Add a generic, weakly-linked pcibios_fixup_bus Palmer Dabbelt <palmer@dabbelt.com> - 2017-06-24 23:40 +0200
  [PATCH 3/3] arc: kernel/pcibios.c is empty, delete it Palmer Dabbelt <palmer@dabbelt.com> - 2017-06-24 04:10 +0200

csiph-web