Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp294920ybt; Tue, 7 Jul 2020 23:37:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzN2sefiHIUhXylKqdne3lNHA+Imvrj/D9iHulgv/3VSPlEru5TtqS+SQ7TmJb9c5Mpy/Dc X-Received: by 2002:a50:e60d:: with SMTP id y13mr1407504edm.225.1594190228238; Tue, 07 Jul 2020 23:37:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594190228; cv=none; d=google.com; s=arc-20160816; b=C/EnOpW1XSsE3SSw+fZl33OF1xLajMAdyUjNErfVEmBou/WA7X5uAn/ZMxRaUjOHxQ krF8ud/nqhLsuJQlRnA/qbGyMHpD8h46X/G9vfw6/gwyZhEhZNKNLZ8dlqHGh1D9WjMo yZWADg+s89Y1+c5pLPiq2Kxts1KDI0p19uomtecKAT3dI0J3dMCtOh9ROpbA+yIeCehq gEXpEfksJEHvQiFA4UXTcC/mP7alcwAosB5b2tQFPtYe7dlMhohOIeBBq+bZM1vxXiq5 FXR1A4hBQR3cPPjNNxlI7P1Tg9Pex1mJm3PaCQoY+uhGKWBqvbnrHGG0r+qFi8jZcjMY TmZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=f4wJITV3m/98JglYhwBWjwU5rUJ32aVUFyomh2S4DWs=; b=aWAIWzXSFiB5NG848PThmiyS4lSz8EFOjn5MQyFGOfdqdZs+x77JJobmALd6QPrbQR hZZfNPtj4aDBqZVJDV7cx32H8IaFFMLyiy0Fta5kgYBXz+YBX72rX7zqr4nTIAhiqH+E Xs4GjEId7hz4sAwllXSF+OL8RdNbJKjWWn2Tjelqn0/bbiCinrO9BSeFdjPUbuvGzpUd 3vL0hC3ZXsWUy049PFbhFUZ3cFklNKQ2eyhQ7AW2Kb7Rya7oB7lSXSFbxL6HpJy2GVPF 5c6fWWu3jDAkTJ4N7De4bsuoZWG4EbaWIATqYqIcSXucs6er4AYYJUATqZlee8j2KTg2 sYEA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b24si1103468edw.188.2020.07.07.23.36.44; Tue, 07 Jul 2020 23:37:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729411AbgGHGcS (ORCPT + 99 others); Wed, 8 Jul 2020 02:32:18 -0400 Received: from smtp23.cstnet.cn ([159.226.251.23]:33968 "EHLO cstnet.cn" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726362AbgGHGcS (ORCPT ); Wed, 8 Jul 2020 02:32:18 -0400 Received: from localhost (unknown [159.226.5.99]) by APP-03 (Coremail) with SMTP id rQCowAD3ePioZQVfC8ppAw--.13022S2; Wed, 08 Jul 2020 14:20:24 +0800 (CST) From: Xu Wang To: peterz@infradead.org, mingo@redhat.com, acme@kernel.org, mark.rutland@arm.com, alexander.shishkin@linux.intel.com, jolsa@redhat.com, namhyung@kernel.org, chris@zankel.net, jcmvbkbc@gmail.com, linux-kernel@vger.kernel.org Cc: linux-xtensa@linux-xtensa.org, Xu Wang Subject: [PATCH] kernel: perf_event: use for_each_set_bit() to simplify the code Date: Wed, 8 Jul 2020 06:20:23 +0000 Message-Id: <20200708062023.7986-1-vulab@iscas.ac.cn> X-Mailer: git-send-email 2.17.1 X-CM-TRANSID: rQCowAD3ePioZQVfC8ppAw--.13022S2 X-Coremail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M-SenderInfo: pyxotu46lvutnvoduhdfq/1tbiCAQLA102YQ9nfwAAsZ Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Using for_each_set_bit() to simplify the code. Signed-off-by: Xu Wang --- arch/xtensa/kernel/perf_event.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/arch/xtensa/kernel/perf_event.c b/arch/xtensa/kernel/perf_event.c index 9bae79f70301..99fcd63ce597 100644 --- a/arch/xtensa/kernel/perf_event.c +++ b/arch/xtensa/kernel/perf_event.c @@ -362,9 +362,7 @@ irqreturn_t xtensa_pmu_irq_handler(int irq, void *dev_id) struct xtensa_pmu_events *ev = this_cpu_ptr(&xtensa_pmu_events); unsigned i; - for (i = find_first_bit(ev->used_mask, XCHAL_NUM_PERF_COUNTERS); - i < XCHAL_NUM_PERF_COUNTERS; - i = find_next_bit(ev->used_mask, XCHAL_NUM_PERF_COUNTERS, i + 1)) { + for_each_set_bit(i, ev->used_mask, XCHAL_NUM_PERF_COUNTERS) { uint32_t v = get_er(XTENSA_PMU_PMSTAT(i)); struct perf_event *event = ev->event[i]; struct hw_perf_event *hwc = &event->hw; -- 2.17.1