From patchwork Fri Oct 1 18:12:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yury Norov X-Patchwork-Id: 12531495 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 59D2CC43217 for ; Fri, 1 Oct 2021 18:13:26 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 10BDD6127B for ; Fri, 1 Oct 2021 18:13:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 10BDD6127B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id ABD7B940134; Fri, 1 Oct 2021 14:13:25 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A96CD940121; Fri, 1 Oct 2021 14:13:25 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 93791940134; Fri, 1 Oct 2021 14:13:25 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0031.hostedemail.com [216.40.44.31]) by kanga.kvack.org (Postfix) with ESMTP id 7FFB1940121 for ; Fri, 1 Oct 2021 14:13:25 -0400 (EDT) Received: from smtpin01.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 410402DD88 for ; Fri, 1 Oct 2021 18:13:25 +0000 (UTC) X-FDA: 78648665970.01.7CBCB16 Received: from mail-pj1-f45.google.com (mail-pj1-f45.google.com [209.85.216.45]) by imf01.hostedemail.com (Postfix) with ESMTP id 07848506C0B1 for ; Fri, 1 Oct 2021 18:13:24 +0000 (UTC) Received: by mail-pj1-f45.google.com with SMTP id d4-20020a17090ad98400b0019ece228690so9911870pjv.5 for ; Fri, 01 Oct 2021 11:13:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=wFgxHPU246K2Qd2iZ9FPnjvlT4kP2xuwZmDeybJhhzg=; b=T2zhwhB9K6R7SedoFslKKTZ7LLLq8eZr8oMfYNJDe9O/mXF7WWBKZWqW6zTKquVebu iG18bYtHlHHcY9dJe9+XZZ2Md81GwD1kwEII1b0dVMkz6JUde7tqxO/LPo8auXNrLR+J v4J9SnjG89rD/X2LxEaCUP8NmoKzMF2CsKzavQ203nU+gHs6nfYqumJjSzIM+uuQlHxL TZlgyRqPPsu5NPyxvXMhnVL1r/R/54fs/2QqYDo5ZFhWfuMQlgrhmS1avLDYmtGrS5PK uMI8ITzFgke4yXz8OyW7cx74gol2yFCDp5K5cx7YnPP7zQLPkDWF6cdyeKUPx9KZJeHT l9iw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=wFgxHPU246K2Qd2iZ9FPnjvlT4kP2xuwZmDeybJhhzg=; b=GmFe83BucbXnnKmgF9r00dXqjZ50qq8fbEBSR0DYdxb+GZiqbdlFt8k3FQJVHm7Vmq RXTQaQzaVU5xWbXaF0+1QNKo17gvxSCKad+jpjLOl+BHkWn+bPlZj072K9rbaXFYZnBq GH5bvbUbwlqlbtMk1hRFxRR+CcAtNOR60YdNEZ+zwSEOrdSmmPutVkxknB2lVKeqiWQW t5UKNIrVld8DJVZ87xqxsrgyXqOrp5Gcz7bOYOLUpXFK+kmiy66Xc6XlRDzr97RW3bwR 2ST/tADIt/j/whcLtrWAX1UQM0Xr3rhSqlLYDKGmC/fGYhmf5/hdv9Mu3hCphNkSi5n6 ZYEQ== X-Gm-Message-State: AOAM531smJRrTwyXu7WWnIL+bW3baOJf+vNeapS7UZvFyA/yABa91AEG qCziSdmcTJpLgoNw5At8evw= X-Google-Smtp-Source: ABdhPJx0l5BNpaKYGf/r+3clTC2zeNNmiewC269WkGG3+l+/3RPbcoBeURqLI7p13R92d/BAODuiHw== X-Received: by 2002:a17:902:8495:b0:13e:6a01:f5fb with SMTP id c21-20020a170902849500b0013e6a01f5fbmr10299202plo.61.1633112003940; Fri, 01 Oct 2021 11:13:23 -0700 (PDT) Received: from localhost (searspoint.nvidia.com. [216.228.112.21]) by smtp.gmail.com with ESMTPSA id x20sm6319609pjp.48.2021.10.01.11.13.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Oct 2021 11:13:23 -0700 (PDT) From: Yury Norov To: Stephen Rothwell Cc: Yury Norov , Andrew Morton , linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-arch@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-mmc@vger.kernel.org, linux-perf-users@vger.kernel.org, kvm@vger.kernel.org, "James E.J. Bottomley" , Alexander Lobakin , Alexander Shishkin , Alexey Klimov , Andrea Merello , Andy Shevchenko , Arnaldo Carvalho de Melo , Arnd Bergmann , Ben Gardon , Benjamin Herrenschmidt , Brian Cain , Catalin Marinas , Christoph Lameter , Daniel Bristot de Oliveira , David Hildenbrand , Dennis Zhou , Geert Uytterhoeven , Heiko Carstens , Ian Rogers , Ingo Molnar , Jaegeuk Kim , Jakub Kicinski , Jiri Olsa , Joe Perches , Jonas Bonn , Leo Yan , Mark Rutland , Namhyung Kim , Palmer Dabbelt , Paolo Bonzini , Peter Xu , Peter Zijlstra , Petr Mladek , Rasmus Villemoes , Rich Felker , Samuel Mendoza-Jonas , Sean Christopherson , Sergey Senozhatsky , Shuah Khan , Stefan Kristiansson , Steven Rostedt , Tejun Heo , Thomas Bogendoerfer , Ulf Hansson , Will Deacon , Wolfram Sang , Yoshinori Sato Subject: [PATCH 12/16] Replace for_each_*_bit_from() with for_each_*_bit() where appropriate Date: Fri, 1 Oct 2021 11:12:41 -0700 Message-Id: <20211001181245.228419-13-yury.norov@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211001181245.228419-1-yury.norov@gmail.com> References: <20211001181245.228419-1-yury.norov@gmail.com> MIME-Version: 1.0 X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 07848506C0B1 X-Stat-Signature: dyy45oaykwsr7qignar7uf4bt4ku6tq9 Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=T2zhwhB9; spf=pass (imf01.hostedemail.com: domain of yury.norov@gmail.com designates 209.85.216.45 as permitted sender) smtp.mailfrom=yury.norov@gmail.com; dmarc=pass (policy=none) header.from=gmail.com X-HE-Tag: 1633112004-200934 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: A couple of kernel functions call for_each_*_bit_from() with start bit equal to 0. Replace them with for_each_*_bit(). No functional changes, but might improve on readability. Signed-off-by: Yury Norov Tested-by: Wolfram Sang --- arch/x86/kernel/apic/vector.c | 4 ++-- drivers/gpu/drm/etnaviv/etnaviv_gpu.c | 4 ++-- drivers/hwmon/ltc2992.c | 3 +-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/arch/x86/kernel/apic/vector.c b/arch/x86/kernel/apic/vector.c index c132daabe615..3e6f6b448f6a 100644 --- a/arch/x86/kernel/apic/vector.c +++ b/arch/x86/kernel/apic/vector.c @@ -760,9 +760,9 @@ void __init lapic_update_legacy_vectors(void) void __init lapic_assign_system_vectors(void) { - unsigned int i, vector = 0; + unsigned int i, vector; - for_each_set_bit_from(vector, system_vectors, NR_VECTORS) + for_each_set_bit(vector, system_vectors, NR_VECTORS) irq_matrix_assign_system(vector_matrix, vector, false); if (nr_legacy_irqs() > 1) diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c index cc5b07f86346..789acae37f55 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c @@ -1047,7 +1047,7 @@ int etnaviv_gpu_debugfs(struct etnaviv_gpu *gpu, struct seq_file *m) void etnaviv_gpu_recover_hang(struct etnaviv_gpu *gpu) { - unsigned int i = 0; + unsigned int i; dev_err(gpu->dev, "recover hung GPU!\n"); @@ -1060,7 +1060,7 @@ void etnaviv_gpu_recover_hang(struct etnaviv_gpu *gpu) /* complete all events, the GPU won't do it after the reset */ spin_lock(&gpu->event_spinlock); - for_each_set_bit_from(i, gpu->event_bitmap, ETNA_NR_EVENTS) + for_each_set_bit(i, gpu->event_bitmap, ETNA_NR_EVENTS) complete(&gpu->event_free); bitmap_zero(gpu->event_bitmap, ETNA_NR_EVENTS); spin_unlock(&gpu->event_spinlock); diff --git a/drivers/hwmon/ltc2992.c b/drivers/hwmon/ltc2992.c index 2a4bed0ab226..7352d2b3c756 100644 --- a/drivers/hwmon/ltc2992.c +++ b/drivers/hwmon/ltc2992.c @@ -248,8 +248,7 @@ static int ltc2992_gpio_get_multiple(struct gpio_chip *chip, unsigned long *mask gpio_status = reg; - gpio_nr = 0; - for_each_set_bit_from(gpio_nr, mask, LTC2992_GPIO_NR) { + for_each_set_bit(gpio_nr, mask, LTC2992_GPIO_NR) { if (test_bit(LTC2992_GPIO_BIT(gpio_nr), &gpio_status)) set_bit(gpio_nr, bits); }