From patchwork Thu Nov 29 20:36:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 10705281 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 6DAF4109C for ; Thu, 29 Nov 2018 20:36:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 539A82F67F for ; Thu, 29 Nov 2018 20:36:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4452A2F9F5; Thu, 29 Nov 2018 20:36:57 +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,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 9EC912F67F for ; Thu, 29 Nov 2018 20:36:56 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7C6BA6E411; Thu, 29 Nov 2018 20:36:55 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qt1-x841.google.com (mail-qt1-x841.google.com [IPv6:2607:f8b0:4864:20::841]) by gabe.freedesktop.org (Postfix) with ESMTPS id A5A776E411 for ; Thu, 29 Nov 2018 20:36:54 +0000 (UTC) Received: by mail-qt1-x841.google.com with SMTP id k12so3546625qtf.7 for ; Thu, 29 Nov 2018 12:36:54 -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=QavUT5mKziNiFf4ft+NL166pNnjXZueZC3+Z90p9nsA=; b=GKQapYwx94cK4W6wDmQNIs4RjNk+N2vqqdiup9InQMGblkyi1lQWWrIB4jmwvatIgA wnJaswO8DL6MfBuOfc37BNdw4FEjHw/w67FenWN6kGYu0ojUJqyQRWAaRCO6DUeCfxRV ebGzYARGZmKapfM7xmT0oXZXcFU6rNv2zob4dHfq0BCMxSMsvUJOIpQaO4dtapi85D2t P4k+l9XnvINXZWShzIws40KjjczBuicImZ8Rz3c2uNLsuMj/2W1ojCEla7DtKiTUl1ZX 0TeVyrjrPWEN53YC+/LYguoDO7dNPU66RkrbZr1teEtCG42mH6q+TIrazC08MdZbb8s7 fGUw== X-Gm-Message-State: AA+aEWboI/AHdmKBoVeCOoZmdQmwZ+TqqTwe3wyR6akmuQ/C7c/A8FBp bkKAO062+zmoOHOvPpqQgbFuM31iCvnc9Q== X-Google-Smtp-Source: AFSGD/WE9pWwUVybw4JXcHFJQTyl10o7eeFHi63dekAiD04J5mwyLgTxPxtnRctpuQ3HSxndW8zkpg== X-Received: by 2002:ac8:4a10:: with SMTP id x16mr3084872qtq.164.1543523813769; Thu, 29 Nov 2018 12:36:53 -0800 (PST) Received: from rosewood.cam.corp.google.com ([2620:0:1013:11:ad55:b1db:adfe:3b9f]) by smtp.gmail.com with ESMTPSA id 126sm1283236qkj.70.2018.11.29.12.36.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 29 Nov 2018 12:36:53 -0800 (PST) From: Sean Paul To: dri-devel@lists.freedesktop.org Subject: [PATCH] drm: Fix compiler warning in drm_atomic_helper.c Date: Thu, 29 Nov 2018 15:36:48 -0500 Message-Id: <20181129203652.223634-1-sean@poorly.run> X-Mailer: git-send-email 2.20.0.rc0.387.gc7a69e6b6c-goog MIME-Version: 1.0 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: Maxime Ripard , David Airlie , Sean Paul , Sean Paul Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Sean Paul Kbuild was complaining about: >> drivers/gpu/drm/drm_atomic_helper.c:3169:27: warning: 'state' may be used uninitialized in this function [-Wmaybe-uninitialized] Now state can't actually be used uninitialized, but we'll assign a value anyways so it stops bellyaching. Fixes: b7ea04d299c7 ("drm: Add DRM_MODESET_LOCK_BEGIN/END helpers") Cc: Daniel Vetter Cc: Sean Paul Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: Sean Paul Cc: David Airlie Cc: dri-devel@lists.freedesktop.org Signed-off-by: Sean Paul Reviewed-by: Daniel Vetter --- drivers/gpu/drm/drm_atomic_helper.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c index 0d58c40aa4401..0ee83efeb94a4 100644 --- a/drivers/gpu/drm/drm_atomic_helper.c +++ b/drivers/gpu/drm/drm_atomic_helper.c @@ -3169,6 +3169,9 @@ struct drm_atomic_state *drm_atomic_helper_suspend(struct drm_device *dev) struct drm_atomic_state *state; int err; + /* This can never be returned, but it makes the compiler happy */ + state = ERR_PTR(-EINVAL); + DRM_MODESET_LOCK_ALL_BEGIN(dev, ctx, 0, err); state = drm_atomic_helper_duplicate_state(dev, &ctx);