Re: [PATCH 06/10] ide-atapi: add a DEV_IS_IDECD macro

Bartlomiej Zolnierkiewicz
2008-09-15T18:33:38Z

On Sunday 14 September 2008 13:35:54 Borislav Petkov wrote:
> This is a short-term-use one and will be removed later - it is added to solely
> improve readability.
>
> There should be no functional change resulting from this patch.
>
> Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
> ---
> drivers/ide/ide-atapi.c | 12 +++++++-----
> 1 files changed, 7 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/ide/ide-atapi.c b/drivers/ide/ide-atapi.c
> index 7045d34..e1fa52d 100644
> --- a/drivers/ide/ide-atapi.c
> +++ b/drivers/ide/ide-atapi.c
> @@ -477,6 +477,9 @@ static int ide_delayed_transfer_pc(ide_drive_t *drive)
> return WAIT_FLOPPY_CMD;
> }
>
> +#define DEV_IS_IDECD(drive) \
> + (drive->media == ide_cdrom || drive->media == ide_optical)
> +

This needs to check for drive->scsi or the subtle bugs will happen.

Also why not use dev_is_idecd() static inline function instead?