[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210526152835.GE543307@dell>
Date: Wed, 26 May 2021 16:28:35 +0100
From: Lee Jones <lee.jones@...aro.org>
To: Sergei Shtylyov <sergei.shtylyov@...il.com>
Cc: linux-kernel@...r.kernel.org,
Mathias Nyman <mathias.nyman@...el.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
linux-usb@...r.kernel.org
Subject: Re: [PATCH 21/24] usb: host: xhci: Move array of structs from the
stack onto the heap
On Wed, 26 May 2021, Sergei Shtylyov wrote:
> On 5/26/21 5:44 PM, Lee Jones wrote:
>
> [...]
> >>> 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 <mathias.nyman@...el.com>
> >>> Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
> >>> Cc: linux-usb@...r.kernel.org
> >>> Signed-off-by: Lee Jones <lee.jones@...aro.org>
> >>> ---
> >>> drivers/usb/host/xhci.c | 8 +++++++-
> >>> 1 file changed, 7 insertions(+), 1 deletion(-)
> >>>
> >>> 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
> >> [...]
> >>> @@ -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);
> >>
> >> Why not kcalloc()?
> >
> > No particular reason. Muscle memory I guess.
> >
> > Happy either way.
>
> kcalloc( is designed for allocatiung arrays and clearing them, like calloc(),
> so let's stick wuth it...
No problem. Will fix.
--
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog
Powered by blists - more mailing lists