[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <a2776ec50901190029s28e663c6m1dc277484e143ac2@mail.gmail.com>
Date: Mon, 19 Jan 2009 09:29:46 +0100
From: Andrea Righi <righi.andrea@...il.com>
To: Harvey Harrison <harvey.harrison@...il.com>
Cc: Stefan Richter <stefanr@...6.in-berlin.de>,
Johannes Weiner <hannes@...xchg.org>,
Dave Jones <davej@...hat.com>,
Johannes Weiner <hannes@...urebad.de>,
Krzysztof Helt <krzysztof.h1@...pl>,
Andrew Morton <akpm@...ux-foundation.org>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] fbmem: fix copy_from/to_user() with mutex held
On Mon, Jan 19, 2009 at 9:10 AM, Harvey Harrison
<harvey.harrison@...il.com> wrote:
> On Mon, 2009-01-19 at 09:05 +0100, Stefan Richter wrote:
>> 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.
>
> That, and there is no possible way to get the sparse annotations right
> for that function, which means you'll get no help from sparse in lock
> checking.
>
> So I'd suggest just opencoding these where needed instead of the
> wrappers.
>
> Harvey
>
OK, thanks for all the suggestions. I'll fix everything and repost a
new patch ASAP.
-Andrea
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists