Re: [PATCH/RFC] pci: dynids.use_driver_data considered harmful

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Jesse Barnes <jbarnes@...>
Cc: Greg KH <greg@...>, Milton Miller <miltonm@...>, Michael Ellerman <michael@...>, linux-kernel <linux-kernel@...>, Andrew Morton <akpm@...>, <linux-pci@...>
Date: Friday, August 15, 2008 - 2:55 pm

Hi Jesse,

On Fri, 15 Aug 2008 10:46:59 -0700, Jesse Barnes wrote:

In fact we can do even better than that. We could accept from
user-space only driver_data values which at least one device ID entry in
the driver already uses. That should be fairly easy to implement, and
would offer a level of safety an order of magnitude above what we have
at the moment... And it works both ways: if 0 is not a valid data for
some driver, that would force the user to provide a non-zero (and
valid) data value. And it guarantees that the user can't ask for
something the driver doesn't expect, so drivers don't even need extra
checks. And no need for a use_driver_data flag either.

The only drawback is that it prevents the user from passing a "new"
data value even if it would be valid. But honestly, I don't expect that
case to happen frequently... if ever at all. So I'd say the benefits
totally outweight the drawback.

If the interested people agree with the idea, I'll look into
implementing it.

-- 
Jean Delvare
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH/RFC] pci: dynids.use_driver_data considered harmful, Jean Delvare, (Fri Aug 15, 2:55 pm)