Commit 8663cade authored by Finn Thain's avatar Finn Thain Committed by Martin K. Petersen
Browse files

scsi: NCR5380: Remove redundant result calculation from NCR5380_transfer_pio()



NCR5380_transfer_pio() returns an ambiguous value which is ignored by
callers. Make it void and remove the redundant calculation. Adopt
kernel-doc format for the updated description.

Tested-by: default avatarStan Johnson <userm57@yahoo.com>
Signed-off-by: default avatarFinn Thain <fthain@linux-m68k.org>
Link: https://lore.kernel.org/r/c07a52d0d7610b4b9969d6dd4fc9a62458fe15de.1723001788.git.fthain@linux-m68k.org


Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 476f8c82
Loading
Loading
Loading
Loading
+11 −23
Original line number Diff line number Diff line
@@ -1227,22 +1227,15 @@ static bool NCR5380_select(struct Scsi_Host *instance, struct scsi_cmnd *cmd)
	return ret;
}

/*
 * Function : int NCR5380_transfer_pio (struct Scsi_Host *instance,
 * unsigned char *phase, int *count, unsigned char **data)
 *
 * Purpose : transfers data in given phase using polled I/O
 *
 * Inputs : instance - instance of driver, *phase - pointer to
 * what phase is expected, *count - pointer to number of
 * bytes to transfer, **data - pointer to data pointer,
 * can_sleep - 1 or 0 when sleeping is permitted or not, respectively.
 *
 * Returns : -1 when different phase is entered without transferring
 * maximum number of bytes, 0 if all bytes are transferred or exit
 * is in same phase.
/**
 * NCR5380_transfer_pio() - transfers data in given phase using polled I/O
 * @instance: instance of driver
 * @phase: pointer to what phase is expected
 * @count: pointer to number of bytes to transfer
 * @data: pointer to data pointer
 * @can_sleep: 1 or 0 when sleeping is permitted or not, respectively
 *
 * Also, *phase, *count, *data are modified in place.
 * Returns: void. *phase, *count, *data are modified in place.
 */

/*
@@ -1251,7 +1244,7 @@ static bool NCR5380_select(struct Scsi_Host *instance, struct scsi_cmnd *cmd)
 * counts, we will always do a pseudo DMA or DMA transfer.
 */

static int NCR5380_transfer_pio(struct Scsi_Host *instance,
static void NCR5380_transfer_pio(struct Scsi_Host *instance,
				 unsigned char *phase, int *count,
				 unsigned char **data, unsigned int can_sleep)
{
@@ -1358,11 +1351,6 @@ static int NCR5380_transfer_pio(struct Scsi_Host *instance,
		*phase = tmp & PHASE_MASK;
	else
		*phase = PHASE_UNKNOWN;

	if (!c || (*phase == p))
		return 0;
	else
		return -1;
}

/**
+3 −2
Original line number Diff line number Diff line
@@ -285,8 +285,9 @@ static const char *NCR5380_info(struct Scsi_Host *instance);
static void NCR5380_reselect(struct Scsi_Host *instance);
static bool NCR5380_select(struct Scsi_Host *, struct scsi_cmnd *);
static int NCR5380_transfer_dma(struct Scsi_Host *instance, unsigned char *phase, int *count, unsigned char **data);
static int NCR5380_transfer_pio(struct Scsi_Host *instance, unsigned char *phase, int *count, unsigned char **data,
				unsigned int can_sleep);
static void NCR5380_transfer_pio(struct Scsi_Host *instance,
				 unsigned char *phase, int *count,
				 unsigned char **data, unsigned int can_sleep);
static int NCR5380_poll_politely2(struct NCR5380_hostdata *,
                                  unsigned int, u8, u8,
                                  unsigned int, u8, u8, unsigned long);