Re: [Linux-fbdev-devel] [PATCH] fb: Remove use of lock_kernel /unlock_kernel in fbmem
From: Andres Salomon
Date: Fri Apr 18 2008 - 13:39:10 EST
On Wed, 16 Apr 2008 20:00:59 -0300
Thiago Galesi <thiagogalesi@xxxxxxxxx> wrote:
>
> This patch removes lock_kernel(), unlock_kernel() usage in fbmem.c and replaces it with a mutex
>
> Signed-off-by: Thiago Galesi <thiagogalesi@xxxxxxxxx>
>
[...]
> @@ -1413,6 +1435,8 @@ register_framebuffer(struct fb_info *fb_
>
> event.info = fb_info;
> fb_notifier_call_chain(FB_EVENT_FB_REGISTERED, &event);
> +
> + mutex_init(&fb_info->hwlock);
> return 0;
> }
>
Just a minor nit; in general, I'd think you would want to completely
initialize the structure (including calling mutex_init) before
registering the structure with the rest of the system (in this case,
with registered_fb and *_call_notifier_chain). Initializing after
registration is just asking for a race conditions.
--
Need a kernel or Debian developer? Contact me, I'm looking for contracts.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/