From: Marek Vasut <marex@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/2] usb: r8a66597: Fix initilization size of r8a66597 info, structure
Date: Thu, 17 Apr 2014 16:09:00 +0200 [thread overview]
Message-ID: <201404171609.00881.marex@denx.de> (raw)
In-Reply-To: <534F8ECD.50604@renesas.com>
On Thursday, April 17, 2014 at 10:20:29 AM, yasuhisa umano wrote:
> Initialization of r8a66597 info structure is not enough.
> Because initilization was used size of pointer.
> This fixes that use size of r8a6659 info structure.
>
> Signed-off-by: Yasuhisa Umano <yasuhisa.umano.zc@renesas.com>
> ---
> drivers/usb/host/r8a66597-hcd.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/usb/host/r8a66597-hcd.c
> b/drivers/usb/host/r8a66597-hcd.c index c58d2a9..8e82212 100644
> --- a/drivers/usb/host/r8a66597-hcd.c
> +++ b/drivers/usb/host/r8a66597-hcd.c
> @@ -807,7 +807,7 @@ int usb_lowlevel_init(int index, enum usb_init_type
> init, void **controller)
>
> R8A66597_DPRINT("%s\n", __func__);
>
> - memset(r8a66597, 0, sizeof(r8a66597));
> + memset(r8a66597, 0, sizeof(struct r8a66597));
Let's use sizeof(*r8a66597) instead . This is more scalable as you won't need to
adjust this code when you change the data type of the *r8a66597 pointer,
I will adjust that and apply with sizeof(*r8a66597); , does that work for you?
Best regards,
Marek Vasut
next prev parent reply other threads:[~2014-04-17 14:09 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-17 8:20 [U-Boot] [PATCH 2/2] usb: r8a66597: Fix initilization size of r8a66597 info, structure yasuhisa umano
2014-04-17 14:09 ` Marek Vasut [this message]
2014-04-18 2:26 ` Yasuhisa Umano
2014-04-18 13:57 ` Marek Vasut
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201404171609.00881.marex@denx.de \
--to=marex@denx.de \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox