aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKai Makisara <Kai.Makisara@kolumbus.fi>2008-07-11 08:06:40 -0400
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2008-07-26 15:14:47 -0400
commit786231af0a4ac6d78cef51fa7e9c3dd63f016195 (patch)
tree45dc2f15f61253c74ac8e9e58f541926f17a2301
parent626dcb1ee39aa1010c27df31970ff0ecfb287208 (diff)
[SCSI] st: Remove bogus memset
Mike Christie noticed a bogus memset. It can be removed as dead code since the number of bytes in the driver buffer in fixed block mode is always a multiple of the tape block size. Signed-off-by: Kai Mäkisara <Kai.Makisara@kolumbus.fi> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
-rw-r--r--drivers/scsi/st.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/scsi/st.c b/drivers/scsi/st.c
index 41b1f81b1651..c2bb53e3d941 100644
--- a/drivers/scsi/st.c
+++ b/drivers/scsi/st.c
@@ -631,7 +631,7 @@ static int cross_eof(struct scsi_tape * STp, int forward)
631/* Flush the write buffer (never need to write if variable blocksize). */ 631/* Flush the write buffer (never need to write if variable blocksize). */
632static int st_flush_write_buffer(struct scsi_tape * STp) 632static int st_flush_write_buffer(struct scsi_tape * STp)
633{ 633{
634 int offset, transfer, blks; 634 int transfer, blks;
635 int result; 635 int result;
636 unsigned char cmd[MAX_COMMAND_SIZE]; 636 unsigned char cmd[MAX_COMMAND_SIZE];
637 struct st_request *SRpnt; 637 struct st_request *SRpnt;
@@ -644,14 +644,10 @@ static int st_flush_write_buffer(struct scsi_tape * STp)
644 result = 0; 644 result = 0;
645 if (STp->dirty == 1) { 645 if (STp->dirty == 1) {
646 646
647 offset = (STp->buffer)->buffer_bytes; 647 transfer = STp->buffer->buffer_bytes;
648 transfer = ((offset + STp->block_size - 1) /
649 STp->block_size) * STp->block_size;
650 DEBC(printk(ST_DEB_MSG "%s: Flushing %d bytes.\n", 648 DEBC(printk(ST_DEB_MSG "%s: Flushing %d bytes.\n",
651 tape_name(STp), transfer)); 649 tape_name(STp), transfer));
652 650
653 memset((STp->buffer)->b_data + offset, 0, transfer - offset);
654
655 memset(cmd, 0, MAX_COMMAND_SIZE); 651 memset(cmd, 0, MAX_COMMAND_SIZE);
656 cmd[0] = WRITE_6; 652 cmd[0] = WRITE_6;
657 cmd[1] = 1; 653 cmd[1] = 1;