Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp5382674imb; Thu, 7 Mar 2019 14:27:25 -0800 (PST) X-Google-Smtp-Source: APXvYqzWkNlwc/Z1gOPZj9RE+ZKprgiyUI1XFswBqUVSuEdGm9pGdnTslhRbKLVlevNCXBk1CZct X-Received: by 2002:aa7:9211:: with SMTP id 17mr15011814pfo.220.1551997645077; Thu, 07 Mar 2019 14:27:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551997645; cv=none; d=google.com; s=arc-20160816; b=q/VleycjW0aFEzACZwouzu0IAOl4TBfmL6UpuDMyKSwXb7KezIpmfLlP44520bu7t5 n3tULe58BPRQMjvs1ZqvilXlnbIDzrTeaEhvnGxGMqKhbxZJ7ApxNs7QS2eBk2nDaufy 7FseJ54ygZJF/ncejp9Hi2xtUxUQoECndYG9hk/O4hzftJ50QdXkZiWIRKmPvqcG/JWt 5jv9WillGRMhtCHWkmNrVm1hRy/OC+rIeH/0NWj8bWLhBj3UmZ38M1Uy2nQSHpk2TEEA dLYFLMzUtQh/7gGWyedbwLayHy2RDS/23iIItIXeFHoDUYjQf58uxtp2Dwc2hfd3epfF h9iA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=tUJgMnuKuf55+FYpU2WmLf4w+CdzngJ4XWM3G1QEr5A=; b=d/KsP7LMMvYyySqE8b1WqxxtZph6a9RQ6OFlKP8uAoR7pCKQxcZBWWVEIioMD7Cbws plk2CdPhuV6asHkw1QSBfA+boHOemkNFQACIDAmWUC790pWV8MOY2SuLWT2CmgKvi6et 9oPmjbHp6mb4mSWNiBbQzRzsy/IjxIY2PdVqIMcwfbbv7vRe1RDZZWILoPtSpghSsZdG 32pzZjPr0Fg2UJxfKHKPyvyTqtsiljV36gpVgPhZBXH1rvNHbrZAjXCwxvAVlQZhP158 x8+1kXxnsIWiR+R1Q8KOnKP31jrjmom6Mb0zEr5k9/o0kBkTqrlli28nMkpWJqw05gLH P7Vg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=hD64EKNJ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x6si5084235pfm.219.2019.03.07.14.27.09; Thu, 07 Mar 2019 14:27:25 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=hD64EKNJ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726267AbfCGW0X (ORCPT + 99 others); Thu, 7 Mar 2019 17:26:23 -0500 Received: from mail-ed1-f66.google.com ([209.85.208.66]:35956 "EHLO mail-ed1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726166AbfCGW0X (ORCPT ); Thu, 7 Mar 2019 17:26:23 -0500 Received: by mail-ed1-f66.google.com with SMTP id g9so14839849eds.3 for ; Thu, 07 Mar 2019 14:26:21 -0800 (PST) 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-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=Mop6H16G9gayyE12Ihk/hjqHr2/zRUsyXvaQyazQEG1ahxXmkApBd2oN5jro7j8dZo D4uSM2PkXxndSuHCig5c19KKFS0AiqesWZRD+swkaggFySaI1BlkQ7dLx1Enruwi7uda alTgIwFvBp7Lzi9VVlOfrg8MHu1P6Sfekj5njT/oYCSEFDb7SHysEGBK9+ZZcFl+qXmR 9fVWLcACbzsmUmglkOXbgYkiPOVf+ZKpAk364fn4qQQSlx5Khu8kTJvPuhuvcqCCROSN tDDAvb2V+C/3yuTrrPd0RsdBIRIZqLfLv2UlFqkgBshiPqVoMOaSW3Wg84owE6LYKwBY oL0g== X-Gm-Message-State: APjAAAWhSf48lgRebtZV2OfqIwmKvCC8sxatkLhSdB++UWecmeX1DKqJ kv1wfI/hr1zigZiMtHCH0dg= 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 Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com, Nick Desaulniers , Nathan Chancellor 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 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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; -- 2.21.0