lkml.org 
[lkml]   [2009]   [Jan]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] fbmem: fix copy_from/to_user() with mutex held
Stefan Richter wrote:
> Andrea Righi wrote:
>> +struct fb_info *get_fb_info(struct fb_info *info)
>> +__acquires(&info->lock)
>> +{
>> + mutex_lock(&info->lock);
>> + if (!info->fbops) {
>> + mutex_unlock(&info->lock);
>> + return NULL;
>> + }
>> + return info;
>> +}
>> +
>> +void put_fb_info(struct fb_info *info)
>> +__releases(&info->lock)
>> +{
>> + mutex_unlock(&info->lock);
>> +}
>> +
>
> These are IMO bad function names.

PS: The return value of the mutex_lock wrapper is also bad. A bool or
int would IMO be clearer, similar to the return value of mutex_trylock.
--
Stefan Richter
-=====-==--= ---= =--==
http://arcgraph.de/sr/

\
 
 \ /
  Last update: 2009-01-19 09:09    [from the cache]
©2003-2011 Jasper Spaans