From patchwork Thu Jan 4 19:37:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ladislav Michl X-Patchwork-Id: 10145581 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id DE8C66034B for ; Thu, 4 Jan 2018 19:37:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CDDC626256 for ; Thu, 4 Jan 2018 19:37:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C28B828844; Thu, 4 Jan 2018 19:37:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0A8F726256 for ; Thu, 4 Jan 2018 19:37:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752486AbeADThY (ORCPT ); Thu, 4 Jan 2018 14:37:24 -0500 Received: from eddie.linux-mips.org ([148.251.95.138]:53456 "EHLO cvs.linux-mips.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752463AbeADThY (ORCPT ); Thu, 4 Jan 2018 14:37:24 -0500 Received: (from localhost user: 'ladis' uid#1021 fake: STDIN (ladis@eddie.linux-mips.org)) by eddie.linux-mips.org id S23990435AbeADThXKGOBx (ORCPT ); Thu, 4 Jan 2018 20:37:23 +0100 Date: Thu, 4 Jan 2018 20:37:20 +0100 From: Ladislav Michl To: Bartlomiej Zolnierkiewicz Cc: linux-fbdev@vger.kernel.org, Bernie Thompson Subject: [PATCH v2 1/5] video: udlfb: Remove unnecessary local variable Message-ID: <20180104193720.GB22612@lenoch> References: <20180104193623.GA22612@lenoch> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20180104193623.GA22612@lenoch> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 'urb' is not needed and can be removed. Signed-off-by: Ladislav Michl --- Changes: - v2: None (just made patch #1) drivers/video/fbdev/udlfb.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/video/fbdev/udlfb.c b/drivers/video/fbdev/udlfb.c index 99ce445986b3..5f68f8c720ec 100644 --- a/drivers/video/fbdev/udlfb.c +++ b/drivers/video/fbdev/udlfb.c @@ -1919,7 +1919,6 @@ static struct urb *dlfb_get_urb(struct dlfb_data *dev) int ret; struct list_head *entry; struct urb_node *unode; - struct urb *urb = NULL; unsigned long flags; /* Wait for an in-flight buffer to complete and get re-queued */ @@ -1928,7 +1927,7 @@ static struct urb *dlfb_get_urb(struct dlfb_data *dev) atomic_set(&dev->lost_pixels, 1); pr_warn("wait for urb interrupted: %x available: %d\n", ret, dev->urbs.available); - goto error; + return NULL; } spin_lock_irqsave(&dev->urbs.lock, flags); @@ -1941,10 +1940,7 @@ static struct urb *dlfb_get_urb(struct dlfb_data *dev) spin_unlock_irqrestore(&dev->urbs.lock, flags); unode = list_entry(entry, struct urb_node, entry); - urb = unode->urb; - -error: - return urb; + return unode->urb; } static int dlfb_submit_urb(struct dlfb_data *dev, struct urb *urb, size_t len)