[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <00590669b886b4cc54548e6101912c3d4d1752f2.camel@petrovitsch.priv.at>
Date: Mon, 02 Jul 2018 09:36:02 +0200
From: Bernd Petrovitsch <bernd@...rovitsch.priv.at>
To: Yisheng Xie <ysxie@...mail.com>, b.zolnierkie@...sung.com,
keescook@...omium.org, j.w.r.degoede@...il.com,
david@...hnology.com
Cc: andriy.shevchenko@...ux.intel.com, dri-devel@...ts.freedesktop.org,
linux-fbdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] fbcon: introduce for_each_registered_fb() helper
Hi all!
On Fri, 2018-06-29 at 00:20 +0800, Yisheng Xie wrote:
[...]
> diff --git a/include/linux/fb.h b/include/linux/fb.h
> index aa74a22..3e13b95 100644
> --- a/include/linux/fb.h
> +++ b/include/linux/fb.h
> @@ -650,6 +650,10 @@ extern int fb_get_color_depth(struct
> fb_var_screeninfo *var,
> extern int num_registered_fb;
> extern struct class *fb_class;
>
> +#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.
Kind regards,
Bernd
--
Bernd Petrovitsch Email : bernd@...rovitsch.priv.at
LUGA : http://www.luga.at
Powered by blists - more mailing lists