ide: add ide_for_each_present_dev() iterator
* Add ide_for_each_present_dev() iterator and convert IDE code to use it. * Do some drive-by CodingStyle fixups in ide-acpi.c while at it. There should be no functional changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
This commit is contained in:
@@ -1609,6 +1609,10 @@ static inline ide_drive_t *ide_get_pair_dev(ide_drive_t *drive)
|
||||
#define ide_port_for_each_dev(i, dev, port) \
|
||||
for ((i) = 0; ((dev) = (port)->devices[i]) || (i) < MAX_DRIVES; (i)++)
|
||||
|
||||
#define ide_port_for_each_present_dev(i, dev, port) \
|
||||
for ((i) = 0; ((dev) = (port)->devices[i]) || (i) < MAX_DRIVES; (i)++) \
|
||||
if ((dev)->dev_flags & IDE_DFLAG_PRESENT)
|
||||
|
||||
#define ide_host_for_each_port(i, port, host) \
|
||||
for ((i) = 0; ((port) = (host)->ports[i]) || (i) < MAX_HOST_PORTS; (i)++)
|
||||
|
||||
|
Reference in New Issue
Block a user