Re: [PATCH 05/10] am68k/PCI: Remove unnecessary second application of align

Geert Uytterhoeven <[email protected]>
Newsgroups gmane.linux.ports.ppc64.devel,gmane.linux.kernel.pci,gmane.linux.ports.alpha,gmane.linux.ports.arm.kernel,gmane.linux.ports.mips,gmane.linux.ports.parisc,gmane.linux.ports.sh.devel,gmane.linux.kernel
Message-ID <CAMuHMdXX16=pih34yehj=3bJkg2H3ivGUj_34JDg31ABheLE5Q@mail.gmail.com>
CC gerg

On Tue, 24 Mar 2026 at 17:59, Ilpo Järvinen
<[email protected]> wrote:
>
> Aligning res->start by align inside pcibios_align_resource() is
> unnecessary because caller of pcibios_align_resource() is
> __find_resource_space() that aligns res->start with align before
> calling pcibios_align_resource().
>
> Aligning by align in case of IORESOURCE_IO && start & 0x300 cannot ever
> result in changing start either because 0x300 bits would have not
> survived the earlier alignment if align was large enough to have an
> impact.
>
> Thus, remove the duplicated aligning from pcibios_align_resource().
>
> Signed-off-by: Ilpo Järvinen <[email protected]>
> ---
>  arch/m68k/kernel/pcibios.c | 2 --
>  1 file changed, 2 deletions(-)
>
> diff --git a/arch/m68k/kernel/pcibios.c b/arch/m68k/kernel/pcibios.c
> index 1415f6e4e5ce..7e286ee1976b 100644
> --- a/arch/m68k/kernel/pcibios.c
> +++ b/arch/m68k/kernel/pcibios.c
> @@ -36,8 +36,6 @@ resource_size_t pcibios_align_resource(void *data, const struct resource *res,
>         if ((res->flags & IORESOURCE_IO) && (start & 0x300))
>                 start = (start + 0x3ff) & ~0x3ff;
>
> -       start = (start + align - 1) & ~(align - 1);
> -
>         return start;
>  }
>
> --
> 2.39.5
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.