Received: by 2002:a05:6500:1b45:b0:1f5:f2ab:c469 with SMTP id cz5csp129303lqb; Tue, 16 Apr 2024 10:37:38 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWvrw/EPBQOOgP0gRct1u3mDcbvFT1GBAtABozc/G49oL2XQfUeYr6vSt4ef8Wr+aQzPIo+UutcuEH2QYe6OqpWVwESv0hkVyzchL1zEA== X-Google-Smtp-Source: AGHT+IGYOcNRnF7C6b2LT9DwHJ4MCwrXgv4WmIhA8j+dPrVoRAp+ZI0GVDkaBPxoB8hvOYDXSxpr X-Received: by 2002:a05:6102:54a5:b0:478:473b:3ed4 with SMTP id bk37-20020a05610254a500b00478473b3ed4mr14832684vsb.23.1713289058104; Tue, 16 Apr 2024 10:37:38 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713289058; cv=pass; d=google.com; s=arc-20160816; b=GDLqhT4sk6B0ayvU33xhZAZj6T+Hp5hPKEAQjll+2EOtaaHCgqexOt7nq0tS9C3SOm S2rBrdKyaNf5gjbgapTvePqKWo2CI1CnL0Yoh5btPUExiWCJZ8DWDdJqacIwVFH9ZewV ovNzvPhYkmKtZnTI0Ty6ms/4XGszKERihQ8gBHhX1ER6nXjhp7bUI0ErIVXfPPpymzxL WkZ1SXw4W4n+4jUbGT5UDqX4MR8t58wkAwy5XWQm0tndZTOJSHPJy0zM9NbBpLhGAEoN utiS43x3/t5JM4FooidQRdduvj5xok8v+djXMzUufCIVj5gIaRIUX9zJOSRqVKtjvRe6 ADJQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=Fu3d9ue0RJEN40rHB+pClBdAIk5T18keph2dg8V6BMg=; fh=/DgpbSHMyXs4e/MsvoTc6gKXxreqleDeAvhEblg8Zew=; b=TE/KwexNIYvU7MJDbYBb6u44hdtQMqu+hXiJC7vGaRAJnOEr6AnBBUFINOb8ZDEEUA dC65gEBFTnN/AjTLluCf5dDtkSMC73nZDo6qX6MG92Gu8tCFwjxN/H1ZVfncW/O87XWu oAQZ/2srD2hff6InaeUVl84b4UeTS83GLtw+vn74ggqBdNxZf/zfxpnUYE3KpXJ2Wlba sl1H0j/+/mjwTUa7QniqwmIH4DGMYhgChKopp8DYNgbnTH9jWYki++nYBbtni/EMPJsY hu6ocNp86dwdg7PLixcgGwNGAuGufLoWTTMYR3BH09BUuv5JW/26FNPGlA8JghB2PjC/ Z8oQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=N8WPemrt; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-147321-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-147321-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id d15-20020a05621416cf00b0069b50350ad9si12048317qvz.190.2024.04.16.10.37.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Apr 2024 10:37:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-147321-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=N8WPemrt; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-147321-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-147321-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id C14591C21042 for ; Tue, 16 Apr 2024 17:37:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6931A134425; Tue, 16 Apr 2024 17:37:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="N8WPemrt" Received: from mail-yb1-f170.google.com (mail-yb1-f170.google.com [209.85.219.170]) (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 49FC4133435; Tue, 16 Apr 2024 17:37:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.170 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713289038; cv=none; b=ID8Y+5BG8lqHzEajBe/tilwZkmA3ifSuAwowzPa47unIJ3SudfM/Fs614yW5kBGBae5RXTA9jPSPuOESvnYDd39Yi7wCZBbAvxPcopoe2Jtk3qdWfgtYbed27mMNb/RGHyNI8ojgbLND6T9bM2leSXTDoNd9LwwAXo+44hwVYNI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713289038; c=relaxed/simple; bh=EjV2famXhIb7IZNI071UhvkpAcAeqfFS/DP81q74RJY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=b/meY4vDE5p/0VAM3cKK6Pu3+BMcWZjb9FUHA0OZtBXuLzI1IzeOyebKYZE6kn0K3JwKWxxo03id08Ym4/qmzoLvHhqGrBZzSqk8AtaasXLuPHRMTFXiN2kccT6/d37FyyfPBX5IHeVciB+rX5KQUx9+mtES7PIGMwqksK8IJ6k= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=N8WPemrt; arc=none smtp.client-ip=209.85.219.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-yb1-f170.google.com with SMTP id 3f1490d57ef6-dcc80d6006aso4621907276.0; Tue, 16 Apr 2024 10:37:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713289036; x=1713893836; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Fu3d9ue0RJEN40rHB+pClBdAIk5T18keph2dg8V6BMg=; b=N8WPemrtbc+OeBYGbUOwmrMhLdu/QRn4aX4DP/AFgvMyTXEeWyOEKrP4DeAWd0cyvF XdYW7cIT/zTD3wg/OEJV5LVQsdgCEPAFqKzZBNrLLKfsd38HMb8QUj3bDxqPaaEhhdNp 3OXzlAYE7leBeqbZhRRf2UWhWjc6qPomcfkw9R0EkCzwMizrzJjAKhzSuS6vNNE/eHzy TtxJKcalw9wXlLi/aHNXX+7wSy8WnpukYxkj/O4Eir6XAzqBBl7UeVlO6MZskjikjr0+ cckAkxkGO8eGZoLEovP/fnYyMDsgDTLOU5ZjpdZgJ6OSbxC8oIek8JUIJtt4nVD2fHWU HKcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713289036; x=1713893836; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Fu3d9ue0RJEN40rHB+pClBdAIk5T18keph2dg8V6BMg=; b=moxAzyODITX2Ojae6war1BnoG9xpIh6ZRND78AnsBVOXMlCZRRrZ7QrgMKRDvcAb6c Hx7NnfPZK18BFWtRpIG2TRKY7bGZ5VqX+fDyYdyJ7bDmKRo3N6y6xdKvfVirIKdLuGbL c86ru9MINaNcNAnH2MVofWkj1mtAlFGmQEjEOy/lkNEQMLTQ8RO7tZJZXGuoq8QpMz4M aaZ9qgL/XZXJe3BM4jfk0aRO82ZzvabrV2B74y6H4/1HxeNrhg3wHQUz1IsGhvgcoV+s UcePx7TYJmitxHvYN/SjO3gm6xe1APrVZGTgcknsTDLxJhFnTyEUgzfjdzW7UOsMVgxg lwLQ== X-Forwarded-Encrypted: i=1; AJvYcCX/kXpUZz4+JjG1f7NSKxntqX9fU/JGcTwZWbTK8vGg6yhEYSJVakO4sGKb8/eOoOrtoEf/vcBBKhOeHi0pxE/d7qBauU9x4ByUF+veY1vxV1H07ZxoRf1EGSzT+jvg+JEfplq+CJE7Ow== X-Gm-Message-State: AOJu0YztJWY736VBZE34ZsN90gCJW2KRjmu2atbLTYiKlWkny6pHJr81 jrh5yqB+RlPypq1TRVxKjJXqzK+rTGEuquXr9hWaDMkIy3tiWpvYB11Lzg== X-Received: by 2002:a05:6902:2b84:b0:dc2:41de:b744 with SMTP id fj4-20020a0569022b8400b00dc241deb744mr15263478ybb.32.1713289036231; Tue, 16 Apr 2024 10:37:16 -0700 (PDT) Received: from localhost ([2601:344:8301:57f0:2767:ac3e:3052:cd0]) by smtp.gmail.com with ESMTPSA id c6-20020a258806000000b00dc6d51c8555sm2486186ybl.17.2024.04.16.10.37.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Apr 2024 10:37:15 -0700 (PDT) From: Yury Norov To: Thomas Bogendoerfer , Florian Fainelli , linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Yury Norov Subject: [PATCH v2 1/2] MIPS: SGI-IP27: micro-optimize arch_init_irq() Date: Tue, 16 Apr 2024 10:37:10 -0700 Message-Id: <20240416173711.613750-2-yury.norov@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240416173711.613750-1-yury.norov@gmail.com> References: <20240416173711.613750-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-Transfer-Encoding: 8bit The function sets adjusted 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, with the associate overhead. Effectively, it would be a compile-time: *hub_irq_map = GENMASK() | GENMASK(); Signed-off-by: Yury Norov --- arch/mips/sgi-ip27/ip27-irq.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/arch/mips/sgi-ip27/ip27-irq.c b/arch/mips/sgi-ip27/ip27-irq.c index 8f5299b269e7..d8acdf0439d2 100644 --- a/arch/mips/sgi-ip27/ip27-irq.c +++ b/arch/mips/sgi-ip27/ip27-irq.c @@ -277,7 +277,6 @@ void __init arch_init_irq(void) { struct irq_domain *domain; struct fwnode_handle *fn; - int i; mips_cpu_irq_init(); @@ -286,11 +285,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