Skip to content

Commit 8663cad

Browse files
fthainmartinkpetersen
authored andcommitted
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: Stan Johnson <[email protected]> Signed-off-by: Finn Thain <[email protected]> Link: https://lore.kernel.org/r/c07a52d0d7610b4b9969d6dd4fc9a62458fe15de.1723001788.git.fthain@linux-m68k.org Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 476f8c8 commit 8663cad

File tree

2 files changed

+14
-25
lines changed

2 files changed

+14
-25
lines changed

drivers/scsi/NCR5380.c

Lines changed: 11 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1227,22 +1227,15 @@ static bool NCR5380_select(struct Scsi_Host *instance, struct scsi_cmnd *cmd)
12271227
return ret;
12281228
}
12291229

1230-
/*
1231-
* Function : int NCR5380_transfer_pio (struct Scsi_Host *instance,
1232-
* unsigned char *phase, int *count, unsigned char **data)
1233-
*
1234-
* Purpose : transfers data in given phase using polled I/O
1235-
*
1236-
* Inputs : instance - instance of driver, *phase - pointer to
1237-
* what phase is expected, *count - pointer to number of
1238-
* bytes to transfer, **data - pointer to data pointer,
1239-
* can_sleep - 1 or 0 when sleeping is permitted or not, respectively.
1240-
*
1241-
* Returns : -1 when different phase is entered without transferring
1242-
* maximum number of bytes, 0 if all bytes are transferred or exit
1243-
* is in same phase.
1230+
/**
1231+
* NCR5380_transfer_pio() - transfers data in given phase using polled I/O
1232+
* @instance: instance of driver
1233+
* @phase: pointer to what phase is expected
1234+
* @count: pointer to number of bytes to transfer
1235+
* @data: pointer to data pointer
1236+
* @can_sleep: 1 or 0 when sleeping is permitted or not, respectively
12441237
*
1245-
* Also, *phase, *count, *data are modified in place.
1238+
* Returns: void. *phase, *count, *data are modified in place.
12461239
*/
12471240

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

1254-
static int NCR5380_transfer_pio(struct Scsi_Host *instance,
1255-
unsigned char *phase, int *count,
1256-
unsigned char **data, unsigned int can_sleep)
1247+
static void NCR5380_transfer_pio(struct Scsi_Host *instance,
1248+
unsigned char *phase, int *count,
1249+
unsigned char **data, unsigned int can_sleep)
12571250
{
12581251
struct NCR5380_hostdata *hostdata = shost_priv(instance);
12591252
unsigned char p = *phase, tmp;
@@ -1358,11 +1351,6 @@ static int NCR5380_transfer_pio(struct Scsi_Host *instance,
13581351
*phase = tmp & PHASE_MASK;
13591352
else
13601353
*phase = PHASE_UNKNOWN;
1361-
1362-
if (!c || (*phase == p))
1363-
return 0;
1364-
else
1365-
return -1;
13661354
}
13671355

13681356
/**

drivers/scsi/NCR5380.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,8 +285,9 @@ static const char *NCR5380_info(struct Scsi_Host *instance);
285285
static void NCR5380_reselect(struct Scsi_Host *instance);
286286
static bool NCR5380_select(struct Scsi_Host *, struct scsi_cmnd *);
287287
static int NCR5380_transfer_dma(struct Scsi_Host *instance, unsigned char *phase, int *count, unsigned char **data);
288-
static int NCR5380_transfer_pio(struct Scsi_Host *instance, unsigned char *phase, int *count, unsigned char **data,
289-
unsigned int can_sleep);
288+
static void NCR5380_transfer_pio(struct Scsi_Host *instance,
289+
unsigned char *phase, int *count,
290+
unsigned char **data, unsigned int can_sleep);
290291
static int NCR5380_poll_politely2(struct NCR5380_hostdata *,
291292
unsigned int, u8, u8,
292293
unsigned int, u8, u8, unsigned long);

0 commit comments

Comments
 (0)