Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 786231af authored by Kai Makisara's avatar Kai Makisara Committed by James Bottomley
Browse files

[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: default avatarKai Mäkisara <Kai.Makisara@kolumbus.fi>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@HansenPartnership.com>
parent 626dcb1e
Loading
Loading
Loading
Loading
+2 −6
Original line number Original line Diff line number Diff line
@@ -631,7 +631,7 @@ static int cross_eof(struct scsi_tape * STp, int forward)
/* Flush the write buffer (never need to write if variable blocksize). */
/* Flush the write buffer (never need to write if variable blocksize). */
static int st_flush_write_buffer(struct scsi_tape * STp)
static int st_flush_write_buffer(struct scsi_tape * STp)
{
{
	int offset, transfer, blks;
	int transfer, blks;
	int result;
	int result;
	unsigned char cmd[MAX_COMMAND_SIZE];
	unsigned char cmd[MAX_COMMAND_SIZE];
	struct st_request *SRpnt;
	struct st_request *SRpnt;
@@ -644,14 +644,10 @@ static int st_flush_write_buffer(struct scsi_tape * STp)
	result = 0;
	result = 0;
	if (STp->dirty == 1) {
	if (STp->dirty == 1) {


		offset = (STp->buffer)->buffer_bytes;
		transfer = STp->buffer->buffer_bytes;
		transfer = ((offset + STp->block_size - 1) /
			    STp->block_size) * STp->block_size;
                DEBC(printk(ST_DEB_MSG "%s: Flushing %d bytes.\n",
                DEBC(printk(ST_DEB_MSG "%s: Flushing %d bytes.\n",
                               tape_name(STp), transfer));
                               tape_name(STp), transfer));


		memset((STp->buffer)->b_data + offset, 0, transfer - offset);

		memset(cmd, 0, MAX_COMMAND_SIZE);
		memset(cmd, 0, MAX_COMMAND_SIZE);
		cmd[0] = WRITE_6;
		cmd[0] = WRITE_6;
		cmd[1] = 1;
		cmd[1] = 1;