All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel.vetter@ffwll.ch>
To: LKML <linux-kernel@vger.kernel.org>
Cc: DRI Development <dri-devel@lists.freedesktop.org>,
	Intel Graphics Development <intel-gfx@lists.freedesktop.org>,
	Daniel Vetter <daniel.vetter@ffwll.ch>,
	Daniel Vetter <daniel.vetter@intel.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Michal Hocko <mhocko@suse.com>, Vlastimil Babka <vbabka@suse.cz>,
	Mel Gorman <mgorman@techsingularity.net>,
	David Rientjes <rientjes@google.com>,
	Kemi Wang <kemi.wang@intel.com>,
	Pavel Tatashin <pasha.tatashin@oracle.com>,
	Petr Tesarik <ptesarik@suse.com>,
	YASUAKI ISHIMATSU <yasu.isimatu@gmail.com>,
	Andrey Ryabinin <aryabinin@virtuozzo.com>,
	Nikolay Borisov <nborisov@suse.com>,
	linux-mm@kvack.org
Subject: [PATCH 06/12] mm: use for_each_if
Date: Mon,  9 Jul 2018 10:36:44 +0200	[thread overview]
Message-ID: <20180709083650.23549-6-daniel.vetter@ffwll.ch> (raw)
In-Reply-To: <20180709083650.23549-1-daniel.vetter@ffwll.ch>

Avoids the inverted condition of the open-coded version.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Mel Gorman <mgorman@techsingularity.net>
Cc: David Rientjes <rientjes@google.com>
Cc: Kemi Wang <kemi.wang@intel.com>
Cc: Pavel Tatashin <pasha.tatashin@oracle.com>
Cc: Petr Tesarik <ptesarik@suse.com>
Cc: YASUAKI ISHIMATSU <yasu.isimatu@gmail.com>
Cc: Andrey Ryabinin <aryabinin@virtuozzo.com>
Cc: Nikolay Borisov <nborisov@suse.com>
Cc: linux-mm@kvack.org
---
 include/linux/mmzone.h | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index 32699b2dc52a..1bd5f4c72c8b 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -940,9 +940,7 @@ extern struct zone *next_zone(struct zone *zone);
 	for (zone = (first_online_pgdat())->node_zones; \
 	     zone;					\
 	     zone = next_zone(zone))			\
-		if (!populated_zone(zone))		\
-			; /* do nothing */		\
-		else
+		for_each_if (populated_zone(zone))
 
 static inline struct zone *zonelist_zone(struct zoneref *zoneref)
 {
-- 
2.18.0


WARNING: multiple messages have this Message-ID (diff)
From: Daniel Vetter <daniel.vetter@ffwll.ch>
To: LKML <linux-kernel@vger.kernel.org>
Cc: Michal Hocko <mhocko@suse.com>, Petr Tesarik <ptesarik@suse.com>,
	Nikolay Borisov <nborisov@suse.com>,
	Daniel Vetter <daniel.vetter@ffwll.ch>,
	Intel Graphics Development <intel-gfx@lists.freedesktop.org>,
	Kemi Wang <kemi.wang@intel.com>,
	Pavel Tatashin <pasha.tatashin@oracle.com>,
	DRI Development <dri-devel@lists.freedesktop.org>,
	YASUAKI ISHIMATSU <yasu.isimatu@gmail.com>,
	linux-mm@kvack.org, Andrey Ryabinin <aryabinin@virtuozzo.com>,
	David Rientjes <rientjes@google.com>,
	Daniel Vetter <daniel.vetter@intel.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Mel Gorman <mgorman@techsingularity.net>,
	Vlastimil Babka <vbabka@suse.cz>
Subject: [PATCH 06/12] mm: use for_each_if
Date: Mon,  9 Jul 2018 10:36:44 +0200	[thread overview]
Message-ID: <20180709083650.23549-6-daniel.vetter@ffwll.ch> (raw)
In-Reply-To: <20180709083650.23549-1-daniel.vetter@ffwll.ch>

Avoids the inverted condition of the open-coded version.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Mel Gorman <mgorman@techsingularity.net>
Cc: David Rientjes <rientjes@google.com>
Cc: Kemi Wang <kemi.wang@intel.com>
Cc: Pavel Tatashin <pasha.tatashin@oracle.com>
Cc: Petr Tesarik <ptesarik@suse.com>
Cc: YASUAKI ISHIMATSU <yasu.isimatu@gmail.com>
Cc: Andrey Ryabinin <aryabinin@virtuozzo.com>
Cc: Nikolay Borisov <nborisov@suse.com>
Cc: linux-mm@kvack.org
---
 include/linux/mmzone.h | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index 32699b2dc52a..1bd5f4c72c8b 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -940,9 +940,7 @@ extern struct zone *next_zone(struct zone *zone);
 	for (zone = (first_online_pgdat())->node_zones; \
 	     zone;					\
 	     zone = next_zone(zone))			\
-		if (!populated_zone(zone))		\
-			; /* do nothing */		\
-		else
+		for_each_if (populated_zone(zone))
 
 static inline struct zone *zonelist_zone(struct zoneref *zoneref)
 {
-- 
2.18.0

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2018-07-09  8:43 UTC|newest]

Thread overview: 104+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-09  8:36 [PATCH 01/12] kernel.h: Add for_each_if() Daniel Vetter
2018-07-09  8:36 ` Daniel Vetter
2018-07-09  8:36 ` [PATCH 02/12] blk: use for_each_if Daniel Vetter
2018-07-09  8:36   ` Daniel Vetter
2018-07-11 16:40   ` Tejun Heo
2018-07-11 16:45     ` Tejun Heo
2018-07-11 18:30       ` Jens Axboe
2018-07-11 18:30         ` Jens Axboe
2018-07-11 18:50         ` Daniel Vetter
2018-07-11 19:31           ` Jens Axboe
2018-07-11 19:31             ` Jens Axboe
2018-07-11 20:06             ` Tejun Heo
2018-07-11 21:08               ` Daniel Vetter
2018-07-11 21:08                 ` Daniel Vetter
2018-07-11 21:13                 ` Jens Axboe
2018-07-11 21:13                   ` Jens Axboe
2018-07-12  6:41                   ` Daniel Vetter
2018-07-12  6:41                     ` Daniel Vetter
2018-07-12  6:45           ` Joe Perches
2018-07-12 13:54             ` Jens Axboe
2018-07-12 15:32               ` Joe Perches
2018-07-12 15:32                 ` Joe Perches
2018-07-13  9:28             ` Vlastimil Babka
2018-07-13  9:28               ` Vlastimil Babka
2018-07-09  8:36 ` [PATCH 03/12] cgroup: " Daniel Vetter
2018-07-09  8:36   ` Daniel Vetter
2018-07-11 16:46   ` Tejun Heo
2018-07-11 16:46     ` Tejun Heo
2018-07-09  8:36 ` [PATCH 04/12] cpufreq: " Daniel Vetter
2018-07-09  9:28   ` Eric Engestrom
2018-07-09  9:28     ` Eric Engestrom
2018-07-09 16:11   ` [PATCH] " Daniel Vetter
2018-07-09 16:11     ` Daniel Vetter
2018-07-09 21:36     ` Rafael J. Wysocki
2018-07-09 21:36       ` Rafael J. Wysocki
2018-07-09  8:36 ` [PATCH 05/12] dmar: Use for_each_If Daniel Vetter
2018-07-09  8:36   ` Daniel Vetter
2018-07-20 12:50   ` Joerg Roedel
2018-07-20 12:50     ` Joerg Roedel
2018-07-09  8:36 ` Daniel Vetter [this message]
2018-07-09  8:36   ` [PATCH 06/12] mm: use for_each_if Daniel Vetter
2018-07-09 18:00   ` Pavel Tatashin
2018-07-09  8:36 ` [PATCH 07/12] ide: " Daniel Vetter
2018-07-09  8:36 ` [PATCH 08/12] netdev: " Daniel Vetter
2018-07-09  8:36   ` Daniel Vetter
2018-07-09  8:36 ` [PATCH 09/12] nubus: " Daniel Vetter
2018-07-09  8:36   ` Daniel Vetter
2018-07-09 10:17   ` Finn Thain
2018-07-17 15:26   ` Geert Uytterhoeven
2018-07-09  8:36 ` [PATCH 10/12] pci: " Daniel Vetter
2018-07-09  8:36   ` Daniel Vetter
2018-07-09 22:48   ` Bjorn Helgaas
2018-07-09 22:48     ` Bjorn Helgaas
2018-07-09  8:36 ` [PATCH 11/12] sched: use for_each_if in topology.h Daniel Vetter
2018-07-09  8:36   ` Daniel Vetter
2018-07-09 10:36   ` Peter Zijlstra
2018-07-09 10:36     ` Peter Zijlstra
2018-07-09 15:00     ` Daniel Vetter
2018-07-09 15:00       ` Daniel Vetter
2018-07-09 15:12       ` Peter Zijlstra
2018-07-09 15:12         ` Peter Zijlstra
2018-07-09 15:52         ` Daniel Vetter
2018-07-09 15:52           ` Daniel Vetter
2018-07-09 16:03           ` Peter Zijlstra
2018-07-09 16:06             ` Daniel Vetter
2018-07-09 16:06               ` Daniel Vetter
2018-07-09 16:12             ` Mark Rutland
2018-07-09 17:55               ` [Intel-gfx] " Daniel Vetter
2018-07-09 17:55                 ` Daniel Vetter
2018-07-11 16:51                 ` [Intel-gfx] " Mark Rutland
2018-07-09 16:30           ` Peter Zijlstra
2018-07-09 16:30             ` Peter Zijlstra
2018-07-09  8:36 ` [PATCH 12/12] usb: use for_each_if Daniel Vetter
2018-07-09  8:36   ` Daniel Vetter
2018-07-09  8:36   ` [12/12] " Daniel Vetter
2018-07-09  8:50 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [01/12] kernel.h: Add for_each_if() Patchwork
2018-07-09  9:06 ` ✗ Fi.CI.BAT: failure " Patchwork
2018-07-09 11:50 ` [PATCH 01/12] " Andy Shevchenko
2018-07-09 11:50   ` Andy Shevchenko
2018-07-09 16:25 ` [PATCH] " Daniel Vetter
2018-07-09 16:25   ` Daniel Vetter
2018-07-09 18:30   ` Andy Shevchenko
2018-07-09 18:30     ` Andy Shevchenko
2018-07-09 23:30   ` Andrew Morton
2018-07-10  7:53     ` Daniel Vetter
2018-07-10  7:53       ` Daniel Vetter
2018-07-10 10:32       ` NeilBrown
2018-07-10 10:32         ` NeilBrown
2018-07-11 11:51         ` Daniel Vetter
2018-07-11 11:51           ` Daniel Vetter
2018-07-11 23:05           ` Andrew Morton
2018-07-11 23:05             ` Andrew Morton
2018-07-12  6:39             ` Daniel Vetter
2018-07-12  6:39               ` Daniel Vetter
2018-07-13 23:37             ` NeilBrown
2018-07-13 23:42               ` Randy Dunlap
2018-07-13 23:42                 ` Randy Dunlap
2018-07-16  8:11                 ` Andy Shevchenko
2018-07-16 15:41                   ` Randy Dunlap
2018-07-16 15:41                     ` Randy Dunlap
2018-07-16 22:16                   ` NeilBrown
2018-07-09 16:50 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with kernel.h: Add for_each_if() (rev3) Patchwork
2018-07-09 17:05 ` ✓ Fi.CI.BAT: success " Patchwork
2018-07-10  2:08 ` ✓ Fi.CI.IGT: " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180709083650.23549-6-daniel.vetter@ffwll.ch \
    --to=daniel.vetter@ffwll.ch \
    --cc=akpm@linux-foundation.org \
    --cc=aryabinin@virtuozzo.com \
    --cc=daniel.vetter@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=kemi.wang@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@techsingularity.net \
    --cc=mhocko@suse.com \
    --cc=nborisov@suse.com \
    --cc=pasha.tatashin@oracle.com \
    --cc=ptesarik@suse.com \
    --cc=rientjes@google.com \
    --cc=vbabka@suse.cz \
    --cc=yasu.isimatu@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.