Nicolas Williams wrote:
> On Tue, Sep 08, 2009 at 10:04:39AM -0700, Garrett D'Amore wrote:
>   
>>> Remember the fileno() fiasco?  At least with functions, we have symbolic
>>> tricks we can pull to get different (and compatible) behaviors depending
>>> on who calls the function and how it's called.
>>>
>>> Fortunately for the BSD queue macros, that really isn't an issue.  They
>>> haven't changed in approximately forever.
>>>       
>> More to the point, the "macros" for the BSD queues are self-contained.  
>> That is to say, assuming you only use the macros within a single module, 
>>     
>                   ^^^^^^^^
>
> But why should anyone assume that?  (Yes, fileno() was intended to be
> used with FILE *, which was a very public interface.  But nothing stops
> one from making the same sort of mistake with these macros.)
>
> I think the BSD queue macros should be public interfaces, if only
> because they are useful for porting software.  Perhaps they should come
> with a loud warning that one must not make struct types/typedefs defined
> by the *_HEAD() and *_ENTRY() macros, part of any public interface,
> though since they have never changed and we have no reason to think that
> they ever will...
>
> Incidentally, Linux has its own list API, including inlined functions.
> It'd be nice to have compatibility with that.  Also, I second Darren's
> sentiment w.r.t. the AVL tree API.
>   

Okay, but all of *those* comments are *not this case*.  Unless someone 
believes this case ought to be abandoned in favor of the queue.h macros.

For my nickel, I think its sad that we have to have two "competing" list 
types in the kernel.   Converting queue.h into list.h (or vice versa) is 
such a trivial task that it should never take an engineer more than a 
little bit of time.  Compared to the major effort to port a device 
driver from one OS to another (and you might say I know just a little 
bit about what's involved there!), dealing with the list handling stuff 
is just minor noise.

Given that, I'd actually prefer to remove the queue.h interfaces, and 
promote list.h.  list.h interfaces are safer than BSD queue.h (see above 
argument), and have been around and available since ~forever.

Driver developers that *really* want to use queue.h are of course free 
to import private copies of that header file into their own source code, 
although I wish we saw less of that inside ON.

    - Garrett

Reply via email to