On Thu, 2011-05-26 at 12:20 +0300, Pekka Enberg wrote: > On Thu, May 26, 2011 at 12:14 PM, Sasha Levin <levinsasha928@xxxxxxxxx> wrote: > >> > I've wanted to keep the original interface clean, Most of the IO port > >> > users don't (and probably won't) require a parameter. > >> > >> Well now struct ioport_operations isn't very clean is it - or the code > >> that needs to determine which function pointer to call?-) > > > > struct ioport_operations is a bit more messy, but it's one spot instead > > of adding a 'parameter' to each module that doesn't really need it. > > > > My assumption is that most ioport users now and in the future won't need > > it, it just solves several special cases more easily (multiple devices > > which share same handling functions). > > Hey, that's not an excuse to make struct ioport_operations 'bit > messy'! Look at any kernel code that uses ops like we do here and you > will see we don't do APIs like this. > > One option here is to rename 'struct ioport_entry' to 'struct ioport' > and pass a pointer to that as the first argument to all of the ops. > That's what most APIs in the kernel do anyway. Why do it like that? this way users of the callback functions will need to know the internal structure of struct ioport_entry. -- Sasha. -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html