Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3172983pxb; Mon, 24 Jan 2022 04:11:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJzdtavIBithNZ3xbBTOoHOKm2CIfZ+9pE0CESxKa0RMB9SXE9Wov3bDJ8tq/m6QBVb+aCg5 X-Received: by 2002:a17:902:6ac1:b0:149:7087:7b8a with SMTP id i1-20020a1709026ac100b0014970877b8amr14616159plt.174.1643026286787; Mon, 24 Jan 2022 04:11:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643026286; cv=none; d=google.com; s=arc-20160816; b=pzIparZuO/q1/KHOEfPE0xIx1c0+ScLbvGHth4N4ZLt47SePuchIieM5GIlHAt0LW+ 3XAATwCj8nLXDZWxwXKHisun3jqmMQuJSK3po3bNtHUHPwgRE1V/RKVm149FJBPaph6J aEm1mZjHwN3W+0dPjAhJuzzGa2asFBjLUaCS0WnfG1J1B64IYFv//vOBBnd8kKFi713U gOc0QcPoZDb1jnv/8/BU45eEReP5b0+ikpLsps6xE+KTvErMVbc3kqDVqN/Pexbg/R8r aMd/TkyuK9I6ifPuRp20orLZe8pD5rLktnlqKUKBwtgTliEoeuEjK9K25liBol3dZOwC 1Vqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=6Y67UpGJgCeGI3YjkkCV3h1RWBz0EaSLMoBqw+YNaKM=; b=Vt6egqZv7ppEfcZ13gMVbV32mRwKaFCNkHd7kjrpL86W2fSz5dvdbvEu0PDgxL+hMG ChZl3x0dCNIFPUjxZffiXc/mjJNIoLdMBHX1ed+YWBX5T+n3r1/rpTFSPzzuC2+qoidw M4AkUF01c0nvhSUf1EprAAitvpYwj/xH2oJauSlXtnEKatbwNdfaUa0s+rq8cDG3C1/r YUYaUOIGPkfChzcSPM7Esg3MDWtdkRaBnxWGqqVP1pnTomf5GCsqTpd3CAvsA75CldKO tM/8ZsKRB3XUDQp9YSO4skPGCtN0uW8YZHMEGeKIRkkcgFWcHJaaTazpnSZEC5drHoph kO6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=fj2Be3j4; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l8si15811361pfd.229.2022.01.24.04.11.13; Mon, 24 Jan 2022 04:11:26 -0800 (PST) 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; dkim=pass header.i=@gmail.com header.s=20210112 header.b=fj2Be3j4; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239630AbiAWSkD (ORCPT + 99 others); Sun, 23 Jan 2022 13:40:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53382 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239588AbiAWSj6 (ORCPT ); Sun, 23 Jan 2022 13:39:58 -0500 Received: from mail-pl1-x62b.google.com (mail-pl1-x62b.google.com [IPv6:2607:f8b0:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 47680C06173D; Sun, 23 Jan 2022 10:39:58 -0800 (PST) Received: by mail-pl1-x62b.google.com with SMTP id c9so13468678plg.11; Sun, 23 Jan 2022 10:39:58 -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=6Y67UpGJgCeGI3YjkkCV3h1RWBz0EaSLMoBqw+YNaKM=; b=fj2Be3j4ZXRuOSxn0ZBVfLiLCyC1T7HgxLBl1dbJ+1GQMBP1uFWdWTNbPb+uWf/xrO fEq/nS9cpgMQq4Z/EeGzuaSIb6mOIrZ7LgCI/XoIPnvJf3RsIJv7y1hkMvE+QnCq9zKA JMV8tbR5pot6iHL3EBKW2XXAqJM5+ApGwCvEnj7iWYw02WTqJjO0ci1TnCiThd9Xg445 pcSMonvfQBFpKb5hWyBaJtMySDLtJzDJSIYoXZXdot1LheibM6eHhYHQWrtYShBnp/K+ iwi8TcO5n5tk0ketawzGGBBDDj8oY+p4hunGEj1VW3/rokkCis1vkQfda195htV4ArRP EnQA== 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=6Y67UpGJgCeGI3YjkkCV3h1RWBz0EaSLMoBqw+YNaKM=; b=i4JhkczdiVAZxbJ8/hC6I8OSUtGal6kftEu+QieyBk9lIMir0JiKqkGmS47QamLxjL d1PTX72aJDrGjfcI2t7eqlliwGSEZP5ZBKdTYv8VGwOz4YJAg1fAe6kG+E3K2BjUhl34 HvuBuo/++8dU60Mlc8RxpN3f8AIJV7kyNL/NguW8+Sfx/zBkxDAgB6Qz1S+t+b7XcArI PkgYC629xqLOPEuJEUsw2+m7RMIO5lYciiX9GZN0mvvSmc5CVoK1Qx48/A7upEeQ/Sfp edzkxutQsYlzu0wezb1PmK7Iv/dKhrhhiV8MwhQvHRwxtp63JVrrp1Qp+En5wJk3mM5x LQqA== X-Gm-Message-State: AOAM532JgeIgVfGsW9BTN3PPcCuIhFrcrilQkQquuTcuz/r05gfQwh+h oE7qPyIX/Vj0h3ZHoCzHaIg= X-Received: by 2002:a17:90b:1b0e:: with SMTP id nu14mr9710263pjb.39.1642963197744; Sun, 23 Jan 2022 10:39:57 -0800 (PST) Received: from localhost (searspoint.nvidia.com. [216.228.112.21]) by smtp.gmail.com with ESMTPSA id d8sm9389575pjz.32.2022.01.23.10.39.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 23 Jan 2022 10:39:57 -0800 (PST) From: Yury Norov To: Yury Norov , Andy Shevchenko , Rasmus Villemoes , Andrew Morton , =?UTF-8?q?Micha=C5=82=20Miros=C5=82aw?= , Greg Kroah-Hartman , Peter Zijlstra , David Laight , Joe Perches , Dennis Zhou , Emil Renner Berthing , Nicholas Piggin , Matti Vaittinen , Alexey Klimov , linux-kernel@vger.kernel.org, "Rafael J. Wysocki" , Daniel Lezcano , Amit Kucheria , Zhang Rui , Sebastian Andrzej Siewior , Christophe JAILLET , Rikard Falkeborn , linux-pm@vger.kernel.org Subject: [PATCH 03/54] thermal/intel: don't use bitmap_weight() in end_power_clamp() Date: Sun, 23 Jan 2022 10:38:34 -0800 Message-Id: <20220123183925.1052919-4-yury.norov@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220123183925.1052919-1-yury.norov@gmail.com> References: <20220123183925.1052919-1-yury.norov@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Don't call bitmap_weight() if the following code can get by without it. Signed-off-by: Yury Norov --- drivers/thermal/intel/intel_powerclamp.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/thermal/intel/intel_powerclamp.c b/drivers/thermal/intel/intel_powerclamp.c index 14256421d98c..c841ab37e7c6 100644 --- a/drivers/thermal/intel/intel_powerclamp.c +++ b/drivers/thermal/intel/intel_powerclamp.c @@ -556,12 +556,9 @@ static void end_power_clamp(void) * stop faster. */ clamping = false; - if (bitmap_weight(cpu_clamping_mask, num_possible_cpus())) { - for_each_set_bit(i, cpu_clamping_mask, num_possible_cpus()) { - pr_debug("clamping worker for cpu %d alive, destroy\n", - i); - stop_power_clamp_worker(i); - } + for_each_set_bit(i, cpu_clamping_mask, num_possible_cpus()) { + pr_debug("clamping worker for cpu %d alive, destroy\n", i); + stop_power_clamp_worker(i); } } -- 2.30.2