parallel port problem

2008-03-23 Thread taha siddiqi
Hi all, I have been trying the parallel port driver discussed in LDD 3rd edition from last few days now but with no success. Every time i read from any of the ports ( status, control or data ) I get 0xFF. I did remove parport, parport_pc, lp, ppdev and the request_region() call is also

why does it look like linked list traversing misses the head element?

2008-03-23 Thread Robert P. J. Day
i'm sure i'm misreading something, but when i look at the macro definition of __list_for_each in list.h: #define __list_for_each(pos, head) \ for (pos = (head)-next; pos != (head); pos = pos-next) i could swear that this traversal will visit each node in the list except for the

Re: why does it look like linked list traversing misses the head element?

2008-03-23 Thread Manish Katiyar
On Sun, Mar 23, 2008 at 12:46 PM, Robert P. J. Day [EMAIL PROTECTED] wrote: i'm sure i'm misreading something, but when i look at the macro definition of __list_for_each in list.h: #define __list_for_each(pos, head) \ for (pos = (head)-next; pos != (head); pos = pos-next) i

Re: why does it look like linked list traversing misses the head element?

2008-03-23 Thread Manish Katiyar
On Sun, Mar 23, 2008 at 12:46 PM, Robert P. J. Day [EMAIL PROTECTED] wrote: i'm sure i'm misreading something, but when i look at the macro definition of __list_for_each in list.h: #define __list_for_each(pos, head) \ for (pos = (head)-next; pos != (head); pos = pos-next) i

Re: why does it look like linked list traversing misses the head element?

2008-03-23 Thread Robert P. J. Day
On Sun, 23 Mar 2008, Manish Katiyar wrote: On Sun, Mar 23, 2008 at 12:46 PM, Robert P. J. Day [EMAIL PROTECTED] wrote: i'm sure i'm misreading something, but when i look at the macro definition of __list_for_each in list.h: #define __list_for_each(pos, head) \ for (pos =

lists and sentinels and splicing, oh my!

2008-03-23 Thread Robert P. J. Day
after digging around in the linked list code, i'm more confident i see what's happening, but now i have a new confusion. first, as an earlier poster pointed out, all of the elements in a kernel linked list are *not* equivalent -- each list has an additional data-free entry (call it the head).

Re: why does it look like linked list traversing misses the head element?

2008-03-23 Thread Avishay Traeger
On Sun, 2008-03-23 at 03:46 -0400, Robert P. J. Day wrote: On Sun, 23 Mar 2008, Manish Katiyar wrote: Linux kernel development - Robert Love has a nice detailed explaination of it. ironically, that's the very book i have open in front of me at the moment and which is confusing me, since

Re: lists and sentinels and splicing, oh my!

2008-03-23 Thread Manish Katiyar
On Sun, Mar 23, 2008 at 6:34 PM, Robert P. J. Day [EMAIL PROTECTED] wrote: On Sun, 23 Mar 2008, Robert P. J. Day wrote: ... snip ... an obvious fix is, once you do the splice, initialize that list header to designate an empty list, and in fact, there's a list function that does

Re: lists and sentinels and splicing, oh my!

2008-03-23 Thread Robert P. J. Day
On Sun, 23 Mar 2008, Manish Katiyar wrote: On Sun, Mar 23, 2008 at 6:34 PM, Robert P. J. Day [EMAIL PROTECTED] wrote: On Sun, 23 Mar 2008, Robert P. J. Day wrote: ... snip ... an obvious fix is, once you do the splice, initialize that list header to designate an empty list,

Re: lists and sentinels and splicing, oh my!

2008-03-23 Thread Robert P. J. Day
On Sun, 23 Mar 2008, Manish Katiyar wrote: ... snip ... list_splice(d-fifo_list, packet_list); list_splice(d-pending_list, packet_list); INIT_LIST_HEAD(d-fifo_list); INIT_LIST_HEAD(d-pending_list); ... Interesting point Robert, I agree. However not

Re: lists and sentinels and splicing, oh my!

2008-03-23 Thread Robert P. J. Day
On Sun, 23 Mar 2008, Manish Katiyar wrote: On Sun, Mar 23, 2008 at 11:35 PM, Manish Katiyar [EMAIL PROTECTED] wrote: Hmmm after seeing the list_del(), I was wondering if after splicing the list, what seems to be more reasonable. Setting the prev and next pointers of head to NULL, or

Re: question about BUG_ON() and BUG()

2008-03-23 Thread Rik van Riel
On Fri, 21 Mar 2008 12:35:48 -0700 ilya [EMAIL PROTECTED] wrote: hello, my first question is exactly when should this macro be used? i want to use it in one of my functions to assert that the spin lock was acquired: BUG_ON(!spin_is_locked(dev-lock)) then i wanted to see what would

Re: Write once only but read many filesystem

2008-03-23 Thread Scott Lovenberg
Jörn Engel wrote: On Sat, 22 March 2008 23:55:53 +0800, Peter Teoh wrote: Or do you want individual files/directories to be immutable - chattr? chattr is not good enough, as root can still modify it. So if current feature is not there, then some small development may be needed. And in