From patchwork Mon Nov 16 17:40:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 324510 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:5ce:0:0:0:0 with SMTP id l14csp3507532ils; Mon, 16 Nov 2020 09:43:36 -0800 (PST) X-Google-Smtp-Source: ABdhPJyxQ0katp2Qd8I3hYYS4ABwsKvv69dcQeR3upR0nHpdB9YQTmVAYK373Z4JefWN04UHFhT6 X-Received: by 2002:a17:90b:1058:: with SMTP id gq24mr6947pjb.29.1605548535049; Mon, 16 Nov 2020 09:42:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605548535; cv=none; d=google.com; s=arc-20160816; b=mpljkE33Fc/WwcRXPjn4jM2eA9UjT4pMDVhHLqSfBpAwcstmOnS0VrgWwpcBNMHqRv XydrEG/ZKNhT5Q2IeOwn/XiK5fW6GaT5sQYcKbeEXvLUsdG7Ejmafm2eMWTNB8TGl4+1 dAzS+iSEwc2aTGN1AkwH8SNGje2n7hnwaQt60+KFts5/bpsYKHn4QEIArz7Id9vl1qrl 94jEBpokoXLUwyLlYdZSWsfWE/vin4HJv8zNBEY2Y9hfvQjccRuyqaZX0ZqmNF8byDg5 FcOo6TxXmP4ReI3p2cGOOeXO8Z/z+m2TOzxFmi1PvP6VEMGUeIO78xoIxtQzcqee4J8V tllw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mime-version:references:in-reply-to:message-id:date :subject:to:from:dkim-signature:delivered-to; bh=NNi1hZZefhmtpMpM7ZuHQPEg3kpDUjGnNKbm5u9QDpU=; b=Oby4RUVEepVbh/DzSd5L8c49gH9MGh3XTbPJ3v5f4l3bVRVnZ11qdLcHmF898exK1L VU2C7gQVBH5uYmS+cps4pyhE1UPNTzlKh5kcteKI6hdd6ZN+C7UukVL+E4HkN95YIGar AmwTY7zpomf4UNUEaR078negmDFXt/sd+iDwLjmti16u/qADnidfrWTdlhXwP6OErx7Q EKVljnBK7tKPLv10TR8n8XB473BhvSELzEdDddgQIHIPQLTx1XUHSL7LDVOhHnlETBwB nc5BQ2Ea+HOxplYtZoFBDge01jRcMj7+sEtXfpxyO12/gIM0jIuC3EaqdBTAkQpDo2zG aHxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=sU22MNf4; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [2610:10:20:722:a800:ff:fe36:1795]) by mx.google.com with ESMTPS id v21si30352pjr.37.2020.11.16.09.42.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Nov 2020 09:42:15 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) client-ip=2610:10:20:722:a800:ff:fe36:1795; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=sU22MNf4; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1F8D789FED; Mon, 16 Nov 2020 17:42:05 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wr1-x441.google.com (mail-wr1-x441.google.com [IPv6:2a00:1450:4864:20::441]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0F0FD6EA08 for ; Mon, 16 Nov 2020 17:42:03 +0000 (UTC) Received: by mail-wr1-x441.google.com with SMTP id b6so19669707wrt.4 for ; Mon, 16 Nov 2020 09:42:02 -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=TjcKYWuzDhqklR5qoTIUsTytnZe/lM+b0Bx4U4tTS3A=; b=sU22MNf45vVUHSsYOdy9fl9yIGywaq3clCbLYSUdwuJl0SOFI02Lsd0y793lP8J6Rk rPkBRR7UXN6FZZWxOCbado478weeCmgsuYDA2GENsiflFpTuvK+0sE2pkFQD1xqN3M63 zW6V3eyDvMX99Ec4jMu4ywyLi57RfvGLgaUwkywJ7QNJ040N40KGfN+YHqdl9CMF/z9x We/t8grpmbCU5c3UVZ1bHCbKDcJY4xcWcvl/OFHGBz9SwOE6y5t7HZyfNxZepyLrNsfx TrcS04JbRFhulNsEItHdk1Pgvb5ivEtH1MUNujY9SVgqgD+oiBNJUW4W5BuZSJ0cWA+t 1mgQ== 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=TjcKYWuzDhqklR5qoTIUsTytnZe/lM+b0Bx4U4tTS3A=; b=HpGckdyFWB4hpiAMC+HSCFXKG0IU2xNoeUQHhhcYzSir0TtzFoMerIdLSJDRnxVbLL Wm6Kz8Hk1VhcKDWZGMrbU4IzUflPdsLUa/+xCumW9V3MT6CO83clB6HDM9llfhHOIxMd Nd8kDE1jKSnhE0eQcrbO/jQ5nf2a71ypqr8kMwbD5vJVSK8DTveZA2Q5oXsIRmzfpJI3 a9fH64MpwAz6hRvB3DUpkrZvWMDYSd9QnckMipLFuXqEXVKc08JN7r115xQP/IVNamTo i4BBFoIgmE5C/t2wyJ0PN23O44n/7aNYBomIj/dKeiNTYKGL8iRiLOUBUB/5ZFZgfzH9 6eLg== X-Gm-Message-State: AOAM533Ypf6U10HGMHzAqGIWp7xcrSi1snEbO3ul0JprQ2ycOrrRCN84 D0saDAIXL/P7rIFCLGOB6sgTezs4Z5l66AeW X-Received: by 2002:adf:db4a:: with SMTP id f10mr20402689wrj.420.1605548521624; Mon, 16 Nov 2020 09:42:01 -0800 (PST) Received: from dell.default ([91.110.221.159]) by smtp.gmail.com with ESMTPSA id n10sm24667224wrx.9.2020.11.16.09.42.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Nov 2020 09:42:00 -0800 (PST) From: Lee Jones To: lee.jones@linaro.org Subject: [PATCH 29/42] drm/selftests/test-drm_dp_mst_helper: Place 'struct drm_dp_sideband_msg_req_body' onto the heap Date: Mon, 16 Nov 2020 17:40:59 +0000 Message-Id: <20201116174112.1833368-30-lee.jones@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201116174112.1833368-1-lee.jones@linaro.org> References: <20201116174112.1833368-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 Reviewed-by: Lyude Paul --- .../drm/selftests/test-drm_dp_mst_helper.c | 31 ++++++++++++------- 1 file changed, 20 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..e00bdc557f880 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,53 @@ 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); + if (!out) + return false; 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)