Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752488AbbGWIPz (ORCPT ); Thu, 23 Jul 2015 04:15:55 -0400 Received: from mail-pd0-f170.google.com ([209.85.192.170]:36630 "EHLO mail-pd0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752176AbbGWINj (ORCPT ); Thu, 23 Jul 2015 04:13:39 -0400 From: Viresh Kumar To: Rafael Wysocki Cc: linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, linux@arm.linux.org.uk, Viresh Kumar , linux-kernel@vger.kernel.org (open list) Subject: [PATCH 3/3] cpufreq: use cpumask_test_and_clear_cpu() instead of separate routines Date: Thu, 23 Jul 2015 13:43:20 +0530 Message-Id: X-Mailer: git-send-email 2.4.0 In-Reply-To: References: <20150723060938.GD5322@linux> In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1159 Lines: 32 We need to clear cpumask only if the relevant cpu is set and we could have used cpumask_test_and_clear_cpu() and set instead. Signed-off-by: Viresh Kumar --- drivers/cpufreq/cpufreq.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index d01cad993fa7..b223c9c5296b 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -1498,10 +1498,9 @@ static int cpufreq_remove_dev(struct device *dev, struct subsys_interface *sif) } /* sysfs links are removed only on subsys callback */ - if (cpumask_test_cpu(cpu, policy->linked_cpus)) { + if (cpumask_test_and_clear_cpu(cpu, policy->linked_cpus)) { dev_dbg(dev, "%s: Removing symlink for CPU: %u\n", __func__, cpu); - cpumask_clear_cpu(cpu, policy->linked_cpus); sysfs_remove_link(&dev->kobj, "cpufreq"); return 0; } -- 2.4.0 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/