From patchwork Thu Jan 26 11:44:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Chris Wilson X-Patchwork-Id: 9538921 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 6208760429 for ; Thu, 26 Jan 2017 11:44:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 411F6280D0 for ; Thu, 26 Jan 2017 11:44:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3198A28174; Thu, 26 Jan 2017 11:44:17 +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=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID 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 AA803280D0 for ; Thu, 26 Jan 2017 11:44:16 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 621E36EB50; Thu, 26 Jan 2017 11:44:14 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm0-x244.google.com (mail-wm0-x244.google.com [IPv6:2a00:1450:400c:c09::244]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9D4F36EB50 for ; Thu, 26 Jan 2017 11:44:12 +0000 (UTC) Received: by mail-wm0-x244.google.com with SMTP id c85so49697905wmi.1 for ; Thu, 26 Jan 2017 03:44:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id; bh=4AWRF8Ui2Mok3Kv2vCJSOyLumeCbEQbo8xlf3WaXTSU=; b=JiVlXIzhtwMO7QuLFoooClxV23w4iB6aFIVclqmBz4viOXwFjybmmUb9CQYM1CCZOA LHJMV4Zvwaxzw08gdaQusOlNzouaT+fxiakf1mi7BFSkzArlg3hPHyxq4NKH6Q57ZUJT I6ySTc89k8SQh9nRXJ2Cqz3qjnYgCXxRbzUfN6chYSIzL5gt9prdAooakEAKWT5YAL/x zJqdbllF1QJj5QzUXQVzartLt4t6hJ9ZGoVbghXOK4BjGSIGMyQ9jZSAI2Zry5q1ONPG T0QPPY/hjbh0CdxzzMFhV52+W8ecB4O6CDn3AVMBinNLTYWPmmwsZjsC9zfUplyr3egS qXsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=4AWRF8Ui2Mok3Kv2vCJSOyLumeCbEQbo8xlf3WaXTSU=; b=jBdZltDC4mcXhHrSK7NRndlx1b1QTiemOm0+SDUI8A0B6AIFeRxTX2hqC/73YxZT0m 4e2D99gLVgCzUe4aRt9/KP5TGwuWmdUPZZ+YUjWC2Gi4p4/uEUJB2HDgW2X5cH1wjsGF CY0iaL26yyLy6DO8syfE/IjKfrs3Nl20YWV+Dno6/fMqhBVjDd/IiAxI9JBUqYnXrx13 GpZjWkR+0k9eBoSAu7+Ai8V65QZQ5/i1TEKHA/woPjoZjwamKGdrBfiBM5pv9vQVXE5j XfC2ufN7qH8aOwVr3ja1hXWZve1/M1m0n2tANfsaBuIM5b7wlm1X6COu4WzQK0kg2s2c A8dA== X-Gm-Message-State: AIkVDXJQ+sG7/uBtkwMzQNMeCAnsmXnNfQY97wnr6l89cbCn2QE5fL4QEoUY6/sCGJtuzw== X-Received: by 10.223.163.201 with SMTP id m9mr2528804wrb.66.1485431051196; Thu, 26 Jan 2017 03:44:11 -0800 (PST) Received: from haswell.alporthouse.com ([78.156.65.138]) by smtp.gmail.com with ESMTPSA id m29sm2123803wrm.38.2017.01.26.03.44.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Jan 2017 03:44:10 -0800 (PST) From: Chris Wilson To: dri-devel@lists.freedesktop.org Subject: [PATCH] drm: Silence the compiler for drm_mode_get_hv_timings() Date: Thu, 26 Jan 2017 11:44:09 +0000 Message-Id: <20170126114409.9115-1-chris@chris-wilson.co.uk> X-Mailer: git-send-email 2.11.0 Cc: Alex Deucher , Daniel Vetter 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 Since moving drm_crtc_get_hv_timings() into drm_modes.c, the compiler has been able to get smarter and spots that drm_mode_copy() is trying to preserve garbage from the stack. Fixes: 196cd5d3758c ("drm: s/drm_crtc_get_hv_timings/drm_mode_get_hv_timings/") Signed-off-by: Chris Wilson Cc: Daniel Vetter Cc: Alex Deucher Reviewed-by: Ville Syrjälä Reviewed-by: Alex Deucher --- drivers/gpu/drm/drm_modes.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c index 73ed6399c3fb..a8616b1a8d22 100644 --- a/drivers/gpu/drm/drm_modes.c +++ b/drivers/gpu/drm/drm_modes.c @@ -808,9 +808,8 @@ EXPORT_SYMBOL(drm_mode_vrefresh); void drm_mode_get_hv_timing(const struct drm_display_mode *mode, int *hdisplay, int *vdisplay) { - struct drm_display_mode adjusted; + struct drm_display_mode adjusted = *mode; - drm_mode_copy(&adjusted, mode); drm_mode_set_crtcinfo(&adjusted, CRTC_STEREO_DOUBLE_ONLY); *hdisplay = adjusted.crtc_hdisplay; *vdisplay = adjusted.crtc_vdisplay;