diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-04-17 18:46:26 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-04-17 18:46:26 -0400 |
commit | 7616c0ad2087c7d244b8985390c63059a6223c45 (patch) | |
tree | c65d7e5dce8b6ec314b56ad2903c8760e2659753 /drivers/scsi/ide-scsi.c | |
parent | 3ad6776cca21f2456b7288f44f224b344ac3c4d0 (diff) |
ide: add ide_atapi_{discard_data,write_zeros} inline helpers
Add ide_atapi_{discard_data,write_zeros} inline helpers to <linux/ide.h>
and use them instead of home-brewn helpers in ide-{floppy,tape,scsi}.
There should be no functional changes caused by this patch.
Cc: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/scsi/ide-scsi.c')
-rw-r--r-- | drivers/scsi/ide-scsi.c | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/drivers/scsi/ide-scsi.c b/drivers/scsi/ide-scsi.c index 68e5c632c5d5..3c3b3502c4d4 100644 --- a/drivers/scsi/ide-scsi.c +++ b/drivers/scsi/ide-scsi.c | |||
@@ -152,18 +152,6 @@ static inline idescsi_scsi_t *drive_to_idescsi(ide_drive_t *ide_drive) | |||
152 | */ | 152 | */ |
153 | #define IDESCSI_PC_RQ 90 | 153 | #define IDESCSI_PC_RQ 90 |
154 | 154 | ||
155 | static void idescsi_discard_data (ide_drive_t *drive, unsigned int bcount) | ||
156 | { | ||
157 | while (bcount--) | ||
158 | (void) HWIF(drive)->INB(IDE_DATA_REG); | ||
159 | } | ||
160 | |||
161 | static void idescsi_output_zeros (ide_drive_t *drive, unsigned int bcount) | ||
162 | { | ||
163 | while (bcount--) | ||
164 | HWIF(drive)->OUTB(0, IDE_DATA_REG); | ||
165 | } | ||
166 | |||
167 | /* | 155 | /* |
168 | * PIO data transfer routines using the scatter gather table. | 156 | * PIO data transfer routines using the scatter gather table. |
169 | */ | 157 | */ |
@@ -200,7 +188,7 @@ static void idescsi_input_buffers (ide_drive_t *drive, idescsi_pc_t *pc, unsigne | |||
200 | 188 | ||
201 | if (bcount) { | 189 | if (bcount) { |
202 | printk (KERN_ERR "ide-scsi: scatter gather table too small, discarding data\n"); | 190 | printk (KERN_ERR "ide-scsi: scatter gather table too small, discarding data\n"); |
203 | idescsi_discard_data (drive, bcount); | 191 | ide_atapi_discard_data(drive, bcount); |
204 | } | 192 | } |
205 | } | 193 | } |
206 | 194 | ||
@@ -237,7 +225,7 @@ static void idescsi_output_buffers (ide_drive_t *drive, idescsi_pc_t *pc, unsign | |||
237 | 225 | ||
238 | if (bcount) { | 226 | if (bcount) { |
239 | printk (KERN_ERR "ide-scsi: scatter gather table too small, padding with zeros\n"); | 227 | printk (KERN_ERR "ide-scsi: scatter gather table too small, padding with zeros\n"); |
240 | idescsi_output_zeros (drive, bcount); | 228 | ide_atapi_write_zeros(drive, bcount); |
241 | } | 229 | } |
242 | } | 230 | } |
243 | 231 | ||
@@ -463,7 +451,7 @@ static ide_startstop_t idescsi_pc_intr (ide_drive_t *drive) | |||
463 | } | 451 | } |
464 | pc->actually_transferred += temp; | 452 | pc->actually_transferred += temp; |
465 | pc->current_position += temp; | 453 | pc->current_position += temp; |
466 | idescsi_discard_data(drive, bcount - temp); | 454 | ide_atapi_discard_data(drive, bcount - temp); |
467 | ide_set_handler(drive, &idescsi_pc_intr, get_timeout(pc), idescsi_expiry); | 455 | ide_set_handler(drive, &idescsi_pc_intr, get_timeout(pc), idescsi_expiry); |
468 | return ide_started; | 456 | return ide_started; |
469 | } | 457 | } |