From patchwork Thu Jul 23 08:13:20 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 51386 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f69.google.com (mail-la0-f69.google.com [209.85.215.69]) by patches.linaro.org (Postfix) with ESMTPS id 0B31A22A9E for ; Thu, 23 Jul 2015 08:16:10 +0000 (UTC) Received: by lafd3 with SMTP id d3sf65866172laf.1 for ; Thu, 23 Jul 2015 01:16:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:in-reply-to:references :sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=lWdA88MVex6OGIdfy9PR6qU90bAEsmZB0GQTOyV+38A=; b=HzDWiY7bK6ezMrsNPJYY8kOmTTYtg1YPCoxoS9R1DBZJdPmLfUrK/VK48uuNh0Eqwr /5nYIwzTOapWYJFF+bqGoD6auTQyBKDLv1B+jmHIV0m0AlvwWYR9n7lXQuQfZAanrrAe RaFY7n/M45OYLJhaCmZEA0vL7btkNFuT4xmNj5KC2r8jpllF0g3D6jnbK+YUFFXiFfLN ko8FxakKSpN8cVH48ytvm0cKRgk7mzFXWr82zxr0Z7fvS3wrF9CiAcZFcRDJg3dummrV 0Bvfw/Ugc9QRuwCmmx81FS1gnCrDwNqHmXYdU27mCgHRqBYyTLr2fCEwEK2suSJaaGNM KsxA== X-Gm-Message-State: ALoCoQlXVNTrETBXrNEBsRsbGfu3cpCNWCxXiqqH/WYFr+2npLSFBunO5AuEgDxxr4mL+khKrvpM X-Received: by 10.113.11.3 with SMTP id ee3mr3220596lbd.9.1437639368971; Thu, 23 Jul 2015 01:16:08 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.37.105 with SMTP id x9ls203982laj.11.gmail; Thu, 23 Jul 2015 01:16:08 -0700 (PDT) X-Received: by 10.112.172.4 with SMTP id ay4mr6524043lbc.124.1437639368792; Thu, 23 Jul 2015 01:16:08 -0700 (PDT) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com. [209.85.217.182]) by mx.google.com with ESMTPS id jc5si3450627lbc.127.2015.07.23.01.16.08 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Jul 2015 01:16:08 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.182 as permitted sender) client-ip=209.85.217.182; Received: by lbbzr7 with SMTP id zr7so152465986lbb.1 for ; Thu, 23 Jul 2015 01:16:08 -0700 (PDT) X-Received: by 10.112.120.134 with SMTP id lc6mr6427314lbb.86.1437639368302; Thu, 23 Jul 2015 01:16:08 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.7.198 with SMTP id l6csp400627lba; Thu, 23 Jul 2015 01:16:07 -0700 (PDT) X-Received: by 10.70.30.161 with SMTP id t1mr16131284pdh.138.1437639364869; Thu, 23 Jul 2015 01:16:04 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id kc7si10140465pad.145.2015.07.23.01.16.03; Thu, 23 Jul 2015 01:16:04 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752490AbbGWIPz (ORCPT + 28 others); 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 Received: by pdjr16 with SMTP id r16so156025823pdj.3 for ; Thu, 23 Jul 2015 01:13:38 -0700 (PDT) X-Received: by 10.66.141.42 with SMTP id rl10mr15681363pab.25.1437639218526; Thu, 23 Jul 2015 01:13:38 -0700 (PDT) Received: from localhost ([122.171.186.190]) by smtp.gmail.com with ESMTPSA id p9sm7301386pds.92.2015.07.23.01.13.37 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 23 Jul 2015 01:13:38 -0700 (PDT) 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 Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: viresh.kumar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.182 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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; }