Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp631924lqp; Sat, 13 Apr 2024 11:49:27 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWXothIZijX7rcw5UmF2icUWi7frihNtWKCZ59C9x7oFs3HfVtCh20FAi8QGjf9TNJqeSkSgyV4wt+dw+k5lwzQot1is6jf/n1tgCi1ww== X-Google-Smtp-Source: AGHT+IHsRyulhQsuJx00i1tUMus7NTFIpNoc01NjTSPaWQxacklzyNd5u/ZK9Ckj7VsL2u6Kb9cw X-Received: by 2002:a05:620a:2204:b0:78d:6133:9b64 with SMTP id m4-20020a05620a220400b0078d61339b64mr5685051qkh.41.1713034167473; Sat, 13 Apr 2024 11:49:27 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713034167; cv=pass; d=google.com; s=arc-20160816; b=wUd3FIpXaggQAfZ+6Bfb8sW+fhl2JLCgpnNJc0Nd1/6YXWVv747mlCZr/7uPkA+fIG ZxwPWSL2R7u3HYbXKYt9ym0JbF9okKvPh9Vn2+uehHXiOakQFoB8FI1W08vRTMmp4kup xjACu9HN+SiPfQSbt9VYPpJAiZK0immS3+AEsGSlWKvp9upHLOt2FotdEdHh90IQ6qQS UFS5oUbho9/xQ40ZTWCzBAEbHe1jBlZKkQwmiW0+RrKhVqRe3vnCkLW9j/nHKagheIeB sq5r/Jtzk8bYCVO1i1L9fnuOE9f/XHCFcEGNrIxy36UH/MAH/UXuBf+VxOjw1NwCWwxH M/iQ== 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:message-id:date:subject:cc:to :from:dkim-signature; bh=160OjO5rJ+6EO7hckAf9kwMm6qEF4sLw5PXx2sn7OvA=; fh=8eolg+Awaz+fHyAqUrCrIfDJKX090lpcy59pSmbUFhU=; b=PHAh3qJJRuQX4YNRSKsi+mqwzgCf3ha4s0WwWSTCBv1iQkkqqRF/uzDUKjn9R836Jb hIZ4AzqminMF2xHIhwI+lg4Wg8v2/MXSNLitfjKaazTH+F8NUoXThQQjP/mGXcPbsegb yZjPkmjA+TALxOb6eASZMKJNxjnHtLE1dAiko4g+LbLvHEAhYxZKF0nZefGb7/6L/m3R zjzdqPBQg3XUyZmXPJxPWcOoBMuyaNGPc5LXN/CB25+IRaCVY+A5qzeLR5S3cEW4E2Cy IKAIUStEQACD6uwWY2wa3LpCjxXy6itgcNUjyqv+XxJlpxqqmOu+IVe06zCQzCYw3sq8 ogoA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=P3hMO5sg; 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-143844-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-143844-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. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id ye8-20020a05620a3b8800b0078eca57f2f7si4562287qkn.39.2024.04.13.11.49.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 13 Apr 2024 11:49:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-143844-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=P3hMO5sg; 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-143844-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-143844-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 DEE561C209DC for ; Sat, 13 Apr 2024 18:49:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6B38653E0E; Sat, 13 Apr 2024 18:49:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="P3hMO5sg" Received: from mail-yw1-f169.google.com (mail-yw1-f169.google.com [209.85.128.169]) (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 4AD1C537E6; Sat, 13 Apr 2024 18:49:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.169 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713034158; cv=none; b=l0VbUdQzrP6ud4ThZBc1+cAGuFtDd6Cmy99bNQs6dh1f+DazlsAw7V1LPb+p+r6xWNgEGqlJwoxyYJs91QYJRb8VNX6c7Yyok9Tt5iyINxHlVzedFbDF7hVT5uALJ2QanVqPINh1oO8g/6XRCK8KYv7SG6r1Gis6OoJETRnzUhc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713034158; c=relaxed/simple; bh=z5FQ/+JIFzZLsKnwxuDvNC7NZmX+DCl2VNkM6o23eSg=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=Z+ASSSzJn3z7nznTcEtjW006jj/69bGHOBah6nvhspnKvA9S76PvqVdkNfZ/DHBVf14PhyxJDrRXvINYJsVs98GsBpzgdX9Jy0N28eWVY8YFrdjNYaq7gjjOg9p07nlbalHHTlWHpVaBtcv9iDBtBVq1NDL9IBUVuIN4HHSY3dM= 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=P3hMO5sg; arc=none smtp.client-ip=209.85.128.169 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-yw1-f169.google.com with SMTP id 00721157ae682-618944792c3so9375407b3.1; Sat, 13 Apr 2024 11:49:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713034156; x=1713638956; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=160OjO5rJ+6EO7hckAf9kwMm6qEF4sLw5PXx2sn7OvA=; b=P3hMO5sgXSX6kfQnVgP9WBDqm/IQgUoo+/OZMbQ4JOspC+SOLWZic2I3afJ3j6smxp tCY8gfbWYsk5CWJrBnYPKnJBz6hqaXjlWdKEwueUAHGV/gFrlqBK2GKD/lS77Vtv7/nU ATn3dLfjo3YoGCZ5k8ZJmOqPtC0FzppyIqjeKcIzim1PTlJGOWfJWJCgfGf+Vdzqa1EW 5BfEdYFkxuIu70FMnqhhwOoerGoKgIHHdRzjUPIeOB4VG0WoYrJxJ+zkkKzUoOP53PWp ijIx93PnVNl7BU3MR4XPe69Loz+cV2V4hgG0eCVCczonLmeyowg18XLmI1k01W/eBS1c E9Ew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713034156; x=1713638956; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=160OjO5rJ+6EO7hckAf9kwMm6qEF4sLw5PXx2sn7OvA=; b=eDOABbkm5j/prySW1hGeIpWsx9UAEjAZJ/xPiJeYInp2HDjd83TR2FRBdQuQ5ygOAl PfgjO/8k6t3ZhQ5TEpNrd9G5F6kGriYFeWggG15mrGjjJfRuOp9QAjOI+SqvVFGRbg3m sFEZ9RoC1nHG8ophi7GTjIqpX4p7FAwxMo897FyVPMLP0/H616Xmj0iW3QTVJctZKdlr Izr89AEhIAfGq6fvcvyul8COf80lIuIAzUHce0Qh+gVG9KPCZf7lRfLw94dpCcUXJunI hVMabxKX1Lc3m59Q+mFuW3j0KLwRMCIqjmHzG0QrB96i84n2VgvLJYpRTUscg4gTobVY g5zQ== X-Forwarded-Encrypted: i=1; AJvYcCVuX8T3VQR1Fi60zeoGnVOm5oZP/3aNagVXZwQ+2/Y2B7qXmuuJWpDFiF80fXoukRaNlwWYJW/t23SdFTdXXv+eLQ/VInprHS7TEyKwBHaWqAhMoalOgO8qC12EKE3t1AjEyP9azvln5Q== X-Gm-Message-State: AOJu0Yxif52ayPX3fcIvcSYIqxTItrXZ+125hLpo9u+hRT/5CIO8rh7R ApHZ0wJTtva2488GF3K3fl5XHO/Jhb2BLuv06RCwwCZ345ufZ+4Ch6ePNA== X-Received: by 2002:a0d:d794:0:b0:609:ef57:2266 with SMTP id z142-20020a0dd794000000b00609ef572266mr6214284ywd.34.1713034156101; Sat, 13 Apr 2024 11:49:16 -0700 (PDT) Received: from localhost ([69.73.66.55]) by smtp.gmail.com with ESMTPSA id k4-20020a81ed04000000b006145e0aa9c5sm1312426ywm.60.2024.04.13.11.49.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 13 Apr 2024 11:49: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] MIPS: SGI-IP27: micro-optimize arch_init_irq() Date: Sat, 13 Apr 2024 11:49:13 -0700 Message-Id: <20240413184913.69268-1-yury.norov@gmail.com> X-Mailer: git-send-email 2.40.1 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 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