Re: [linux-usb-devel] [PATCH] limit power budget on spitz

From: Nicolas Pitre
Date: Thu Jun 08 2006 - 22:34:19 EST


On Thu, 8 Jun 2006, David Brownell wrote:

> On Thursday 08 June 2006 6:25 pm, Nicolas Pitre wrote:
> > He replied to your assertion where you said: "if the kernel doesn't have
> > that driver configured, that's another reason not to bother registering
> > its device" to which he disagreed, and I disagree too.
>
> I see your point. Yes, this is arguable ... there are multiple principles
> that can be traded off against each other.
>
> For example, "by default, make design choices that save memory" (what I was
> using) versus:
>
> > The _device_ should indeed be registered based on _hardware_ config, not
> > _driver_ config.
>
> For a kernel without CONFIG_MODULES, that's pure wasted space. Why bother?
> Those are devices that "can't be present", so that's one of the cases where
> that "ignore the driver config" policy will indeed register such devices.

But constrained hardware designs for which memory usage is important
that have the device available are likely to make use of that device
anyway. So in those cases it is pretty unlikely that the kernel config
won't include the corresponding driver.

The case where the hardware does support a device but someone decided
not to use it may have its kernel config exclude the corresponding
driver. But since this is most probably not the common case I don't
think we should go as far as uglifying the code with conditional device
registrations based on #if !defined(CONFIG_MODULE) && !defined(CONFIG_FOO)
just for the sake of saving as many bytes as possible. That someone may
as well comment out that device registration in his own source tree
himself.

It is more likely that some hardware design that is not
expected to use a particular device will simply not register that device
in the first place and its default kernel config won't have the driver
selected either. In that sense I think Richard's patch is all that is
needed for mainline.


Nicolas
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/