lkml.org 
[lkml]   [2006]   [Jan]   [6]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
DateFri, 6 Jan 2006 08:01:26 +0100 (MET)
FromJan Engelhardt <>
SubjectRe: [OT] Re: keyboard driver of 2.6 kernel
>> rid of the extra fluff -- the dependency on moduleparm.h which doesn't
>> exit in 2.4.22

Good to know.

>> the BSD defines

In the kernel part? Where?

>> the 2.6 defines, etc. Also, if built as a
>> module, it'll be called 'rpl' instead of 'rpldev'.
>
> Why?

By default, it's called rpldev everywhere.

> Thanks for sharing your work! Comments on the coding style aside (it's not
> exactly winning a beauty contest), one thing I spotted while skimming over your
> patch:
>
>> +static int urpl_open(struct inode *inode, struct file *filp) {
>> +    // This one is called when the device node has been opened.
>> +    if(inode != NULL) {
>> +        inode->i_mtime = CURRENT_TIME;
>> +        inode->i_mode &= ~(S_IWUGO | S_IXUGO);
>> +    }
>> +
>> +    /* The RPL device should only be opened once, since otherwise, 
> different
>> +    packets could go to different readers. */
>> +    down(&Open_lock);
>> +    if(Open_count) {
>> +        up(&Open_lock);
>> +        return -EBUSY;
>> +    }
>> +    ++Open_count;
>> +    up(&Open_lock);
>> +
>> +    down(&Buffer_lock);
>> +    Buffer = __vmalloc(Bufsize, GFP_KERNEL | __GFP_HIGHMEM, 
> PAGE_KERNEL);
>> +    if(Buffer == NULL) {
>> +        up(&Buffer_lock);
>> +        up(&Open_lock);
>
> This does not seem to be correct. This semaphore has been released already and
> urpl_open is not called under a lock AFAICS.

Semaphoring is right, i.e. Open_lock is only acquired to check Open_count.
However, that last line is certainly invalid - Open_lock is up'ped twice, 
which can't be. Thanks for spotting that.

I will have 2.4 put back in.


Jan Engelhardt
-- 
| Alphagate Systems, http://alphagate.hopto.org/
| jengelh's site, http://jengelh.hopto.org/
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-01-06 08:04    [from the cache]
©2003-2008