From patchwork Sun Jul 30 20:27:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Engestrom X-Patchwork-Id: 9870663 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 B319B60353 for ; Sun, 30 Jul 2017 20:30:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9F3A82852A for ; Sun, 30 Jul 2017 20:30:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9418D28584; Sun, 30 Jul 2017 20:30:21 +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=-3.7 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id BDD5E28595 for ; Sun, 30 Jul 2017 20:30:20 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1E46B6E2C2; Sun, 30 Jul 2017 20:29:56 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm0-f66.google.com (mail-wm0-f66.google.com [74.125.82.66]) by gabe.freedesktop.org (Postfix) with ESMTPS id E8C906E2C2 for ; Sun, 30 Jul 2017 20:29:53 +0000 (UTC) Received: by mail-wm0-f66.google.com with SMTP id r77so20321043wmd.2 for ; Sun, 30 Jul 2017 13:29:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=nc8oH/TR7pYbJIoIkOa3+VwK2NowTLOCKsKKewnIB+w=; b=K6DmOng47bLSVfdbdbJxSx2UIU6uQOe8xI86QL88dA57X6f4MyoeGM+rtkVQ3FTNVS Sy5gYVP3samvesGyLKLJqblG0kQ3A9T3vWcTCRCTYXougl+hqG/L0RwvVt8lTxW7iBuV dtfu+Wa6kr2PlXkQ6wluaIGMo6NbgT0+nZP94wpVucal+gbN7cxLRu2YOJoqt1nsxQ+9 Y3OSXIq1uwPWyWRkp7IPXiLehUGoN4DYBTFDEMIEtLerzd22ixHbZAjEFGk1spTUqr86 +nvk+1tlBEbtqk4LKXPK5IVIU391S0SlPt+5x9VB9Mo0ARn+RrpFipA0yywAfqoGg100 Y8Fw== X-Gm-Message-State: AIVw112cZNfJgMJ+LZVo6wCA9wNjHJzZlQNwCw2TPimGhvVeKvodNETP nF8idVNaWM/y/DExILM= X-Received: by 10.28.211.65 with SMTP id k62mr4667002wmg.89.1501446592174; Sun, 30 Jul 2017 13:29:52 -0700 (PDT) Received: from localhost.localdomain (host109-145-147-240.range109-145.btcentralplus.com. [109.145.147.240]) by smtp.gmail.com with ESMTPSA id 91sm27300320wrg.83.2017.07.30.13.29.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 30 Jul 2017 13:29:50 -0700 (PDT) From: Eric Engestrom To: dri-devel@lists.freedesktop.org Subject: [PATCH libdrm 1/3] freedreno: remove dead error path Date: Sun, 30 Jul 2017 21:27:38 +0100 Message-Id: <20170730202740.27564-1-eric@engestrom.ch> X-Mailer: git-send-email 2.13.3 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP `pipe` cannot be non-null, so the label reduces to a simple return. Then, there is no point initialising `pipe` just to overwrite it before anyone reads it. Signed-off-by: Eric Engestrom --- freedreno/freedreno_pipe.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/freedreno/freedreno_pipe.c b/freedreno/freedreno_pipe.c index 3f8c8342..e69cb28c 100644 --- a/freedreno/freedreno_pipe.c +++ b/freedreno/freedreno_pipe.c @@ -36,18 +36,18 @@ struct fd_pipe * fd_pipe_new(struct fd_device *dev, enum fd_pipe_id id) { - struct fd_pipe *pipe = NULL; + struct fd_pipe *pipe; uint64_t val; if (id > FD_PIPE_MAX) { ERROR_MSG("invalid pipe id: %d", id); - goto fail; + return NULL; } pipe = dev->funcs->pipe_new(dev, id); if (!pipe) { ERROR_MSG("allocation failed"); - goto fail; + return NULL; } pipe->dev = dev; @@ -57,10 +57,6 @@ fd_pipe_new(struct fd_device *dev, enum fd_pipe_id id) pipe->gpu_id = val; return pipe; -fail: - if (pipe) - fd_pipe_del(pipe); - return NULL; } void fd_pipe_del(struct fd_pipe *pipe)