From patchwork Thu Mar 7 22:26:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Chancellor X-Patchwork-Id: 10844105 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BBF70922 for ; Fri, 8 Mar 2019 02:38:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9B0892F2FD for ; Fri, 8 Mar 2019 02:38:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8BA2D2F308; Fri, 8 Mar 2019 02:38:04 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED 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 3FC5C2F2FD for ; Fri, 8 Mar 2019 02:38:04 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BED2C6E268; Fri, 8 Mar 2019 02:37:59 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-ed1-x542.google.com (mail-ed1-x542.google.com [IPv6:2a00:1450:4864:20::542]) by gabe.freedesktop.org (Postfix) with ESMTPS id A6B506E231 for ; Thu, 7 Mar 2019 22:26:22 +0000 (UTC) Received: by mail-ed1-x542.google.com with SMTP id j89so14828887edb.9 for ; Thu, 07 Mar 2019 14:26:22 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=tUJgMnuKuf55+FYpU2WmLf4w+CdzngJ4XWM3G1QEr5A=; b=gp56lUo7P1S4Eoh9NAR4A3ArI1zdpcaLIeoRRd/g9UAAswfBDoEo9EJbzLiEao6EY4 wF546g30a6hyuIkBU3l8MvEvmx5lmOnuOt24o7q5z2ZxqD2vmy0EeccQhfZMTvZiu6wH kc5u+D5HFe6dwEf46+DVLheQt/akhGrli9Wq97jWmI05N2Gi0HBmd/IXs7Cs6bwcCcYn 26EintrSSCW9nOv7q3okAqQZkPdEcd5er97eTaaBUx19GdBvSZaAE1JSWzEV0lZKdkWV qfjo7KCFsRs3J3AHs01e+DlQ/t4A+yN3iQPatYmCrfI+xLOzRRlhm2zkDFPwDeZ8TSxM 6pug== X-Gm-Message-State: APjAAAWSfLCdIk/ikjwdLfN4uAJEKN8uJw39VdsdQ6jJILb8T75IR47I Q/ERXUm4Y++ET00xycqwTio= X-Google-Smtp-Source: APXvYqzclbHsjnrsA0Fl6OVwMXJ949Y/jZbNuErHaWod9+HLYsk+/O1dajKPW7s48h2fl9q7XO+FPA== X-Received: by 2002:a17:906:4bc8:: with SMTP id x8mr9294133ejv.114.1551997580995; Thu, 07 Mar 2019 14:26:20 -0800 (PST) Received: from localhost.localdomain ([2a01:4f9:2a:1fae::2]) by smtp.gmail.com with ESMTPSA id n25sm1668242edd.83.2019.03.07.14.26.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 Mar 2019 14:26:20 -0800 (PST) From: Nathan Chancellor To: VMware Graphics , Thomas Hellstrom , David Airlie , Daniel Vetter Subject: [PATCH] drm/vmwgfx: Zero initialize handle in vmw_execbuf_process Date: Thu, 7 Mar 2019 15:26:11 -0700 Message-Id: <20190307222611.18100-1-natechancellor@gmail.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 X-Patchwork-Bot: notify X-Mailman-Approved-At: Fri, 08 Mar 2019 02:37:58 +0000 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=tUJgMnuKuf55+FYpU2WmLf4w+CdzngJ4XWM3G1QEr5A=; b=hD64EKNJsp1TMp3aDJlV0VDJEqllqIfA7l3sJHLpru8SNfVDdPYhC4UO+H+kIsR4E1 tNmd8YPT30rKASkzFKiHnif5eO25ffu84s1vZQd6lkIlt7jRzVQvOdjiSI/r6V/Yj8DE h5ZYSbExYmw53cC42jnRk13l/m9pj8LEUqQO3/j9jqZV2PZ40zcj5hBamiIuFG3zwhAT 38mp+N8WyhOZHV4OE0Unwk++HtdCtoAIIauDOYYED7jPRdmgcmhbsQSLR1fN1QHeHA35 Z6lRDW7PscL9dY9Gcij9X0JvxQaM33Bx5qRphQIX2dJoShZPv9MipjZlmJRaVkGBTEca fUOA== X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: clang-built-linux@googlegroups.com, Nathan Chancellor , Nick Desaulniers , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP When building with -Wsometimes-uninitialized, Clang warns: drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c:3964:7: warning: variable 'handle' is used uninitialized whenever '?:' condition is false [-Wsometimes-uninitialized] It's not wrong; however, in practice, this is never an issue because the value of handle isn't used when user_fence_rep is NULL because vmw_execbuf_copy_fence_user returns immediately when that is the case. Just zero initialize this variable so that Clang no longer warns. Link: https://github.com/ClangBuiltLinux/linux/issues/397 Signed-off-by: Nathan Chancellor Reviewed-by: Nick Desaulniers Reviewed-by: Deepak Rawat --- drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c b/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c index 88b8178d4687..4ba06c2828a1 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c @@ -3829,7 +3829,7 @@ int vmw_execbuf_process(struct drm_file *file_priv, struct vmw_sw_context *sw_context = &dev_priv->ctx; struct vmw_fence_obj *fence = NULL; struct vmw_cmdbuf_header *header; - uint32_t handle; + uint32_t handle = 0; int ret; int32_t out_fence_fd = -1; struct sync_file *sync_file = NULL;