Re: [PATCH 2.6.19-rc1 update4] drivers: add LCD support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 10/27/06, Andrew Morton <[email protected]> wrote:
On Thu, 26 Oct 2006 17:48:58 +0000
Miguel Ojeda Sandonis <[email protected]> wrote:

>
> +DECLARE_MUTEX(cfag12864bfb_sem);

Mutexes are preferred - please only use semaphores if their counting
feature is required.

This lock can have static scope.

> +struct page *cfag12864bfb_vma_nopage(struct vm_area_struct *vma,
> +     unsigned long address, int *type)

This function can have static scope.

> +{
> +     struct page *page;
> +     down(&cfag12864bfb_sem);
> +
> +     page = virt_to_page(cfag12864b_buffer);
> +     get_page(page);
> +
> +     if(type)
> +             *type = VM_FAULT_MINOR;
> +
> +     up(&cfag12864bfb_sem);
> +     return page;
> +}

What's the semaphore actually needed for?


Hum, the code is based on LDD3, I just adapted it removing a few
lines. I thought this code also needed lock protection as the LDD3
example. I'm sending a new patch in a few moments with this 3 things
fixed.

Thanks you,
    Miguel Ojeda
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux