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: 10513893 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 6D1CC600CA for ; Mon, 9 Jul 2018 08:37:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C158E286F8 for ; Mon, 9 Jul 2018 08:37:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B532E28754; Mon, 9 Jul 2018 08:37:13 +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=-5.2 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 76BFB286F8 for ; Mon, 9 Jul 2018 08:37:13 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1B59C6E3E2; Mon, 9 Jul 2018 08:37:06 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-ed1-x544.google.com (mail-ed1-x544.google.com [IPv6:2a00:1450:4864:20::544]) by gabe.freedesktop.org (Postfix) with ESMTPS id 688F66E3DE for ; Mon, 9 Jul 2018 08:37:03 +0000 (UTC) Received: by mail-ed1-x544.google.com with SMTP id v22-v6so13271812edq.4 for ; Mon, 09 Jul 2018 01:37:03 -0700 (PDT) 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=eVX24zHZ4QMqULa0CGRo5HaylwDtUBYm5P0m9gJb5OvVm0yAlYtMnWGd7iFb7XjyWl 1GeTzup/uTze9ZnB243ydm9g3ViY+4/b3wqf1EspvyUitwe2b2goHuBvoeHXyfhIzv6I Q9v3J4ALb4flvahpee68OK/niJvY06+FCeha9PpXvKgyM0TZaYTDR0KCQH1MPNUpD5vr bkKSeP07wMG6W+q8CMNeTxFzN/J445GaUXdtjD7ATgAE6OHDI8GYZC/yqx9vtlcZzvp2 9CYxs1tPgDPgfz/NmuObWoqYzzJpDHB9N5ZjLWDC/6vr7O11+2bEOi6GjARP+JCckl8J aYew== X-Gm-Message-State: APt69E2b/9Q5Nj9NRgHrzNsSwcxShdECLCF1GcVxTsQ8cxybI3PaA4gY efXA5Jk5QQEPm5XYOvPZUwy0IQ== 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 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> Subject: [Intel-gfx] [PATCH 04/12] cpufreq: use for_each_if X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-pm@vger.kernel.org, Daniel Vetter , Intel Graphics Development , "Rafael J. Wysocki" , DRI Development , Viresh Kumar , Daniel Vetter MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" 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,