Thread (7 messages) 7 messages, 5 authors, 2018-07-02

Re: [PATCH] fbcon: introduce for_each_registered_fb() helper

flat view

From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Date: 2018-07-02 10:15:24
Also in: dri-devel, lkml

On Mon, 2018-07-02 at 09:36 +0200, Bernd Petrovitsch wrote:

quoted
+#define for_each_registered_fb(i)		\
+	for (i = 0; i < FB_MAX; i++)		\
+		if (registered_fb[i])
+
That leaves the possibility of a dangling-else.
----  snip  ----
#define for_each_registered_fb(i)		\
	for (i = 0; i < FB_MAX; i++)		\
		if (!registered_fb[i])		\
			continue;		\
		else
----  snip  ----
avoids that.
Yes, you not alone :-)

AFAIU there is a v2 which fixes that, though Daniel pointed out that DRM
has a specific macro to make life easier.

-- 
Andy Shevchenko [off-list ref]
Intel Finland Oy
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help