From patchwork Sat Dec 18 21:19:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yury Norov X-Patchwork-Id: 12686367 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2CFABC4332F for ; Sat, 18 Dec 2021 21:20:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=IMs/GrSsXkv6cmbLke1qKw7FhfVy/BRAKWkf8qFWs+8=; b=I8bZ36rl2hpkBD o9CweI+AuOXqSyouMxu9YPWiOdIou07vDGGjtgCDlIaL/VVJUhSLLFY4qjaT76p1plSEtKBrtWaYx Bjg0emSyyCSU1oEbvYE006LVxpE0rzrEEjB0/F3Qtbof+yQFXVyjMWDU55ZARJHl5fzWGIVFjtBhe KHmhxMJCP21S/D8/U+hx3sREv6R9nC+qeBzWeSrcpPN8Mvxmm/AXUhxLhf7b6C1B/kqYUd1YPEMNY SX85H/ZhZ1vVoEnt4aO8kQEdCGbryX2cLwKMKFCMY7PydI+dBFrsy+CDZKCh8vzuBCuoh5YJVfEJ6 gXQPE21bDG3J/cYMrW5w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1myh84-00EjbW-2t; Sat, 18 Dec 2021 21:20:32 +0000 Received: from mail-oi1-x229.google.com ([2607:f8b0:4864:20::229]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1myh7x-00EjWB-6y; Sat, 18 Dec 2021 21:20:27 +0000 Received: by mail-oi1-x229.google.com with SMTP id bj13so9342142oib.4; Sat, 18 Dec 2021 13:20:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=ZRDbXQndZB+h1W3grije4oLm88mhsLSCo0DvJeL0oOc=; b=RbLh966dNM6Q9dumAKT/s67Li0XDMiqpqy9QDRjKZ7xykviae8HUZGbBK4++gzts9+ 4HWimSnZbbp981RdIy4mUiEPi5KNC27XZMzAqhbLAbSCXpzsa6pdkKTooARlGNlTUTY6 JoyuKChgIL/vGpnEuqm73H3imSDYRcmkvOW7G88lNj2P4DJILBf/LhHA1ZwruMX1IzE2 L/mAlIYrOkdOM5wMkeJ8+xwn6+2dLufPFudFw0L+ol31R0QIHi6gU0asPbGQ0WpcgUYF TKKLWiuHi4Ipvj4eEi1DnTT9o6ibI9n5SLfH6H9ye6clD987ERDreQoQOmClSh/YKHYJ 9wZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ZRDbXQndZB+h1W3grije4oLm88mhsLSCo0DvJeL0oOc=; b=isq5JFdjzc6dhfEikJnGRhcPhtFJu9srk5gRSEqEPteK89lBr8DqXh0R6Zz0yDwvi8 TKuF64+DjqRLhXfzXzKLSP0s/dt+ykSppCC60hTj+VWMRyf1YlEDCOydoXdilVHBi0ED 8F9MJgTxdhjzkTD3hHQ1ckvtcn0Nunshm4ca8KDH/lFrhpcbvAKVTpfqcBwVikhcIXcF vnpgHLKeFgOdXn6SXq8oKJrEC/1HwaKIxCfJ9JBBSxsFf9QCWUwPf6+YbSnNMCBvIV+/ bi1rt9/2SwMez30ycMnrzovTMrt8zL0o+gb4TMmosvrRhyQuKZOZC3PxT9GKZO038/4H VPeg== X-Gm-Message-State: AOAM5327TA6Fsr7XQdeq86DSdFE8Jahu3DCyp9Y9UCqrTbZpcrx7pDzN tvsZo9r/qPcsDSA6pGlNhwM= X-Google-Smtp-Source: ABdhPJxshh8wZNTv7Y9Ku4jyb7QQxFrS/1r/onV0bhXisp6AJbbov2WJDwCGNF7Hkx62Pk9+Bq0Ozw== X-Received: by 2002:a05:6808:159a:: with SMTP id t26mr13219038oiw.106.1639862424104; Sat, 18 Dec 2021 13:20:24 -0800 (PST) Received: from localhost (searspoint.nvidia.com. [216.228.112.21]) by smtp.gmail.com with ESMTPSA id 186sm2409379oig.28.2021.12.18.13.20.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 18 Dec 2021 13:20:23 -0800 (PST) From: Yury Norov To: linux-kernel@vger.kernel.org, Yury Norov , "James E.J. Bottomley" , "Martin K. Petersen" , =?utf-8?b?TWljaGHFgiBN?= =?utf-8?b?aXJvc8WCYXc=?= , "Paul E. McKenney" , "Rafael J. Wysocki" , Alexander Shishkin , Alexey Klimov , Amitkumar Karwar , Andi Kleen , Andrew Lunn , Andrew Morton , Andy Gross , Andy Lutomirski , Andy Shevchenko , Anup Patel , Ard Biesheuvel , Arnaldo Carvalho de Melo , Arnd Bergmann , Borislav Petkov , Catalin Marinas , Christoph Hellwig , Christoph Lameter , Daniel Vetter , Dave Hansen , David Airlie , David Laight , Dennis Zhou , Emil Renner Berthing , Geert Uytterhoeven , Geetha sowjanya , Greg Kroah-Hartman , Guo Ren , Hans de Goede , Heiko Carstens , Ian Rogers , Ingo Molnar , Jakub Kicinski , Jason Wessel , Jens Axboe , Jiri Olsa , Joe Perches , Jonathan Cameron , Juri Lelli , Kees Cook , Krzysztof Kozlowski , Lee Jones , Marc Zyngier , Marcin Wojtas , Mark Gross , Mark Rutland , Matti Vaittinen , Mauro Carvalho Chehab , Mel Gorman , Michael Ellerman , Mike Marciniszyn , Nicholas Piggin , Palmer Dabbelt , Peter Zijlstra , Petr Mladek , Randy Dunlap , Rasmus Villemoes , Russell King , Saeed Mahameed , Sagi Grimberg , Sergey Senozhatsky , Solomon Peachy , Stephen Boyd , Stephen Rothwell , Steven Rostedt , Subbaraya Sundeep , Sudeep Holla , Sunil Goutham , Tariq Toukan , Tejun Heo , Thomas Bogendoerfer , Thomas Gleixner , Ulf Hansson , Vincent Guittot , Vineet Gupta , Viresh Kumar , Vivien Didelot , Vlastimil Babka , Will Deacon , bcm-kernel-feedback-list@broadcom.com, kvm@vger.kernel.org, linux-alpha@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-crypto@vger.kernel.org, linux-csky@vger.kernel.org, linux-ia64@vger.kernel.org, linux-mips@vger.kernel.org, linux-mm@kvack.org, linux-perf-users@vger.kernel.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-snps-arc@lists.infradead.org, linuxppc-dev@lists.ozlabs.org Subject: [PATCH 02/17] drivers: rename num_*_cpus variables Date: Sat, 18 Dec 2021 13:19:58 -0800 Message-Id: <20211218212014.1315894-3-yury.norov@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211218212014.1315894-1-yury.norov@gmail.com> References: <20211218212014.1315894-1-yury.norov@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211218_132025_272287_A72DB566 X-CRM114-Status: GOOD ( 20.36 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Some drivers declare num_active_cpus and num_present_cpus, despite that kernel has macros with corresponding names in linux/cpumask.h, and the drivers include cpumask.h The following patches switch num_*_cpus() to real functions, which causes build failures for the drivers. Signed-off-by: Yury Norov --- drivers/leds/trigger/ledtrig-cpu.c | 6 +++--- drivers/scsi/storvsc_drv.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/leds/trigger/ledtrig-cpu.c b/drivers/leds/trigger/ledtrig-cpu.c index 8af4f9bb9cde..767e9749ca41 100644 --- a/drivers/leds/trigger/ledtrig-cpu.c +++ b/drivers/leds/trigger/ledtrig-cpu.c @@ -39,7 +39,7 @@ struct led_trigger_cpu { static DEFINE_PER_CPU(struct led_trigger_cpu, cpu_trig); static struct led_trigger *trig_cpu_all; -static atomic_t num_active_cpus = ATOMIC_INIT(0); +static atomic_t _active_cpus = ATOMIC_INIT(0); /** * ledtrig_cpu - emit a CPU event as a trigger @@ -79,8 +79,8 @@ void ledtrig_cpu(enum cpu_led_event ledevt) /* Update trigger state */ trig->is_active = is_active; - atomic_add(is_active ? 1 : -1, &num_active_cpus); - active_cpus = atomic_read(&num_active_cpus); + atomic_add(is_active ? 1 : -1, &_active_cpus); + active_cpus = atomic_read(&_active_cpus); total_cpus = num_present_cpus(); led_trigger_event(trig->_trig, diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c index 20595c0ba0ae..705dd4ebde98 100644 --- a/drivers/scsi/storvsc_drv.c +++ b/drivers/scsi/storvsc_drv.c @@ -1950,7 +1950,7 @@ static int storvsc_probe(struct hv_device *device, { int ret; int num_cpus = num_online_cpus(); - int num_present_cpus = num_present_cpus(); + int present_cpus = num_present_cpus(); struct Scsi_Host *host; struct hv_host_device *host_dev; bool dev_is_ide = ((dev_id->driver_data == IDE_GUID) ? true : false); @@ -2060,7 +2060,7 @@ static int storvsc_probe(struct hv_device *device, * Set the number of HW queues we are supporting. */ if (!dev_is_ide) { - if (storvsc_max_hw_queues > num_present_cpus) { + if (storvsc_max_hw_queues > present_cpus) { storvsc_max_hw_queues = 0; storvsc_log(device, STORVSC_LOGGING_WARN, "Resetting invalid storvsc_max_hw_queues value to default.\n"); @@ -2068,7 +2068,7 @@ static int storvsc_probe(struct hv_device *device, if (storvsc_max_hw_queues) host->nr_hw_queues = storvsc_max_hw_queues; else - host->nr_hw_queues = num_present_cpus; + host->nr_hw_queues = present_cpus; } /*