From patchwork Fri Nov 6 21:49:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 320844 Delivered-To: patch@linaro.org Received: by 2002:a92:7b12:0:0:0:0:0 with SMTP id w18csp1657032ilc; Fri, 6 Nov 2020 13:50:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJxSpYJganynNKpiDJZkIJN7Xe/CzGnBX9OZHNTouvZiQ6hFivm/3xg2nLdtB1CclEaord/O X-Received: by 2002:a17:902:d695:b029:d6:a255:ae32 with SMTP id v21-20020a170902d695b02900d6a255ae32mr3286207ply.43.1604699410495; Fri, 06 Nov 2020 13:50:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604699410; cv=none; d=google.com; s=arc-20160816; b=PAT3JHUmQVrzMWmLwXUYNMyItqQm5xNQZzrdo5Bp3V68PX2Ul4AuntD5tIEHkboyTW 8djG8x6mKwkmVHjw6cbn0rlhWtNfHuYcT71eFEd1BResUJy9Puow7rqCrZFGFTeDUtfQ MzttVJPjnNZ5PN/tZNApBd9aYDKWuQl/QmR+i1c1RRwTnnpMajeXvPzYG97hOtZDgvYZ qE1HtMhlmRhL2koiDnrHXbwJqNrb+axWAawmJUpS92VeZX+ktsd6nd/nyXRXIwyRfUs3 4BHl/GePDrQkOJ2ModfD+yShgBUKKUS5MCRdN3iKRXjNI4nCgwd9hNPNdXX4fqZ7+rip JjeA== 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=l8R3mkubPvmSxWxRwQANtIkqmwHpFyJvBMuc1nj9aZA=; b=tdBPcdZ05ePllNKdRr0xVlYddnz+PwWCwNquFbw6W7fJfUlbzhOabRAQj32zcPYF7j SaFZYyoiikBa4GksfRsUGob5Oe1k2ntrh0ZOnwaHSNw2UvCB4Wmir1MBaMpYBf1bNRRY QMdAGQD0Hojl/3g/v7afKk8c6ez38TCrdUBy6FmLK5G4Km3VRotah65T8yKaOM6DnbwZ 9TLRomhgV27GjuPtIo2izOVQdHFd+c4RRi47mzyC9d7qzjr239TDCJG3YydsKDwBiTKw a5h/bx9ILrqPTVySsY+inRzOgnJeYIKg1GXl8MypbYFz0ysuhP97itliQadVT4jtsoiw jJhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=TRvyCyTn; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 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. [131.252.210.177]) by mx.google.com with ESMTPS id e18si1968029pjp.77.2020.11.06.13.50.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Nov 2020 13:50:10 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=TRvyCyTn; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 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 570056EB23; Fri, 6 Nov 2020 21:50:02 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm1-x344.google.com (mail-wm1-x344.google.com [IPv6:2a00:1450:4864:20::344]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2177C6EB22 for ; Fri, 6 Nov 2020 21:49:58 +0000 (UTC) Received: by mail-wm1-x344.google.com with SMTP id v5so2842386wmh.1 for ; Fri, 06 Nov 2020 13:49:58 -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=SmOPpMPfhIiNWLmfD425Vh4v6mCQcNCmoMGuMYmd5/A=; b=TRvyCyTnH/kQfSvaUF+4Mph7uYU4vkWmNwmMg9+BDBN6t+igCS95yEeZ4LEqh4XUXD R8eISkv5gAP1hNdQMKo8Ygf8Gve+fObVMUpbtkUZRz3t9vj+Rl5hLbsgS8TFMxYL1psx k2F/jE4BkilaJVkYfuqAELthkI0vmyfkkO8Sa7LPXqf0E8s41v60oHpJqCPM9CYOUw93 kFpqUD4NcLPRLJidrtSOKH515bDJ0/3XSArh4XbtdFHSMyCN2yhSMT34nqX25CCKGZpC k3MoG3RpKjMZ29E2uQ4EUbT3Dc9v20vXEg8ajge2Yhd2lTgTdopSaE0V/2USYSKYzNG2 OhGA== 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=SmOPpMPfhIiNWLmfD425Vh4v6mCQcNCmoMGuMYmd5/A=; b=EarrfABm0pbNEn34VtNOK2h08sVAcCVmRjK/Pz9om/ua65iY1ty4UUpf9BTTZosShd YbPVZFJgeh3YvzDX6dcjYyPmS8N1R0ukZayy48oa9+/T1IYNMilq9aMwCkt0RTd/S+wI vZnf6vtE3EnqXqGNVNJyG4+sAmBGWj95ka+Z4kFh8WXO83mVWGRaQJ90XyW3e7gY0RU3 HDWe912LllgqR6hccFFkC4rAw220S8TqgRV/U1/lXcysz2j41UvnYwbNo0xi/pdCHfe4 aylmGdt6O+AJRW87oUyGb40CjnlOpHZjmTcikZgH5ng8ffAqfXmGjwgvsZTRxtlIr0GV x/Sg== X-Gm-Message-State: AOAM532AEdw8exMOGoFOUgD/NyphKXUoliDKGr49COVFwvRBrLg9LDd0 B8TiculKkaXYQtDp/YuWcoGlKw== X-Received: by 2002:a1c:c90b:: with SMTP id f11mr1681391wmb.54.1604699396872; Fri, 06 Nov 2020 13:49:56 -0800 (PST) Received: from dell.default ([91.110.221.236]) by smtp.gmail.com with ESMTPSA id t199sm3981084wmt.46.2020.11.06.13.49.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Nov 2020 13:49:56 -0800 (PST) From: Lee Jones To: lee.jones@linaro.org Subject: [PATCH 03/19] drm/selftests/test-drm_dp_mst_helper: Move 'sideband_msg_req_encode_decode' onto the heap Date: Fri, 6 Nov 2020 21:49:33 +0000 Message-Id: <20201106214949.2042120-4-lee.jones@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201106214949.2042120-1-lee.jones@linaro.org> References: <20201106214949.2042120-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 , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" There is too much data being stored on the stack. 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:168:1: warning: the frame size of 1072 bytes is larger than 1024 bytes [-Wframe-larger-than=] Cc: David Airlie Cc: Daniel Vetter Cc: dri-devel@lists.freedesktop.org Signed-off-by: Lee Jones --- drivers/gpu/drm/selftests/test-drm_dp_mst_helper.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 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 e00bdc557f880..6b4759ed6bfd4 100644 --- a/drivers/gpu/drm/selftests/test-drm_dp_mst_helper.c +++ b/drivers/gpu/drm/selftests/test-drm_dp_mst_helper.c @@ -122,7 +122,7 @@ sideband_msg_req_encode_decode(struct drm_dp_sideband_msg_req_body *in) { struct drm_dp_sideband_msg_req_body *out; struct drm_printer p = drm_err_printer(PREFIX_STR); - struct drm_dp_sideband_msg_tx txmsg; + struct drm_dp_sideband_msg_tx *txmsg; int i, ret; bool result = true; @@ -130,8 +130,12 @@ sideband_msg_req_encode_decode(struct drm_dp_sideband_msg_req_body *in) if (!out) return false; - drm_dp_encode_sideband_req(in, &txmsg); - ret = drm_dp_decode_sideband_req(&txmsg, out); + txmsg = kzalloc(sizeof(*txmsg), GFP_KERNEL); + if (!txmsg) + return false; + + drm_dp_encode_sideband_req(in, txmsg); + ret = drm_dp_decode_sideband_req(txmsg, out); if (ret < 0) { drm_printf(&p, "Failed to decode sideband request: %d\n", ret); @@ -166,6 +170,7 @@ sideband_msg_req_encode_decode(struct drm_dp_sideband_msg_req_body *in) out: kfree(out); + kfree(txmsg); return result; }