From patchwork Thu Nov 5 14:45:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 11884595 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E6C77C5517A for ; Thu, 5 Nov 2020 14:52:40 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7CBF521D81 for ; Thu, 5 Nov 2020 14:52:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="VlPjzCJT" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7CBF521D81 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 707736EDA0; Thu, 5 Nov 2020 14:52:37 +0000 (UTC) Received: from mail-wr1-x444.google.com (mail-wr1-x444.google.com [IPv6:2a00:1450:4864:20::444]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5188C6EDA0 for ; Thu, 5 Nov 2020 14:52:33 +0000 (UTC) Received: by mail-wr1-x444.google.com with SMTP id x7so2105568wrl.3 for ; Thu, 05 Nov 2020 06:52:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=DSkh58f2krzhp2hE3KFf5ZyOONS9hWGvZQYe4kveepQ=; b=VlPjzCJT3y6e/FnCd2xLEPBd0z7vGt4Qg/m+b0RlACokUoWDnR7rwn/cE/eawSN26W Wz2Vmh8dmVk3cTlLPul5wt3AlHqwThJYpazo4c8CHYlLlbi+um3zq0XC/BntQDQDlSug qP9xHZoWAqIhvGMCzQyBkgpS2fxEnGPkSCmwP4o0tV70AV7CwMxNJ4dHIVzUHDawwKnM N5OzXuMeIbtujOq7o6yjhUQubbYvD45CJls1gsJCnHgAiyv1oWrRGm42I+1RxN6LOq70 jYUJep8G9BsTpyns4E0uVhkbNw80eZTOMgIaaedtq1GBcTjO4/U4C4y6dYJ9oZ70BJk7 ocIw== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=DSkh58f2krzhp2hE3KFf5ZyOONS9hWGvZQYe4kveepQ=; b=Bq5CTVT9tS1WoGLwAe6z81Tg425CWKhGbj4dMsKRUWndEoUFZCPgCdCsNFT9clz7QO w7AWHnen7H2QPijbLnfXzZAorYmQUt0PA9Jif37oKvFSRM82XLCLKzwLa6upyoGH6KDn LsPSauS85WFof9zoNiMVw0Wnl5QOXG5xg5aVIY0JeJ7L5WgEbXRQJTNOpmmnIJJiBG2D MWxOYL/TcMfQPYK8kK53qP0JjTAE+FisupstMvKIepiN964zAdkvqWj9OEX2IOJcJZUj tYvIA2X0tv/p4K/8yWWYS5jdpnHuZ0l1EG+52mQ/U35plrb8agJsRn0ayTtvRaHQEA7O IasA== X-Gm-Message-State: AOAM532LQsks9iHFgP/9QRYWM26csvy58zihsSJezVDKJOBzNjUK8SGL oMxRaqfpBaAwtl7cXm69eaCYxg== X-Google-Smtp-Source: ABdhPJyLybY/q1JINhhp6tsqqnQa/WrE4fpJ0FtSt5uywWd1JtbavxdvLo7R9GEFsr/3kV4i58KbAw== X-Received: by 2002:adf:a2c2:: with SMTP id t2mr3530595wra.54.1604587951999; Thu, 05 Nov 2020 06:52:31 -0800 (PST) Received: from dell.default ([91.110.221.242]) by smtp.gmail.com with ESMTPSA id f5sm2631243wmh.16.2020.11.05.06.52.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Nov 2020 06:52:31 -0800 (PST) From: Lee Jones To: lee.jones@linaro.org Subject: [PATCH 14/19] gpu: drm: selftests: test-drm_dp_mst_helper: Place 'struct drm_dp_sideband_msg_req_body' onto the heap Date: Thu, 5 Nov 2020 14:45:12 +0000 Message-Id: <20201105144517.1826692-15-lee.jones@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201105144517.1826692-1-lee.jones@linaro.org> References: <20201105144517.1826692-1-lee.jones@linaro.org> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , David Francis , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The stack is too full. Fixes the following W=1 kernel build warning(s): drivers/gpu/drm/selftests/test-drm_dp_mst_helper.c: In function ‘sideband_msg_req_encode_decode’: drivers/gpu/drm/selftests/test-drm_dp_mst_helper.c:161:1: warning: the frame size of 1176 bytes is larger than 1024 bytes [-Wframe-larger-than=] Cc: David Airlie Cc: Daniel Vetter Cc: Lyude Paul Cc: David Francis Cc: dri-devel@lists.freedesktop.org Signed-off-by: Lee Jones --- .../drm/selftests/test-drm_dp_mst_helper.c | 29 ++++++++++++------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/selftests/test-drm_dp_mst_helper.c b/drivers/gpu/drm/selftests/test-drm_dp_mst_helper.c index 1d696ec001cff..0a539456f6864 100644 --- a/drivers/gpu/drm/selftests/test-drm_dp_mst_helper.c +++ b/drivers/gpu/drm/selftests/test-drm_dp_mst_helper.c @@ -120,44 +120,51 @@ sideband_msg_req_equal(const struct drm_dp_sideband_msg_req_body *in, static bool sideband_msg_req_encode_decode(struct drm_dp_sideband_msg_req_body *in) { - struct drm_dp_sideband_msg_req_body out = {0}; + struct drm_dp_sideband_msg_req_body *out; struct drm_printer p = drm_err_printer(PREFIX_STR); struct drm_dp_sideband_msg_tx txmsg; int i, ret; + bool result = true; + + out = kzalloc(sizeof(*out), GFP_KERNEL); drm_dp_encode_sideband_req(in, &txmsg); - ret = drm_dp_decode_sideband_req(&txmsg, &out); + ret = drm_dp_decode_sideband_req(&txmsg, out); if (ret < 0) { drm_printf(&p, "Failed to decode sideband request: %d\n", ret); - return false; + result = false; + goto out; } - if (!sideband_msg_req_equal(in, &out)) { + if (!sideband_msg_req_equal(in, out)) { drm_printf(&p, "Encode/decode failed, expected:\n"); drm_dp_dump_sideband_msg_req_body(in, 1, &p); drm_printf(&p, "Got:\n"); - drm_dp_dump_sideband_msg_req_body(&out, 1, &p); - return false; + drm_dp_dump_sideband_msg_req_body(out, 1, &p); + result = false; + goto out; } switch (in->req_type) { case DP_REMOTE_DPCD_WRITE: - kfree(out.u.dpcd_write.bytes); + kfree(out->u.dpcd_write.bytes); break; case DP_REMOTE_I2C_READ: - for (i = 0; i < out.u.i2c_read.num_transactions; i++) - kfree(out.u.i2c_read.transactions[i].bytes); + for (i = 0; i < out->u.i2c_read.num_transactions; i++) + kfree(out->u.i2c_read.transactions[i].bytes); break; case DP_REMOTE_I2C_WRITE: - kfree(out.u.i2c_write.bytes); + kfree(out->u.i2c_write.bytes); break; } /* Clear everything but the req_type for the input */ memset(&in->u, 0, sizeof(in->u)); - return true; +out: + kfree(out); + return result; } int igt_dp_mst_sideband_msg_req_decode(void *unused)