Re: [PATCH 2/5] USB Kconfig: Select SCSI for USB Mass Storage support

Stefan Richter
2008-01-06T17:51:41Z

Al Boldi wrote:
> Stefan Richter wrote:
>> Al Boldi wrote:
>>> menuconfig USB_STORAGE
>>> tristate "USB Mass Storage support"
>>> - depends on USB && SCSI
>>> + depends on USB && BLOCK
>>> + select SCSI
>> Still wrong. SCSI also needs HAS_DMA and SCSI_DMA.
>
> I don't think so. SCSI selects SCSI_DMA, it doesn't depend on it.

"A selects B" == "A depends on B, but please don't hide A when B is off
and silently switch B on when A is switched on".

config SCSI
tristate "SCSI device support"
depends on BLOCK
select SCSI_DMA if HAS_DMA

So, SCSI doesn't actually need SCSI_DMA per se, but it apparently needs
it whenever HAS_DMA != n.

> So it's safe to select SCSI here, as libata does it the same way.

Sam, does kconfig recursively follow select statements and switch on
options which are select'ed by select'ed options? I suppose it doesn't.

Maybe this would be better:

config SCSI
tristate "SCSI device support"
depends on BLOCK
- select SCSI_DMA if HAS_DMA

config SCSI_DMA
bool
- default n
+ default y if SCSI && HAS_DMA

--
Stefan Richter
-=====-==--- ---= --==-