Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1548853
| From | Finn Thain <fthain@telegraphics.com.au> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH RESEND 02/10] via-cuda: Remove redundant temporary variable |
| Date | 2017-01-01 02:00 +0100 |
| Message-ID | <sUCFb-1FL-15@gated-at.bofh.it> (permalink) |
| References | <sUCFb-1FL-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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>
---
drivers/macintosh/via-cuda.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/macintosh/via-cuda.c b/drivers/macintosh/via-cuda.c
index 0617512..dd51df5 100644
--- a/drivers/macintosh/via-cuda.c
+++ b/drivers/macintosh/via-cuda.c
@@ -414,19 +414,15 @@ cuda_write(struct adb_request *req)
static void
cuda_start(void)
{
- struct adb_request *req;
-
/* assert cuda_state == idle */
- /* get the packet to send */
- req = current_req;
- if (req == 0)
+ if (current_req == NULL)
return;
if ((in_8(&via[B]) & TREQ) == 0)
return; /* a byte is coming in from the CUDA */
/* set the shift register to shift out and send a byte */
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);
cuda_state = sent_first_byte;
}
--
2.10.2
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH RESEND 00/10] Replace via-maciisi with via-cuda driver Finn Thain <fthain@telegraphics.com.au> - 2017-01-01 02:00 +0100
[PATCH RESEND 04/10] via-cuda: Prevent read buffer overflow Finn Thain <fthain@telegraphics.com.au> - 2017-01-01 02:00 +0100
[PATCH RESEND 10/10] m68k/mac: Replace via-maciisi driver with via-cuda driver Finn Thain <fthain@telegraphics.com.au> - 2017-01-01 02:00 +0100
Re: [PATCH RESEND 10/10] m68k/mac: Replace via-maciisi driver with via-cuda driver Geert Uytterhoeven <geert@linux-m68k.org> - 2017-01-02 11:30 +0100
Re: [PATCH RESEND 10/10] m68k/mac: Replace via-maciisi driver with via-cuda driver Finn Thain <fthain@telegraphics.com.au> - 2017-01-03 01:40 +0100
[PATCH RESEND 05/10] via-cuda: Fix re-initialization of reply_ptr and reading_reply Finn Thain <fthain@telegraphics.com.au> - 2017-01-01 02:00 +0100
[PATCH RESEND 08/10] via-cuda: Initialize data_index early and increment consistently Finn Thain <fthain@telegraphics.com.au> - 2017-01-01 02:00 +0100
[PATCH RESEND 02/10] via-cuda: Remove redundant temporary variable Finn Thain <fthain@telegraphics.com.au> - 2017-01-01 02:00 +0100
[PATCH RESEND 01/10] via-cuda: Cleanup printk calls Finn Thain <fthain@telegraphics.com.au> - 2017-01-01 02:00 +0100
[PATCH RESEND 09/10] via-cuda: Add support for Egret system controller Finn Thain <fthain@telegraphics.com.au> - 2017-01-01 02:00 +0100
[PATCH RESEND 03/10] via-cuda: Add TREQ, TIP and TACK signal helpers Finn Thain <fthain@telegraphics.com.au> - 2017-01-01 02:00 +0100
[PATCH RESEND 07/10] via-cuda: Use spinlock_irq_save/restore instead of enable/disable_irq Finn Thain <fthain@telegraphics.com.au> - 2017-01-01 02:00 +0100
csiph-web