Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp1290753lqp; Mon, 15 Apr 2024 01:36:08 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWdwhyL00TQwrpOm4mUGGD78cySjMf55cj0kQ4xClgR1NN3ACBXLceXJCrdNlqxvLo07s8XSBe+L5ygt7zrEeUK080D5thznvsQq1zMWA== X-Google-Smtp-Source: AGHT+IFIn3kiz71UsqEIoT9TFV/w013FMSDG0GQkHUXKaUoT/8y9Kf0vs9mei4zv63zsCMXNfVgj X-Received: by 2002:ac2:4c06:0:b0:518:dec6:9b78 with SMTP id t6-20020ac24c06000000b00518dec69b78mr1874387lfq.34.1713170168315; Mon, 15 Apr 2024 01:36:08 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713170168; cv=pass; d=google.com; s=arc-20160816; b=g/akarWRsR/s8xYMD8woON4aRbLT+Ny+kI9fy3qW1wXjxxNfFleQmJoo3kAYm8NoTT xL3O8EQbfRW7mOD2wLraXqtVBMYspaQQwBY1DvHFkJ9gl2hT5FFdcSEsXz8xetUl8mgi z1S3sTHtPnyEryfrAyw2GB2xPKGJgVAYbJt4G3hDscTmCPngtUcyaxGo4C84fh1KhFHC Pkk2VpzPa4WTMaxabLmcuWu5v+txlFgr3VwYUHuH7TxgYU+29A+37bOJ8oHRrgxTCzto AnoSdACsT+FMA+lL4lnJNFjehP9r0ssYNXYVROJ+8TR9JzO73QckvxlbpwwFJxmRPQ/a RTEw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date; bh=ImvoQlDsG8xqjMqXHTYkKS5yL2pC/dY2Yitvk+vdgGk=; fh=kLuMBm8wiE8aHE2z7i14+I1F40rAr9PX2m5u4WTznDU=; b=mlOHLsXdsFFck8KaKzY13/z36btAoTkoSEygIClLMR9qBfBaYksXjCtwZZRL8WzOwh C7lwj9RMJZkORkJ9yR2YAx8oI8YpbyGZeVuoGbyif8w2hPnkhkzF6xMbrdo3Y/aViNnw 0gnlhT30WerFLWSTz2HDwh3r6HswXpuVu32joO9KSKSsolOkqCRzMMuWl18QeFEUqA8k QvF1ht/0fdjV58znu6B4H7w+0NfEweFcdG3vxBiNB5oP49+aYd3KbjFMhOqT+NyJVDXi ixAhHk34vLY9T+Fb+nUPBQ6z0PZoGG5vY4wgaT4tfTKsnmamgJTKGfHkNXNcLvUMgLoF pBvg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=alpha.franken.de); spf=pass (google.com: domain of linux-kernel+bounces-144765-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-144765-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id m27-20020a50999b000000b0056fffb7d15fsi3028125edb.18.2024.04.15.01.36.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 01:36:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-144765-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=alpha.franken.de); spf=pass (google.com: domain of linux-kernel+bounces-144765-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-144765-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 0D3431F22DBC for ; Mon, 15 Apr 2024 08:36:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 047F538390; Mon, 15 Apr 2024 08:36:02 +0000 (UTC) Received: from elvis.franken.de (elvis.franken.de [193.175.24.41]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 93AB51EA80; Mon, 15 Apr 2024 08:35:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.175.24.41 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713170161; cv=none; b=nl6iDK0vTpjjH/u3Q6ppXqiPT+dwLAepRz1+T1+eoWdVnRLoX7JHO5YrHCk1lTE3S+Er1LX+/3xYmkNcrSWZNmc8us0yKiLR2gMfksGoir9+2zywQxxP5ocm8PTnn4lD4fEEwPMc8mhDMHFDhpyYgixaFqCSRS7X1QwoAW43FKo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713170161; c=relaxed/simple; bh=zCwhZJeLM6BejwsbJwh9RhBF8AjtaK6UWfkK7UhZzSA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=dRXa2c9pw14mhmy7KEWctVI4dMUsFkJ1Nd6oKyKDfYshNVq+/15tX2mkPFC0pT+sqBevalNYrh4r13urEisvJqBgT7AJH7HOzmMIQ/dNUMHKgN9m2rLjVZ9zPjNvQfE8/bxh1+Ikt0zATrntkYhc7bezhwklMpc8fNzXM01sS0A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=alpha.franken.de; spf=pass smtp.mailfrom=alpha.franken.de; arc=none smtp.client-ip=193.175.24.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=alpha.franken.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=alpha.franken.de Received: from uucp by elvis.franken.de with local-rmail (Exim 3.36 #1) id 1rwHoa-0004hf-00; Mon, 15 Apr 2024 10:35:48 +0200 Received: by alpha.franken.de (Postfix, from userid 1000) id CE426C0135; Mon, 15 Apr 2024 10:31:37 +0200 (CEST) Date: Mon, 15 Apr 2024 10:31:37 +0200 From: Thomas Bogendoerfer To: Yury Norov Cc: Florian Fainelli , linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] MIPS: SGI-IP27: micro-optimize arch_init_irq() Message-ID: References: <20240413184913.69268-1-yury.norov@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@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: <20240413184913.69268-1-yury.norov@gmail.com> On Sat, Apr 13, 2024 at 11:49:13AM -0700, Yury Norov wrote: > The function sets adjasted groups of bits in hub_irq_map by using > for-loops. There's a bitmap_set() function dedicated to do this. > > Because [0, CPU_CALL_B_IRQ] and [NI_BRDCAST_ERR_A, MSC_PANIC_INTR] > ranges belong to the same machine word, bitmap_set() would boil down > to an inline wrapper in both cases, avoiding generating a loop, whth > the associate overhead. > > Signed-off-by: Yury Norov > --- > arch/mips/sgi-ip27/ip27-irq.c | 7 ++----- > 1 file changed, 2 insertions(+), 5 deletions(-) > > diff --git a/arch/mips/sgi-ip27/ip27-irq.c b/arch/mips/sgi-ip27/ip27-irq.c > index e6ca34cc9853..3c3a4b56ab95 100644 > --- a/arch/mips/sgi-ip27/ip27-irq.c > +++ b/arch/mips/sgi-ip27/ip27-irq.c > @@ -279,11 +279,8 @@ void __init arch_init_irq(void) > * Mark these as reserved right away so they won't be used accidentally > * later. > */ > - for (i = 0; i <= CPU_CALL_B_IRQ; i++) > - set_bit(i, hub_irq_map); > - > - for (i = NI_BRDCAST_ERR_A; i <= MSC_PANIC_INTR; i++) > - set_bit(i, hub_irq_map); > + bitmap_set(hub_irq_map, 0, CPU_CALL_B_IRQ + 1); > + bitmap_set(hub_irq_map, NI_BRDCAST_ERR_A, MSC_PANIC_INTR - NI_BRDCAST_ERR_A + 1); > > fn = irq_domain_alloc_named_fwnode("HUB"); > WARN_ON(fn == NULL); > -- > 2.40.1 applied to mips-next. Thomas. -- Crap can work. Given enough thrust pigs will fly, but it's not necessarily a good idea. [ RFC1925, 2.3 ]