From nobody Fri Dec 19 07:46:21 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 42DB0C001DE for ; Mon, 24 Jul 2023 13:36:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231594AbjGXNgS (ORCPT ); Mon, 24 Jul 2023 09:36:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37414 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231588AbjGXNfq (ORCPT ); Mon, 24 Jul 2023 09:35:46 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 204E910D1 for ; Mon, 24 Jul 2023 06:35:10 -0700 (PDT) Message-ID: <20230724132045.915729323@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1690205662; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: references:references; bh=b8Xt5cYn7tsxj5f5GzHs5GjoZDN6ZZKDqaLjg/BbaXY=; b=hyVDnZMm328zZyvf5QBemGKZs+Q2iE0T1EdrVijsFxWqAS2fUUxpP8WALjYfMR+YwppUbY qHAFXvKGC9M8pqE9cI+U/AjvUK1RwJRJbPFlI1hBkqMVOdClqwyBKhMUlZtDEFl5yKtVeS H5QFXU6FiJOW4MocZSvwsBTBvU6ft6bekujhK0qJwclAviiwJf54FzRUWRoHBLf/5jy5XX U3VjGCIrF+y2bzUP1eH7FedSCFuUdr6JJl/TJjhMkRnurmJ+DWLcc/dhgAGuQFovH9jgbD PDhMWjMfw6Nrw28K331XGg+d9wHv/jtn41npDI5DsnwqRnxvI1UlMB9yfgfVxA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1690205662; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: references:references; bh=b8Xt5cYn7tsxj5f5GzHs5GjoZDN6ZZKDqaLjg/BbaXY=; b=oNFcrUX9MSZdx8ndzCs18KMcIfoCWf+qfisJhR231Lqe7MP6altfQ9GLb98G94mZYBp0ul PYJAF/u6OclYjIAw== From: Thomas Gleixner To: LKML Cc: x86@kernel.org, Andrew Cooper , Tom Lendacky , Paolo Bonzini , Wei Liu , Arjan van de Ven , Juergen Gross , Michael Kelley , Peter Keresztes Schmidt , "Peter Zijlstra (Intel)" Subject: [patch V2 22/58] x86/apic/ipi: Code cleanup References: <20230724131206.500814398@linutronix.de> MIME-Version: 1.0 Date: Mon, 24 Jul 2023 15:34:22 +0200 (CEST) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Remove completely useless and mindlessly copied comments and tidy up the code which causes eye bleed when looking at it. Signed-off-by: Thomas Gleixner Acked-by: Peter Zijlstra (Intel) --- arch/x86/kernel/apic/ipi.c | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) --- a/arch/x86/kernel/apic/ipi.c +++ b/arch/x86/kernel/apic/ipi.c @@ -184,18 +184,13 @@ void default_send_IPI_single_phys(int cp =20 void default_send_IPI_mask_sequence_phys(const struct cpumask *mask, int v= ector) { - unsigned long query_cpu; unsigned long flags; + unsigned long cpu; =20 - /* - * Hack. The clustered APIC addressing mode doesn't allow us to send - * to an arbitrary mask, so I do a unicast to each CPU instead. - * - mbligh - */ local_irq_save(flags); - for_each_cpu(query_cpu, mask) { + for_each_cpu(cpu, mask) { __default_send_IPI_dest_field(per_cpu(x86_cpu_to_apicid, - query_cpu), vector, APIC_DEST_PHYSICAL); + cpu), vector, APIC_DEST_PHYSICAL); } local_irq_restore(flags); } @@ -203,18 +198,15 @@ void default_send_IPI_mask_sequence_phys void default_send_IPI_mask_allbutself_phys(const struct cpumask *mask, int vector) { - unsigned int this_cpu =3D smp_processor_id(); - unsigned int query_cpu; + unsigned int cpu, this_cpu =3D smp_processor_id(); unsigned long flags; =20 - /* See Hack comment above */ - local_irq_save(flags); - for_each_cpu(query_cpu, mask) { - if (query_cpu =3D=3D this_cpu) + for_each_cpu(cpu, mask) { + if (cpu =3D=3D this_cpu) continue; __default_send_IPI_dest_field(per_cpu(x86_cpu_to_apicid, - query_cpu), vector, APIC_DEST_PHYSICAL); + cpu), vector, APIC_DEST_PHYSICAL); } local_irq_restore(flags); } @@ -283,7 +275,6 @@ void default_send_IPI_mask_logical(const local_irq_restore(flags); } =20 -/* must come after the send_IPI functions above for inlining */ static int convert_apicid_to_cpu(int apic_id) { int i;