Re: [PATCH] ide-scsi: do non-atomic pc->flags testing

From: Bartlomiej Zolnierkiewicz
Date: Tue Feb 12 2008 - 16:27:01 EST


On Tuesday 12 February 2008, Borislav Petkov wrote:
> commit 272976f0f5754707f9e41da315717a6eb8d9d536
> Author: Borislav Petkov <petkovbb@xxxxxxxxx>
> Date: Tue Feb 12 16:22:44 2008 +0100
>
> ide-scsi: do non-atomic pc->flags testing
>
> Signed-off-by: Borislav Petkov <petkovbb@xxxxxxxxx>
>
> diff --git a/drivers/scsi/ide-scsi.c b/drivers/scsi/ide-scsi.c
> index 5ec421c..eb84cdc 100644
> --- a/drivers/scsi/ide-scsi.c
> +++ b/drivers/scsi/ide-scsi.c
> @@ -319,8 +319,10 @@ static int idescsi_end_request (ide_drive_t *drive, int uptodate, int nrsecs)
> pc = opc;
> rq = pc->rq;
> pc->scsi_cmd->result = (CHECK_CONDITION << 1) |
> - ((test_bit(PC_TIMEDOUT, &pc->flags)?DID_TIME_OUT:DID_OK) << 16);
> - } else if (test_bit(PC_TIMEDOUT, &pc->flags)) {
> + (((pc->flags & PC_TIMEDOUT) ?
> + DID_TIME_OUT :
> + DID_OK) << 16);
> + } else if (pc->flags & PC_TIMEDOUT) {

How's about renaming flag defines to PC_FLAG_* at the same time
(like it was done for other ATAPI drivers)?

Otherwise looks good.
--
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/