From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 96291351C3D; Thu, 2 Jul 2026 16:50:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783011029; cv=none; b=gGaK4NluvpJ/Ff5aHrc87mhlMTxpdnZ2wRC2Uye65EmUPRUn3nexDpT2gp8UpyJhqRe22PlDljuvnyS5FpEVgs9Mmv+FlC/ZpfhcpfoMFdSsVEjQC284jIOLtCFMSyC/QOXj0drzFdj4Y09tbc2ASChqAnR63IINVOAvXxJOD8o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783011029; c=relaxed/simple; bh=YNnOhv4xBTM5olSxrJzCqc4jqCnNpXFNUsaI3Y2te/k=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Rb0Lcilk7U4RTjUcqbN64xX4yuR2lJ48n0jVe/ntWvKera1DQVB81rCrePSnNq9gxc3IuKi9oGiBkMz1OSyThjlONpTLYJqNgH7bKHyaxBwY93dtn+4MqSmtuaGAXoQq719uMG3PPn7Bnxq2B3OAsNPLwZmD0Mnlvft0tdrE640= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=vUabT+/G; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="vUabT+/G" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0B25F1F00A3A; Thu, 2 Jul 2026 16:50:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1783011028; bh=WpodCadzldF4rG+mUVfDIvE38OZJLUDTEKX6NIVgi3s=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=vUabT+/GKsOr/6APiTRMpXG3h5xqLWkXPs6Uyo1598aRwY+zSOKwNRYZUfbJGVwgh fxm3tpz2BZv5V1dLyPEwrrLpROwC86Mmf+gFELNl3cGuwLKWCeJItjwLoSSu22Bo4J MKW10+VoF/YxiBeMg0ChfmBVopeeThgOo9J6p5I4= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Arnd Bergmann , Alexander Lobakin , Nathan Chancellor , Tamir Duberstein , Alexander Gordeev , Andriy Shevchenko , Ansuel Smith , Bjorn Andersson , Heiko Carstens , Vasily Gorbik , Andrew Morton Subject: [PATCH 6.6 128/175] err.h: use __always_inline on all error pointer helpers Date: Thu, 2 Jul 2026 18:20:29 +0200 Message-ID: <20260702155118.507782064@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260702155115.766838875@linuxfoundation.org> References: <20260702155115.766838875@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Arnd Bergmann commit 94bfc7f3b0c7c33331ba4ff6cc64ff309dfcbce8 upstream. While testing randconfig builds on s390, I came across a link failure with CONFIG_DMA_SHARED_BUFFER disabled: ERROR: modpost: "dma_buf_put" [drivers/iommu/iommufd/iommufd.ko] undefined! The problem here is that IS_ERR() is not inlined and dead code elimination fails as a consequence. The err.h helpers all turn into a trivial assignment of a bit mask and should never result in a function call, so force them to always be inline. This should generally result in better object code aside from avoiding the link failure above. Link: https://lore.kernel.org/20260526101851.2495110-1-arnd@kernel.org Signed-off-by: Arnd Bergmann Reviewed-by: Alexander Lobakin Reviewed-by: Nathan Chancellor Tested-by: Tamir Duberstein Cc: Alexander Gordeev Cc: Andriy Shevchenko Cc: Ansuel Smith Cc: Bjorn Andersson Cc: Heiko Carstens Cc: Vasily Gorbik Cc: Signed-off-by: Andrew Morton Signed-off-by: Greg Kroah-Hartman --- include/linux/err.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) --- a/include/linux/err.h +++ b/include/linux/err.h @@ -36,7 +36,7 @@ * * Return: A pointer with @error encoded within its value. */ -static inline void * __must_check ERR_PTR(long error) +static __always_inline void * __must_check ERR_PTR(long error) { return (void *) error; } @@ -46,7 +46,7 @@ static inline void * __must_check ERR_PT * @ptr: An error pointer. * Return: The error code within @ptr. */ -static inline long __must_check PTR_ERR(__force const void *ptr) +static __always_inline long __must_check PTR_ERR(__force const void *ptr) { return (long) ptr; } @@ -56,7 +56,7 @@ static inline long __must_check PTR_ERR( * @ptr: The pointer to check. * Return: true if @ptr is an error pointer, false otherwise. */ -static inline bool __must_check IS_ERR(__force const void *ptr) +static __always_inline bool __must_check IS_ERR(__force const void *ptr) { return IS_ERR_VALUE((unsigned long)ptr); } @@ -67,7 +67,7 @@ static inline bool __must_check IS_ERR(_ * * Like IS_ERR(), but also returns true for a null pointer. */ -static inline bool __must_check IS_ERR_OR_NULL(__force const void *ptr) +static __always_inline bool __must_check IS_ERR_OR_NULL(__force const void *ptr) { return unlikely(!ptr) || IS_ERR_VALUE((unsigned long)ptr); } @@ -79,7 +79,7 @@ static inline bool __must_check IS_ERR_O * Explicitly cast an error-valued pointer to another pointer type in such a * way as to make it clear that's what's going on. */ -static inline void * __must_check ERR_CAST(__force const void *ptr) +static __always_inline void * __must_check ERR_CAST(__force const void *ptr) { /* cast away the const */ return (void *) ptr; @@ -102,7 +102,7 @@ static inline void * __must_check ERR_CA * * Return: The error code within @ptr if it is an error pointer; 0 otherwise. */ -static inline int __must_check PTR_ERR_OR_ZERO(__force const void *ptr) +static __always_inline int __must_check PTR_ERR_OR_ZERO(__force const void *ptr) { if (IS_ERR(ptr)) return PTR_ERR(ptr);