From patchwork Wed May 26 13:00:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 448201 Delivered-To: patch@linaro.org Received: by 2002:a02:7a1b:0:0:0:0:0 with SMTP id a27csp5199437jac; Wed, 26 May 2021 06:01:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzlUpCpThai41ZC/9krU9biaafYzvO2xoFt+XovgEEx7IMV5N9hdM64+eJfLFOzQiZxzCnL X-Received: by 2002:a17:906:f894:: with SMTP id lg20mr33523860ejb.355.1622034104428; Wed, 26 May 2021 06:01:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622034104; cv=none; d=google.com; s=arc-20160816; b=l/mUmysdP94qGxpvO+kQe3OzkUPlPn4xFPU5hx5WJeYfMhvF36E+yXFinjg5X7Q5R+ H2K0baOYDy/Jse3TImSIYzX4Iv/TwAEQlxywcdpjiyG1e4BAywKojJD1mudSiW4wfXal rt6gDMjjRXSY6dZFPSPDaoLMAa411REAvgILHw9NtChJtAsen8DbgzjKWkeKMpoHIAFp 0e8F2EDMjNV9is4n+Q4/RMXkH1DNKuk8lRDJRBY4ClG8He9bTQwzuh5PK7z9ex/BKwQG FxKb+eUSfTfPr6G/tSwY6C+SONoQwcOAa4ED5hTYXAl9ipuyZK1+1ODn2E+yYx3sjx8z 3ynw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Jb3Z8YQiJXIHCxHdQR6bpLMBiPX+oY6Ogmx9bytHFZg=; b=OXJ800R97/tpaM8EiCMISL8j3fOVzpJMHgaheMoR0O2HaZmFqStiPosJBENOz0dX/U r5FUjyOEyqcrmVq7p5qXobCoEsu/y47g0NU4LIr6oPmwPaRXNPQC3P6GmaBKIHjNa4EN 7wbFfW30cEEv7z0TeVF0XoDhMj0lKWuPqAQ1YdaNxYrVFGrX7bcGGo/n4kgokwIC0vmK Zs25a1QoIpajk9YrVO58z+9JKf4C4IlZtjlCEr2HL1kKTpl18eGsx2mr78AhXV87WWRs oqAsp/gxww7GHS9h15wT1KsB6H6RFh+FizH3+/FKs9F1RyHjpndWV0IIPTwFElgUMDgF jHmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EvVo2ect; spf=pass (google.com: domain of linux-usb-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-usb-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m9si20452093ejj.467.2021.05.26.06.01.44; Wed, 26 May 2021 06:01:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-usb-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EvVo2ect; spf=pass (google.com: domain of linux-usb-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-usb-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235152AbhEZNDM (ORCPT + 4 others); Wed, 26 May 2021 09:03:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41072 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235009AbhEZNCo (ORCPT ); Wed, 26 May 2021 09:02:44 -0400 Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [IPv6:2a00:1450:4864:20::42f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DCAB8C061354 for ; Wed, 26 May 2021 06:01:09 -0700 (PDT) Received: by mail-wr1-x42f.google.com with SMTP id g17so816835wrs.13 for ; Wed, 26 May 2021 06:01:09 -0700 (PDT) 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=Jb3Z8YQiJXIHCxHdQR6bpLMBiPX+oY6Ogmx9bytHFZg=; b=EvVo2ectQ9owwKk7Y/bcDbUANdvrdyNy+Bo8qjqFPN3hp+p5tqnmM/ZTHRFkAxmnLu zRMLaMQaC8SRDnvDEnogMxECQqs4qqg6IYn2DvCApUTGlZ3affwRK6s5AOy9sMM3AWte iXZ3pJunIwEEVyZQSm2oZhCHBv/zx7xUE/R+L8mncIao6jvSe9AQD7J+JsnodmxYm7BK usoRyCRnDUAzPd/R5rD804KwHEkiFOEehttu9iGTfu0cNC6WInb59jHRQ6lFg6GnYjIg Pr/0mkTZVVctHsLZaF/mhred28d73fN41aOlzBh84Fy4MTTXJ06KHKe7CZ6loLEUV8Qt KoWQ== 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=Jb3Z8YQiJXIHCxHdQR6bpLMBiPX+oY6Ogmx9bytHFZg=; b=UGLK5n44yTPODnv/fWN40lTg/7ZHwu7kHnEJp+ZNQyHsFGPf2eMFWM9ZkB88H2EtS0 pwc3FF+TRw8fYPtjNeBBcFO6etR/Yn4fOL82jCZFPwbN4TnPGF05l14HnSSwq06Busn4 IRU5TS1F8V61/mgdc2Q8Z2TDDcLR+uV1Yh6Bz3o/brdn+SowLljaFbq0lR/n9hhi8I1p 4LY0JG4UPfC467oJ3jl4mQE8NqUwmzuFrT7iiKILztgWAPJOPSti8EDh1OPJC2DB2k3r jgYXS25T+X5KlhZTeh3iwAtUJD1xXw57dF/TN5fl+hxyyeP9WxXQXWW3PEyyM3ug8z58 vggg== X-Gm-Message-State: AOAM533L8y76qQ8EvztFxQBAiOYWrsh5PP/l3M3E8tBtAbqd2AlF6ELI 655rGVwgqSpcK4ECug7IUo1O/Q== X-Received: by 2002:adf:e411:: with SMTP id g17mr32218603wrm.402.1622034068386; Wed, 26 May 2021 06:01:08 -0700 (PDT) Received: from dell.default ([91.110.221.223]) by smtp.gmail.com with ESMTPSA id y14sm6430036wmj.37.2021.05.26.06.01.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 May 2021 06:01:07 -0700 (PDT) From: Lee Jones To: lee.jones@linaro.org Cc: linux-kernel@vger.kernel.org, Mathias Nyman , Greg Kroah-Hartman , linux-usb@vger.kernel.org Subject: [PATCH 21/24] usb: host: xhci: Move array of structs from the stack onto the heap Date: Wed, 26 May 2021 14:00:34 +0100 Message-Id: <20210526130037.856068-22-lee.jones@linaro.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210526130037.856068-1-lee.jones@linaro.org> References: <20210526130037.856068-1-lee.jones@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Fixes the following W=1 kernel build warning(s): drivers/usb/host/xhci.c: In function ‘xhci_reserve_bandwidth’: drivers/usb/host/xhci.c:2859:1: warning: the frame size of 1032 bytes is larger than 1024 bytes [-Wframe-larger-than=] Cc: Mathias Nyman Cc: Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org Signed-off-by: Lee Jones --- drivers/usb/host/xhci.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) -- 2.31.1 diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index ac2a7d4288883..40ce4b4eb12ad 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c @@ -2773,7 +2773,7 @@ static int xhci_reserve_bandwidth(struct xhci_hcd *xhci, struct xhci_virt_device *virt_dev, struct xhci_container_ctx *in_ctx) { - struct xhci_bw_info ep_bw_info[31]; + struct xhci_bw_info *ep_bw_info; int i; struct xhci_input_control_ctx *ctrl_ctx; int old_active_eps = 0; @@ -2788,6 +2788,10 @@ static int xhci_reserve_bandwidth(struct xhci_hcd *xhci, return -ENOMEM; } + ep_bw_info = kzalloc(sizeof(*ep_bw_info) * 31, GFP_KERNEL); + if (!ep_bw_info) + return -ENOMEM; + for (i = 0; i < 31; i++) { if (!EP_IS_ADDED(ctrl_ctx, i) && !EP_IS_DROPPED(ctrl_ctx, i)) continue; @@ -2824,6 +2828,7 @@ static int xhci_reserve_bandwidth(struct xhci_hcd *xhci, * Update the number of active TTs. */ xhci_update_tt_active_eps(xhci, virt_dev, old_active_eps); + kfree(ep_bw_info); return 0; } @@ -2855,6 +2860,7 @@ static int xhci_reserve_bandwidth(struct xhci_hcd *xhci, &virt_dev->eps[i], virt_dev->tt_info); } + kfree(ep_bw_info); return -ENOMEM; }