From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F136B313283 for ; Tue, 2 Jun 2026 12:41:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.50 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780404063; cv=none; b=CBruwzAaLFHcOj4PYvUEbtjT550VKIpIJ96DTDl7PU0vItSdzkhpb1jkV29D0VX9MIQoGFrMFROvqS6fEzjy62HkPB/sPGcGPZ9yGqGKGZI9tSaEA3XVl8gNkehef6K0IZxY1RYCbYAHIsctnVIXS4EM0RxaixB7bj0Oeju/9+E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780404063; c=relaxed/simple; bh=lcXbnLDgLgVs2uXAQfjp2nc6EET+6EBNWhFE8+/l0xY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=qp+iw5oCKfXAtNpWpn9qNLJj9Fnh/wDSdRXhIpfZpeBf4R4Fpvzc2nV73D6wDGgkEWQStLCBdRsGhanjddRDMMT7alacgjvd+eIWUZQ5dKHSsgbOBQMxebs09xnIXU9TpzM2oItwhXvCHl3w6CD5M3TA+lPPQuJT/meCFquT07g= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=IW45O6Va; arc=none smtp.client-ip=209.85.128.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="IW45O6Va" Received: by mail-wm1-f50.google.com with SMTP id 5b1f17b1804b1-490a765d410so28009805e9.1 for ; Tue, 02 Jun 2026 05:41:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1780404059; x=1781008859; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=qSDM2Nyr7WYYlYXf1yBwq5GfCMjSOs4ctNyEmP6XpQA=; b=IW45O6VaRSkblMVsvJfCNyHg2woDizBEVSqXSFKF9GWHXDhMwxrR4n6wD/4430W96W ww6pa8LvU+lsoX8S9/O1YE3/oN/lBHog9MWlyifEFPlZKNLbd/+L6ipQKMToRONbwfVv z93iQsvup+wSCajULsETGntW836vgYJLGFem+CuCSuhTiYGfAwEPL8v2rzQIORrc4mUI EhW5pYCH2Nd/37lSh8o7NNYGIx6/1SHV5P/LpGdsd1Y0Qktp2LZkj/8nHdydufjZlVTW JKlA1WP1Ao02jsaMqnU2/o5G+k3RPKh5xpBD4yJqVvCs0SBdEVFq9QCshIWBJKKWa6Ry k+Lg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780404059; x=1781008859; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qSDM2Nyr7WYYlYXf1yBwq5GfCMjSOs4ctNyEmP6XpQA=; b=LAtR3wPlCbNY6f2TL55CfI/RDEpCbnR088y5vYWEAzRxlYBMmzt0pORMMCZmlKt1hE vCkPHZK/jpIQqYHvJRv75uN6PRNg5BAkZIXzlMBhWieG9yAcr9AcOWmbNPjuyzUKlq9q xr+FCC5kei2OndUp4ELs8FftcX2x/tvIBgTwLJhd0flv0elij2R9Hx+NJL1b7YhuqQlA tMyoDd+KGsow8+gMSTc4xgwKJ0ti0npx3A/x234Ody+hkSC2Z4ro4G8ImcXYR6sJv0mq twsH/lxQu9Ai2O7NvbRyGVhIJgXYgqv24RMqyTJ0N+RXycpkinPUBoDVDdEGBfTFkWkp lIrA== X-Forwarded-Encrypted: i=1; AFNElJ86v3ZBn1fVs/QcFCW5I7C2+P7St5Yb0PvTm543zYQ3D1XImtQAuVDq+tIaWjPcayMvH67L7J8=@vger.kernel.org X-Gm-Message-State: AOJu0YzR99mJstHBrXhBl90IYpA75EeKj4mwtATxQCdatLICUccuRhCR isBFqBA2/9TH2AiWDVrfflb2OgqoYcM7Szj+TvGoCycMO/2hXr/lEw95uJogpxa5Bi0= X-Gm-Gg: Acq92OE3akheiuIcNZvNoM6vXc025g0URaVnJq1ofJYl7Dn+YxqgZt6xvxnTdtvP5bu HGg7QdjLE3o20TCiRfPbr7q7nKHGy0/4Rje2B2WLGyCOPPZIdWX+4uZJQGrH17UUTtfCr08EJKS jFDKt3S2uWHVZQsYNaiTqPdThtOcoa4zt1jRUMWk6Z3LV9jo32BwjHudogxqUgBWm/+FiUmEOyh 86F31uHY9HXMaX2ZFwYwqJlgiSYqMfuB5os7AmSNwKoTv0FlFWdGaOhnRdNQCFBMsWGJxDDQhnf u/3Mn9m9PeW9dEWN5Zrmug4eGyIzzRnVny3PPd3lSRkLR4tcZ2mYZpqD8ihl83kZUDGw7xicxan wjHo7PUsWWJ/naawLJRCvpWGCvv/hrwQl1+Hj1AmZjXM4dNGzBexHtk4SnzhdusMAtp0kKnihAj HySuoXxAzj+/CRXNpCIhUWQ3gGvFfsh+DZCDyX X-Received: by 2002:a05:600c:4e43:b0:490:ace2:f8f with SMTP id 5b1f17b1804b1-490ace2109bmr139640425e9.21.1780404059323; Tue, 02 Jun 2026 05:40:59 -0700 (PDT) Received: from pathway ([176.114.240.130]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-490b0e38126sm55399785e9.14.2026.06.02.05.40.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jun 2026 05:40:59 -0700 (PDT) Date: Tue, 2 Jun 2026 14:40:56 +0200 From: Petr Mladek To: Andy Shevchenko Cc: Andrew Morton , mm-commits@vger.kernel.org, stable@vger.kernel.org, nathan@kernel.org, hca@linux.ibm.com, gor@linux.ibm.com, ansuelsmth@gmail.com, andersson@kernel.org, aleksander.lobakin@intel.com, agordeev@linux.ibm.com, arnd@arndb.de, Tamir Duberstein Subject: Re: + errh-use-__always_inline-on-all-error-pointer-helpers.patch added to mm-nonmm-unstable branch Message-ID: References: <20260526184100.3BA431F000E9@smtp.kernel.org> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Adding Tamir into Cc. On Tue 2026-06-02 11:36:30, Andy Shevchenko wrote: > On Tue, May 26, 2026 at 11:40:59AM -0700, Andrew Morton wrote: > > > The patch titled > > Subject: err.h: use __always_inline on all error pointer helpers > > has been added to the -mm mm-nonmm-unstable branch. Its filename is > > errh-use-__always_inline-on-all-error-pointer-helpers.patch > > > > This patch will shortly appear at > > https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/errh-use-__always_inline-on-all-error-pointer-helpers.patch > > Petr, shouldn't this also fix the problem with old (buggy) GCC for xtensa > (IIRC) that we encountered in some tests a couple of months ago? It might here there as well. Unfortunately, I could not test it easily because it required some old GCC. I wonder if Tamir could try to revert the commit 8901ac9d2c7eb8ed ("printf: Compile the kunit test with DISABLE_BRANCH_PROFILING") and try this patch instead. Best Regards, Petr > > ------------------------------------------------------ > > From: Arnd Bergmann > > Subject: err.h: use __always_inline on all error pointer helpers > > Date: Tue, 26 May 2026 12:18:41 +0200 > > > > 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 > > Cc: Alexander Gordeev > > Cc: Andriy Shevchenko > > Cc: Ansuel Smith > > Cc: Bjorn Andersson > > Cc: Heiko Carstens > > Cc: Nathan Chancellor > > Cc: Vasily Gorbik > > Cc: > > Signed-off-by: Andrew Morton > > --- > > > > include/linux/err.h | 12 ++++++------ > > 1 file changed, 6 insertions(+), 6 deletions(-) > > > > --- a/include/linux/err.h~errh-use-__always_inline-on-all-error-pointer-helpers > > +++ a/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; > > } > > @@ -60,7 +60,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; > > } > > @@ -73,7 +73,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); > > } > > @@ -87,7 +87,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); > > } > > @@ -99,7 +99,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; > > @@ -122,7 +122,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); > > -- > With Best Regards, > Andy Shevchenko >