From nobody Sun Feb 8 03:12:40 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 0572813664E; Wed, 7 Aug 2024 16:25:27 +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=1723047930; cv=none; b=TrMdPpJnAk2d/iJnPurOjbmPY5p+CJT1Fvq/zAzIgmSU0pJdR1r5NCOTCQ4phba5mtDZIn9AA7QVOS4HxaS82/gQLS9K/ssbDu7c5BvCG/IJcoC0CpezUaVcrAYilEdOOq6Ybzlfshzks9qXXgHmBiQdSCsZ2t0T+Id6t62/Mhw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723047930; c=relaxed/simple; bh=I3AGRESc5p8REI4yajVN99TFEMPoLyxG3K3/N1xWWbY=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=lW/SFg2hjGgkWRkXEr2B69DAttmk8qVO2fUxaQ5p1fX2oufYSWz7vjqEXHVW6aLnYnrR3r4SkFKT8qSri6NACM4/8nH6Ut9qBXrANyzcZYnsEqnyfk806wyxz94zsPHCz52BuppKj4LAAQsWTh9kx/oqjamPUbBb5MK+IFb5aC8= 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=mBQfa2ip; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=88e9EPy8; 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="mBQfa2ip"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="88e9EPy8" Date: Wed, 07 Aug 2024 16:25:26 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1723047926; 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=Ohqb3tj5j0l6VtBbkrNNUmYdGVuauQsLyjHhYTdMplc=; b=mBQfa2ipsW0Nxv2vpJZJIZ1KlUlDrFDA8f/zM9PdC+THijlC/xNXVSbhhH3l9xl6ZpcWKY 0N7oDmvaY2aShPjwDHR8AW1VJA/qkN/lbMHgOT6bROGV+C0OqBpHf317IuiDXe04Xv7NtR mK5aw3GyAwPX/TGLwcDaQzgPZpc/SgRgDTfjwcf/VV+HmIENooZE8twJRos2ifdOudaiR4 a7mTGqInAKidHJMTotdf8ZBL0ASJulDe2pPWXhkwLDniTyE7AtpAcFftcHqVFTNRmvthfP 3LAhnU0v3Oe0VAWPKG6GehXe7y9EuAoQXrkkzyRRwWk5q344l5cwErKIgM/VQg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1723047926; 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=Ohqb3tj5j0l6VtBbkrNNUmYdGVuauQsLyjHhYTdMplc=; b=88e9EPy8GRTJwXd8eH6iZ4EcyfuBmUTKYsX21RyccmH/3CPpc6O5lMtkBLz6+9rnC68YDw r3HsJNFdovW1hjAQ== From: "tip-bot2 for Thomas Gleixner" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/apic] x86/ioapic: Cleanup bracket usage Cc: Thomas Gleixner , Qiuxu Zhuo , Breno Leitao , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20240802155441.032045616@linutronix.de> References: <20240802155441.032045616@linutronix.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <172304792603.2215.1502873980201261831.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/apic branch of tip: Commit-ID: 4bcfdf76d7d1976b035ca75776bc8d266a09d6c3 Gitweb: https://git.kernel.org/tip/4bcfdf76d7d1976b035ca75776bc8d266= a09d6c3 Author: Thomas Gleixner AuthorDate: Fri, 02 Aug 2024 18:15:49 +02:00 Committer: Thomas Gleixner CommitterDate: Wed, 07 Aug 2024 18:13:29 +02:00 x86/ioapic: Cleanup bracket usage Add brackets around if/for constructs as required by coding style or remove pointless line breaks to make it true single line statements which do not require brackets. Signed-off-by: Thomas Gleixner Tested-by: Qiuxu Zhuo Tested-by: Breno Leitao Link: https://lore.kernel.org/all/20240802155441.032045616@linutronix.de --- arch/x86/kernel/apic/io_apic.c | 34 +++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c index 25d1d1a..8d81c47 100644 --- a/arch/x86/kernel/apic/io_apic.c +++ b/arch/x86/kernel/apic/io_apic.c @@ -362,12 +362,13 @@ static void __remove_pin_from_irq(struct mp_chip_data= *data, int apic, int pin) { struct irq_pin_list *tmp, *entry; =20 - list_for_each_entry_safe(entry, tmp, &data->irq_2_pin, list) + list_for_each_entry_safe(entry, tmp, &data->irq_2_pin, list) { if (entry->apic =3D=3D apic && entry->pin =3D=3D pin) { list_del(&entry->list); kfree(entry); return; } + } } =20 static void io_apic_modify_irq(struct mp_chip_data *data, bool masked, @@ -562,8 +563,7 @@ int save_ioapic_entries(void) } =20 for_each_pin(apic, pin) - ioapics[apic].saved_registers[pin] =3D - ioapic_read_entry(apic, pin); + ioapics[apic].saved_registers[pin] =3D ioapic_read_entry(apic, pin); } =20 return err; @@ -604,8 +604,7 @@ int restore_ioapic_entries(void) continue; =20 for_each_pin(apic, pin) - ioapic_write_entry(apic, pin, - ioapics[apic].saved_registers[pin]); + ioapic_write_entry(apic, pin, ioapics[apic].saved_registers[pin]); } return 0; } @@ -617,12 +616,13 @@ static int find_irq_entry(int ioapic_idx, int pin, in= t type) { int i; =20 - for (i =3D 0; i < mp_irq_entries; i++) + for (i =3D 0; i < mp_irq_entries; i++) { if (mp_irqs[i].irqtype =3D=3D type && (mp_irqs[i].dstapic =3D=3D mpc_ioapic_id(ioapic_idx) || mp_irqs[i].dstapic =3D=3D MP_APIC_ALL) && mp_irqs[i].dstirq =3D=3D pin) return i; + } =20 return -1; } @@ -662,9 +662,10 @@ static int __init find_isa_irq_apic(int irq, int type) if (i < mp_irq_entries) { int ioapic_idx; =20 - for_each_ioapic(ioapic_idx) + for_each_ioapic(ioapic_idx) { if (mpc_ioapic_id(ioapic_idx) =3D=3D mp_irqs[i].dstapic) return ioapic_idx; + } } =20 return -1; @@ -1424,11 +1425,12 @@ static void __init setup_ioapic_ids_from_mpc_nochec= k(void) * We need to adjust the IRQ routing table if the ID * changed. */ - if (old_id !=3D mpc_ioapic_id(ioapic_idx)) - for (i =3D 0; i < mp_irq_entries; i++) + if (old_id !=3D mpc_ioapic_id(ioapic_idx)) { + for (i =3D 0; i < mp_irq_entries; i++) { if (mp_irqs[i].dstapic =3D=3D old_id) - mp_irqs[i].dstapic - =3D mpc_ioapic_id(ioapic_idx); + mp_irqs[i].dstapic =3D mpc_ioapic_id(ioapic_idx); + } + } =20 /* * Update the ID register according to the right value from @@ -2666,12 +2668,10 @@ static int bad_ioapic_register(int idx) =20 static int find_free_ioapic_entry(void) { - int idx; - - for (idx =3D 0; idx < MAX_IO_APICS; idx++) + for (int idx =3D 0; idx < MAX_IO_APICS; idx++) { if (ioapics[idx].nr_registers =3D=3D 0) return idx; - + } return MAX_IO_APICS; } =20 @@ -2780,11 +2780,13 @@ int mp_unregister_ioapic(u32 gsi_base) int ioapic, pin; int found =3D 0; =20 - for_each_ioapic(ioapic) + for_each_ioapic(ioapic) { if (ioapics[ioapic].gsi_config.gsi_base =3D=3D gsi_base) { found =3D 1; break; } + } + if (!found) { pr_warn("can't find IOAPIC for GSI %d\n", gsi_base); return -ENODEV;