From patchwork Mon Jul 9 08:36:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 10514047 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id BFE8D603D7 for ; Mon, 9 Jul 2018 08:44:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ACE13288E5 for ; Mon, 9 Jul 2018 08:44:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A0B9428A5C; Mon, 9 Jul 2018 08:44:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4F85A288E5 for ; Mon, 9 Jul 2018 08:44:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932494AbeGIIoZ (ORCPT ); Mon, 9 Jul 2018 04:44:25 -0400 Received: from mail-ed1-f65.google.com ([209.85.208.65]:39208 "EHLO mail-ed1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754520AbeGIIhC (ORCPT ); Mon, 9 Jul 2018 04:37:02 -0400 Received: by mail-ed1-f65.google.com with SMTP id w14-v6so13273318eds.6 for ; Mon, 09 Jul 2018 01:37:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=zXtsumn5SIyhpMp7CSWqD0jPr1yatINHJtRo7XapFQg=; b=atYrFlO+YUtRBqhz46HLUWgFYEtx28erU11aJl7DfnYTW05HeVvgAbehlAklrUr/PW FXM1X59xpdFLp12A9gNehwLi1RyluI/vVMIgYszmSZYgOZJ1imL68s/cp8EDxb3SxAb2 DZFLO3lSXfWLvhHAE6bMRrYetjCO2uRQKI5Lc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=zXtsumn5SIyhpMp7CSWqD0jPr1yatINHJtRo7XapFQg=; b=t2NqE1o9KECC3QcBv6q5hc17DYzwn6YoeHx7JDVRHiQBESV5gRuZYDrY9szGWpG/uS 4si1fwAaF7cZPXPf/pEWyDPdlXdBrSsIiYPVJoQeP44gxH4jrNwUoX1Jm+Byhr0+wnxq KVRBM154NaQZpiR6HsN8kGv0pbYeGwDBAaJ4AS1Tfg4IktW1S5bAoxYuC+izCtEJnytS cqhBr5toBaCfaB7Ecc1z/IrfU9nsJXMdVElHNxyuYuMG9F20o1+hhhYzbgqqoo67D/rK U6w+lsBkkOkompYF/QfWfZ4nPejkGk5+rvrzydzNb86n7GcawIS3QCoHP11BGU+plzNp inrQ== X-Gm-Message-State: APt69E052MmACdGauW1WsvBkwSciUU3LrVyRtZ/NysGza0QrW4d5Mssu OWCF4b9shzczoHZwHBELDaw/Gg== X-Google-Smtp-Source: AAOMgpd6I1GgI8Fk3dQAUYjJcFFqyVuO0VJM84t+IT2B6tbb1EtGmvAlm5UhYA9O7a3zOuRA6kfXZw== X-Received: by 2002:a50:8367:: with SMTP id 94-v6mr20868034edh.5.1531125421446; Mon, 09 Jul 2018 01:37:01 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:5628:0:496f:7dc5:66d7:a057]) by smtp.gmail.com with ESMTPSA id 8-v6sm340067edv.77.2018.07.09.01.37.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Jul 2018 01:37:00 -0700 (PDT) From: Daniel Vetter To: LKML Cc: DRI Development , Intel Graphics Development , Daniel Vetter , Daniel Vetter , "Rafael J. Wysocki" , Viresh Kumar , linux-pm@vger.kernel.org Subject: [PATCH 04/12] cpufreq: use for_each_if Date: Mon, 9 Jul 2018 10:36:42 +0200 Message-Id: <20180709083650.23549-4-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180709083650.23549-1-daniel.vetter@ffwll.ch> References: <20180709083650.23549-1-daniel.vetter@ffwll.ch> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Avoids the inverted condition compared to the open coded version. Signed-off-by: Daniel Vetter Cc: "Rafael J. Wysocki" Cc: Viresh Kumar Cc: linux-pm@vger.kernel.org --- include/linux/cpufreq.h | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index 882a9b9e34bc..f2028c229b96 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h @@ -649,9 +649,7 @@ static inline void dev_pm_opp_free_cpufreq_table(struct device *dev, #define cpufreq_for_each_valid_entry(pos, table) \ for (pos = table; pos->frequency != CPUFREQ_TABLE_END; pos++) \ - if (pos->frequency == CPUFREQ_ENTRY_INVALID) \ - continue; \ - else + for_each_if (pos->frequency != CPUFREQ_ENTRY_INVALID) /* * cpufreq_for_each_valid_entry_idx - iterate with index over a cpufreq @@ -663,9 +661,7 @@ static inline void dev_pm_opp_free_cpufreq_table(struct device *dev, #define cpufreq_for_each_valid_entry_idx(pos, table, idx) \ cpufreq_for_each_entry_idx(pos, table, idx) \ - if (pos->frequency == CPUFREQ_ENTRY_INVALID) \ - continue; \ - else + for_each_if (pos->frequency == CPUFREQ_ENTRY_INVALID) int cpufreq_frequency_table_cpuinfo(struct cpufreq_policy *policy,