From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 21C6A407561 for ; Tue, 24 Mar 2026 17:00:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.19 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774371621; cv=none; b=hPq12S+mxTJtSs8pjWvQSi9UFHgn3dxho8ocFwFV0ng0jVx3iI2L3HUrHhU25tUhri0vKNnvxfKmQhWejYdKZJNAIBNuqDE6LfxzEvK6hqYo55GTkizQ2VA+jA2b3uJnHRocSUi0ocE2Xau2RQhFXHkEjhWdh3U3OSln4hfrprE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774371621; c=relaxed/simple; bh=d6KLxSDgRcKiLzDY+NMiMRY2jmIC2rw/9NmZTIuAx/o=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=ZqgH1h8PQ+TGiEkNBcpPH1b0BZBB+/ssnmsGmlmSTIvP7I8BypMFqnbDHNUIxOCB7El/yHIFSj7HeH3OvM5oEX6MPoPI9DyzlJhaPyHBFgGFS8z0gHxLkYbos21L2F1xLI4DjU/1WryqoKlqab4P+2oBtPoHUTNOAgcTh4JhTwk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=pass smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=easix1+R; arc=none smtp.client-ip=198.175.65.19 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="easix1+R" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1774371619; x=1805907619; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=d6KLxSDgRcKiLzDY+NMiMRY2jmIC2rw/9NmZTIuAx/o=; b=easix1+RlY9rqMRBuoMLb2wAAfgSDz3ibtQyVj4mqKpmFLMQgTbIPCX4 gAA2tEX3xYIEto8+AkrxOuTPGzuP2j4e4VBVuKeGGwITBZ8oflbfV8Hkp 5VYbtgI5lBaHcrIDfpxq6mOnlCqa++w7ugTD3Nk8+ARqI+dmONSZvjXIR /p5fvft8c5Wa8UUJjzOkzuqezOLRv0raQAEbuHgWEc3mxJhsvClnVn1zP ZLy2GBHQZVVO7TOXnmjvfKgm9fv/GmNgMpWiRR/gxry7bYZfuF+hIbWXy vir35/haHx/+1Gs8DkkVK7Y7QH/pjiUkI44eIBNl3xTlmN+Yeovb/CpTL g==; X-CSE-ConnectionGUID: nUnU6aoWQo2pnsxJyPFYOw== X-CSE-MsgGUID: jBwyIQ2rTj6lPAcoDtiAQg== X-IronPort-AV: E=McAfee;i="6800,10657,11739"; a="75281440" X-IronPort-AV: E=Sophos;i="6.23,138,1770624000"; d="scan'208";a="75281440" Received: from fmviesa006.fm.intel.com ([10.60.135.146]) by orvoesa111.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Mar 2026 10:00:18 -0700 X-CSE-ConnectionGUID: ib4xzWKRSNm/cm3wyP1vbg== X-CSE-MsgGUID: WCv5QcPyT7OGGuY23A4d9Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.23,138,1770624000"; d="scan'208";a="219540242" Received: from ijarvine-mobl1.ger.corp.intel.com (HELO localhost) ([10.245.244.217]) by fmviesa006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Mar 2026 10:00:10 -0700 From: =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= To: linux-pci@vger.kernel.org, Bjorn Helgaas , Guenter Roeck , linux-alpha@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-m68k@lists.linux-m68k.org, linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, Russell King , Geert Uytterhoeven , Thomas Bogendoerfer , "James E.J. Bottomley" , Helge Deller , Michael Ellerman , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" , Chris Zankel , Max Filippov , Madhavan Srinivasan , Yoshinori Sato , Rich Felker , John Paul Adrian Glaubitz , linux-kernel@vger.kernel.org Cc: =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= Subject: [PATCH 07/10] parisc/PCI: Cleanup align handling Date: Tue, 24 Mar 2026 18:56:30 +0200 Message-Id: <20260324165633.4583-8-ilpo.jarvinen@linux.intel.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20260324165633.4583-1-ilpo.jarvinen@linux.intel.com> References: <20260324165633.4583-1-ilpo.jarvinen@linux.intel.com> Precedence: bulk X-Mailing-List: linux-m68k@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Caller of pcibios_align_resource() (__find_resource_space()) already aligns the start address by 'alignment' so aligning is only necessary if align > alignment. Change also to use ALIGN() instead of open-coding. Signed-off-by: Ilpo Järvinen --- arch/parisc/kernel/pci.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/arch/parisc/kernel/pci.c b/arch/parisc/kernel/pci.c index f99b20795d5a..f50be1a63c4c 100644 --- a/arch/parisc/kernel/pci.c +++ b/arch/parisc/kernel/pci.c @@ -8,6 +8,7 @@ * Copyright (C) 1999-2001 Hewlett-Packard Company * Copyright (C) 1999-2001 Grant Grundler */ +#include #include #include #include @@ -200,7 +201,7 @@ resource_size_t pcibios_align_resource(void *data, const struct resource *res, resource_size_t size, resource_size_t alignment) { - resource_size_t mask, align, start = res->start; + resource_size_t align, start = res->start; DBG_RES("pcibios_align_resource(%s, (%p) [%lx,%lx]/%x, 0x%lx, 0x%lx)\n", pci_name(((struct pci_dev *) data)), @@ -209,11 +210,8 @@ resource_size_t pcibios_align_resource(void *data, const struct resource *res, /* If it's not IO, then it's gotta be MEM */ align = (res->flags & IORESOURCE_IO) ? PCIBIOS_MIN_IO : PCIBIOS_MIN_MEM; - - /* Align to largest of MIN or input size */ - mask = max(alignment, align) - 1; - start += mask; - start &= ~mask; + if (align > alignment) + start = ALIGN(start, align); return start; } -- 2.39.5