From patchwork Sun Jul 30 20:27:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Engestrom X-Patchwork-Id: 9870669 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 9A1AC603B4 for ; Sun, 30 Jul 2017 20:30:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8C79E2852A for ; Sun, 30 Jul 2017 20:30:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 81B182856B; Sun, 30 Jul 2017 20:30:22 +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 BFDFC2858E 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 DE5696E33D; Sun, 30 Jul 2017 20:29:59 +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 9220B6E2C2 for ; Sun, 30 Jul 2017 20:29:55 +0000 (UTC) Received: by mail-wm0-f66.google.com with SMTP id q189so22297851wmd.0 for ; Sun, 30 Jul 2017 13:29:55 -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:in-reply-to :references; bh=6JMVZqeXP7UEvKr6OKG1Z3ZvbN/q6j6qK0ulUlqifuo=; b=AJl1Yau62UYOMPpVLZnfDfQcHr5WmreBcmmlGYN/ZbDNWefJtvKwFjIeIOoW6Vwm32 gwvgl1khmxASt4oH3omF26OiMBOgbVE9evGzKT6xNpbulUreErlvNG1AMu8Fq5zVg9P7 GsAGth/fo7QCQed8CHvsn2n0vZOmjzN+kIR+MUNjreen8oOtaytVK+9OYx0Oetpom8xo obaQUcj3gK+UyATtjRTZFQb8xZVsNtKwfuTBTyQy/wCDBcgI6qFJ8MxFIE1bUfXgTvtI +5lDSRtFIoRkO9cEXQvaJQDRmhho7qi8PzfDL1cQwso7jPhAinpsmq+sJTO6pig0wP4m RXxg== X-Gm-Message-State: AIVw111zOYnXB6HFJa9XQNe+2ObDsgg4k7yCVr5fhzYcYEZCLsqABvmQ Ru1T0hiF1Jc/0divnW8= X-Received: by 10.28.97.133 with SMTP id v127mr10389185wmb.150.1501446594014; Sun, 30 Jul 2017 13:29:54 -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.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 30 Jul 2017 13:29:53 -0700 (PDT) From: Eric Engestrom To: dri-devel@lists.freedesktop.org Subject: [PATCH libdrm 2/3] freedreno/msm: remove dead error path Date: Sun, 30 Jul 2017 21:27:39 +0100 Message-Id: <20170730202740.27564-2-eric@engestrom.ch> X-Mailer: git-send-email 2.13.3 In-Reply-To: <20170730202740.27564-1-eric@engestrom.ch> References: <20170730202740.27564-1-eric@engestrom.ch> 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 `ring` cannot be non-null, so the label reduces to a simple return. Then, there is no point initialising `ring` just to overwrite it before anyone reads it. Signed-off-by: Eric Engestrom Reviewed-by: Rob Clark --- freedreno/msm/msm_ringbuffer.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/freedreno/msm/msm_ringbuffer.c b/freedreno/msm/msm_ringbuffer.c index c3b2eded..5b28feaa 100644 --- a/freedreno/msm/msm_ringbuffer.c +++ b/freedreno/msm/msm_ringbuffer.c @@ -589,12 +589,12 @@ drm_private struct fd_ringbuffer * msm_ringbuffer_new(struct fd_pipe *pipe, uint32_t size) { struct msm_ringbuffer *msm_ring; - struct fd_ringbuffer *ring = NULL; + struct fd_ringbuffer *ring; msm_ring = calloc(1, sizeof(*msm_ring)); if (!msm_ring) { ERROR_MSG("allocation failed"); - goto fail; + return NULL; } if (size == 0) { @@ -614,8 +614,4 @@ drm_private struct fd_ringbuffer * msm_ringbuffer_new(struct fd_pipe *pipe, ring_cmd_new(ring, size); return ring; -fail: - if (ring) - fd_ringbuffer_del(ring); - return NULL; }