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: 320634 Delivered-To: patch@linaro.org Received: by 2002:a92:7b12:0:0:0:0:0 with SMTP id w18csp509678ilc; Thu, 5 Nov 2020 06:52:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJx85+QCACf5GwWjxIgJmB8WMckZp6Ed2IYgJ4vf3F/7GgkbG2xhmvFiZWs+Ln7yPf0ihlOg X-Received: by 2002:a17:902:fe07:b029:d6:88c5:f5d5 with SMTP id g7-20020a170902fe07b02900d688c5f5d5mr2508534plj.63.1604587960737; Thu, 05 Nov 2020 06:52:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604587960; cv=none; d=google.com; s=arc-20160816; b=k3lS/k2HxiMcu8e93kwLq+/ojqH4aSKzbscgaxZRUOuSEozujEszDdsKrIBYwnLd2Q k1dHtwdLywGkIMeugEie7cLPncatNV47Y7dxO/joI24XKepgvCx7MVws9mUjPEmLnV1S BWH6Ikp2fKITCNwd7C2aKNhY5YXSTI4kSsgsIhGOCfe86amQdSrg2cXYAhjfJgBWpDyp 4mZOf+lNi1GcwF5fjN7Z6OJUavoSmhNhdijQxKzETsN7ysmNkZVGfmzXN1cPRPmCsKhj WOW++bn5KFmAld4KI34WlYJotta1Du8cvn50HfVCLizzhQxh67zKNE5MSSpJvg0jPoT5 Sg4Q== 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=ea9Opy7bSO31BW0Jo+WRUklPtg9/RVMtEYuF1HtJcig=; b=UljvRWMwJzUnEJ48TB/P9129XraDns7rX0P4VfDelq3gLny6Inlvh89oZIFICQbwNU ETDxuOFBbbOq2ChDPOixHutTSIpwd+zgGjNNwRBALzpekCw17yegNFPeTawlpOkrERD5 vAjiHGfjv2pPKH5m7+LSRiGZV9Rp8xpssYl1WCbEC1HVkQ7IHQGC7hVtOXv9o7yqmvw+ PF9b2nosE3x4sc82Pxyrb3VQv0n3hpj/BoFEFIrm6efTYjvWy8kuke7gUDkWDBhO1HJe ZuK0GrlNdAb7IAD3d+EveISl9wME1RTZIsb6ELFso4nLWnWYC/042cSuDd6Mps6+zrWm PwWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=VlPjzCJT; 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 v13si1641094plo.162.2020.11.05.06.52.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Nov 2020 06:52:40 -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=VlPjzCJT; 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 707736EDA0; Thu, 5 Nov 2020 14:52:37 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org 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-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)