From patchwork Thu Dec 1 06:09:33 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Finn Thain X-Patchwork-Id: 701377 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3tTnKK1zzmz9sfH for ; Thu, 1 Dec 2016 17:23:17 +1100 (AEDT) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3tTnKK19JtzDw5n for ; Thu, 1 Dec 2016 17:23:17 +1100 (AEDT) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from kvm5.telegraphics.com.au (kvm5.telegraphics.com.au [98.124.60.144]) by lists.ozlabs.org (Postfix) with ESMTP id 3tTn8J0ZJzzDvyC for ; Thu, 1 Dec 2016 17:15:27 +1100 (AEDT) Received: by kvm5.telegraphics.com.au (Postfix, from userid 502) id 6B6BD232E4; Thu, 1 Dec 2016 01:09:33 -0500 (EST) To: Benjamin Herrenschmidt , Geert Uytterhoeven Message-Id: <8154339c81046fb70b2b55fc65d8a1ad9d23f0d6.1480572271.git.fthain@telegraphics.com.au> In-Reply-To: References: From: Finn Thain Subject: [PATCH 02/10] via-cuda: Remove redundant temporary variable Date: Thu, 1 Dec 2016 01:09:33 -0500 (EST) X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-m68k@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" 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 Signed-off-by: Finn Thain --- 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 98ced65..4eb8a884 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; }