From patchwork Mon Jul 9 16:11:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 10515169 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 A72DD604D4 for ; Mon, 9 Jul 2018 16:11:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 95F4C28790 for ; Mon, 9 Jul 2018 16:11:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 89E24289CB; Mon, 9 Jul 2018 16:11:45 +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 4B12628B13 for ; Mon, 9 Jul 2018 16:11:45 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id AC7DB6E51C; Mon, 9 Jul 2018 16:11:44 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-ed1-x543.google.com (mail-ed1-x543.google.com [IPv6:2a00:1450:4864:20::543]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6D4796E521 for ; Mon, 9 Jul 2018 16:11:43 +0000 (UTC) Received: by mail-ed1-x543.google.com with SMTP id d17-v6so2289790eds.11 for ; Mon, 09 Jul 2018 09:11:43 -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=3X9JFFs1YGW+QQRwFTsTnOJ4GgEVhsAf6HK9Pv7S2S8=; b=M55N/8lbZnubYLxfVU5xyogGRkPvgLxQDoVkoUvdYk8xNMq72XlB0/0jEJmYeye1uJ L8xEfFGVhd70KIWpgsPCKlQFnZQC/vUWkiSR9XEEt4437tXrgyoXW2d1eJn3UhcXEw+/ iiGmqVpKPwvNP+2wPsloX4bDbsrdJ/E3Ms0Z0A0Ntbc0TPAALKCb61uK37YWIaGM1zow TZjceO1Th5oqGtaIqNRG39Jnv3QM0nylKWRKPkl/SJQtZGbV10HJKnR+riQN6p1ynhdl xR9yIAh9WNWerJ+Y3ZhGbb0+BpTU8hAmLM5EhxkbXYFlLEaOSLz54ir9nxcGauzwVrdO VmaA== X-Gm-Message-State: APt69E1fyxNh9YciZk1oMH5ptO3w0U7mLbX6N1tgIPaPA67s/zPyV5Ha xfIXKrsuUFJbZ7Bw4oofICvKPQ== X-Google-Smtp-Source: AAOMgpeH0zEbBBcRCKg9sZb1QKJgO+OyVWrc4SRAzGoDstDanHiy8psAxktZIDbw9kUUHMowho/0GQ== X-Received: by 2002:a50:89aa:: with SMTP id g39-v6mr22006389edg.25.1531152702120; Mon, 09 Jul 2018 09:11:42 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:5628:0:496f:7dc5:66d7:a057]) by smtp.gmail.com with ESMTPSA id i89-v6sm7191441edi.10.2018.07.09.09.11.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Jul 2018 09:11:41 -0700 (PDT) From: Daniel Vetter To: LKML Date: Mon, 9 Jul 2018 18:11:29 +0200 Message-Id: <20180709161129.28425-1-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180709083650.23549-4-daniel.vetter@ffwll.ch> References: <20180709083650.23549-4-daniel.vetter@ffwll.ch> Subject: [Intel-gfx] [PATCH] 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 , Eric Engestrom , 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 Cc: Eric Engestrom Acked-by: Rafael J. Wysocki --- v2: Fix the logic fumble in the 2nd hunk, spotted by Eric. --- 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..3a774f523d00 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,