From nobody Sun Feb 8 12:31:29 2026 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 0998529CB36; Fri, 11 Apr 2025 10:01:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744365710; cv=none; b=GscLJvfNE2gWfPthroaOmS2ynkxlTtvb+GNEALE1uwyUa5TSbVEcpSjxQqhT0tL6KAIIe27olRmYMH2+cFDOwYB1RI0zlsthxLti6zL8WLUiqKJJjFG5rCRUO5YoKzZUhlJkwFLRPmSPEMhg3iqzKKX+pKd8MNuVIbvQI7HM6Lw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744365710; c=relaxed/simple; bh=nllYZBrTXodZWRzDOFb2QRGZwFmX/iebI7NbOtoIdZQ=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=bycrMJOyZ74AkGHFxDj7wfbJlMbsRCE5diOOs0ff1FmfA90YZTtArgwaknGETrD4+ztaLPxeyqyD2Tce8UVtNKXIsJARmI4wjEScSueSC77k/QpcW98oSD3/lGK+dqlaEx8k0GUBa5ly0289k3zYI/BIROdBcOaSGRQHetqncak= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=D1plfjaZ; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=b7HF3JMM; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="D1plfjaZ"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="b7HF3JMM" Date: Fri, 11 Apr 2025 10:01:46 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1744365707; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9C4H87RYRr0XBIB3osHeuQWuFd01yqua5Js59xFV9O0=; b=D1plfjaZQtqXxsREilNsmWgSgSOR/XWSvhhCXExmkotcy+9BFuCTMZEILDZx7jfyDi0+mn UV4INNsDZ5qiTyx7Wh436jQ3Eg3wZ//vnjc1jLUDXcNIzpnFlVX+K7/Gkqhp5buJ/dLigP /SdO/MFsJcxAarALZAQD4vCV2m7RhFHkObmYMnFSJgKMNC0SvTcjC7jYvVNbRBbQMdrDwP gHf/6ppSLMLA0sGowYgoGJWVQuVALYm6mpQqA3qjDR8cWyr25PfDJQKKv0iR7ETPkJJymT 840T0TAaVl8dCO3XMK4K8yzSVg+6nYa+15pp/IsoZHFWTe5m10ZENydVIPc+kA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1744365707; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9C4H87RYRr0XBIB3osHeuQWuFd01yqua5Js59xFV9O0=; b=b7HF3JMM32qvTrRGYfDfWfaM374ZxoRleuttanAex6jH6uKrTLcGUOPW09dIIvckufAGbn EpJiqZjpWeFGfaBw== From: "tip-bot2 for Ingo Molnar" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/alternatives] x86/alternatives: Simplify and clean up patch_cmp() Cc: Ingo Molnar , Juergen Gross , "H . Peter Anvin" , Linus Torvalds , Peter Zijlstra , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20250411054105.2341982-44-mingo@kernel.org> References: <20250411054105.2341982-44-mingo@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <174436570648.31282.5757687380254711234.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable The following commit has been merged into the x86/alternatives branch of ti= p: Commit-ID: 3e6f47573ec3ed1d9dc50243fbcf50c87f740853 Gitweb: https://git.kernel.org/tip/3e6f47573ec3ed1d9dc50243fbcf50c87= f740853 Author: Ingo Molnar AuthorDate: Fri, 11 Apr 2025 07:40:55 +02:00 Committer: Ingo Molnar CommitterDate: Fri, 11 Apr 2025 11:01:35 +02:00 x86/alternatives: Simplify and clean up patch_cmp() - No need to cast over to 'struct smp_text_poke_loc *', void * is just fine for a binary search, - Use the canonical (a, b) input parameter nomenclature of cmp_func_t functions and rename the input parameters from (tp, elt) to (tpl_a, tpl_b). Signed-off-by: Ingo Molnar Cc: Juergen Gross Cc: "H . Peter Anvin" Cc: Linus Torvalds Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20250411054105.2341982-44-mingo@kernel.org --- arch/x86/kernel/alternative.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c index 14ca17d..f278655 100644 --- a/arch/x86/kernel/alternative.c +++ b/arch/x86/kernel/alternative.c @@ -2498,13 +2498,11 @@ static __always_inline void *text_poke_addr(const s= truct smp_text_poke_loc *tp) return _stext + tp->rel_addr; } =20 -static __always_inline int patch_cmp(const void *key, const void *elt) +static __always_inline int patch_cmp(const void *tpl_a, const void *tpl_b) { - struct smp_text_poke_loc *tp =3D (struct smp_text_poke_loc *) elt; - - if (key < text_poke_addr(tp)) + if (tpl_a < text_poke_addr(tpl_b)) return -1; - if (key > text_poke_addr(tp)) + if (tpl_a > text_poke_addr(tpl_b)) return 1; return 0; }