via-cuda: Remove redundant temporary variable

There is no possibility that current_req can change during execution of
cuda_start(). This can be confirmed by inspection: cuda_lock is always
held whenever cuda_start() is called or current_req is modified.

Tested-by: Stan Johnson <userm57@yahoo.com>
Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
This commit is contained in:
Finn Thain 2016-12-31 19:56:26 -05:00 committed by Michael Ellerman
parent 523717d149
commit 06d7e99408

View file

@ -414,19 +414,15 @@ cuda_write(struct adb_request *req)
static void static void
cuda_start(void) cuda_start(void)
{ {
struct adb_request *req;
/* assert cuda_state == idle */ /* assert cuda_state == idle */
/* get the packet to send */ if (current_req == NULL)
req = current_req;
if (req == 0)
return; return;
if ((in_8(&via[B]) & TREQ) == 0) if ((in_8(&via[B]) & TREQ) == 0)
return; /* a byte is coming in from the CUDA */ return; /* a byte is coming in from the CUDA */
/* set the shift register to shift out and send a byte */ /* set the shift register to shift out and send a byte */
out_8(&via[ACR], in_8(&via[ACR]) | SR_OUT); out_8(&via[ACR], in_8(&via[ACR]) | SR_OUT);
out_8(&via[SR], req->data[0]); out_8(&via[SR], current_req->data[0]);
out_8(&via[B], in_8(&via[B]) & ~TIP); out_8(&via[B], in_8(&via[B]) & ~TIP);
cuda_state = sent_first_byte; cuda_state = sent_first_byte;
} }