public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Marek Vasut <marex@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 04/10] g_dnl: Properly terminate string list.
Date: Thu, 29 Nov 2012 15:28:05 +0100	[thread overview]
Message-ID: <201211291528.05906.marex@denx.de> (raw)
In-Reply-To: <68C51816-7513-4F61-9E91-B2C7CF601793@antoniou-consulting.com>

Dear Pantelis Antoniou,

> Hi Marek,
> 
> On Nov 29, 2012, at 10:20 AM, Marek Vasut wrote:
> > Dear Pantelis Antoniou,
> > 
> >> Well, not terminating the list causes very interesting crashes.
> >> As in changing the vendor & product ID crashes. Fun.
> >> 
> >> Signed-off-by: Pantelis Antoniou <panto@antoniou-consulting.com>
> >> ---
> >> drivers/usb/gadget/g_dnl.c | 1 +
> >> 1 file changed, 1 insertion(+)
> >> 
> >> diff --git a/drivers/usb/gadget/g_dnl.c b/drivers/usb/gadget/g_dnl.c
> >> index 25da733..a5a4c1f 100644
> >> --- a/drivers/usb/gadget/g_dnl.c
> >> +++ b/drivers/usb/gadget/g_dnl.c
> >> @@ -69,6 +69,7 @@ static struct usb_device_descriptor device_desc = {
> >> static struct usb_string[] = {
> >> 
> >> 	{ 0, manufacturer, },
> >> 	{ 1, product, },
> >> 
> >> +	{  }		/* end of list */
> > 
> > So you're adding an uninited entry here? How'll this work?
> 
> This is very common idiom. It's not uninitialized, all the members are
> set to 0, including the char * members.
> 
> It is exactly the same method used in drivers/usb/gadget/ether.c

Blah, it's a matter of taste then (I prefer it explicit, but I don't really 
care).

Thanks for clearing this up.

Best regards,
Marek Vasut

  reply	other threads:[~2012-11-29 14:28 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-29  7:33 [U-Boot] [PATCH 00/10] USB: Gadget & DFU related fixes Pantelis Antoniou
2012-11-29  6:32 ` Marek Vasut
2012-11-29  8:05   ` Pantelis Antoniou
2012-11-29  7:33 ` [U-Boot] [PATCH 01/10] usb: Remove obsolete header file Pantelis Antoniou
2012-11-28 14:40   ` Lukasz Majewski
2012-11-28 15:42     ` Tom Rini
2012-11-28 15:45       ` Lukasz Majewski
2012-11-28 16:01     ` Lukasz Majewski
2012-11-28 17:13       ` Pantelis Antoniou
2012-11-28 17:46         ` Lukasz Majewski
2012-11-28 17:54           ` Pantelis Antoniou
2012-11-29  8:13             ` Lukasz Majewski
2012-11-29  8:19               ` Pantelis Antoniou
2012-11-29  8:07           ` Pantelis Antoniou
2012-11-29  7:33 ` [U-Boot] [PATCH 02/10] usb: Fix bug when both DFU & ETHER are defined Pantelis Antoniou
2012-11-29  8:19   ` Marek Vasut
2012-11-29  7:33 ` [U-Boot] [PATCH 03/10] g_dnl: Issue connect/disconnect as appropriate Pantelis Antoniou
2012-11-29  7:33 ` [U-Boot] [PATCH 04/10] g_dnl: Properly terminate string list Pantelis Antoniou
2012-11-28 15:20   ` Lukasz Majewski
2012-11-29  8:20   ` Marek Vasut
2012-11-29 13:22     ` Pantelis Antoniou
2012-11-29 14:28       ` Marek Vasut [this message]
2012-11-29  7:33 ` [U-Boot] [PATCH 05/10] dfu: Only perform DFU board_usb_init() for TRATS Pantelis Antoniou
2012-11-28 14:47   ` Lukasz Majewski
2012-11-28 15:52     ` Tom Rini
2012-11-28 16:08       ` Lukasz Majewski
2012-11-29 17:42         ` Tom Rini
2012-11-29 23:14           ` Lukasz Majewski
2012-11-30  1:57             ` Tom Rini
2012-12-17 14:28     ` Tom Rini
2012-12-17 17:37       ` Lukasz Majewski
2012-12-17 17:45         ` Tom Rini
2012-11-29  7:33 ` [U-Boot] [PATCH 06/10] dfu: Fix crash when wrong number of arguments given Pantelis Antoniou
2012-11-28 15:17   ` Lukasz Majewski
2012-11-29  7:33 ` [U-Boot] [PATCH 07/10] dfu: Send correct DFU response from composite_setup Pantelis Antoniou
2012-11-29  7:33 ` [U-Boot] [PATCH 08/10] dfu: Properly zero out timeout value Pantelis Antoniou
2012-11-28 15:23   ` Lukasz Majewski
2012-11-29  7:33 ` [U-Boot] [PATCH 09/10] dfu: Add a partition type target Pantelis Antoniou
2012-11-29  7:33 ` [U-Boot] [PATCH 10/10] dfu: Support larger than memory transfers Pantelis Antoniou
2012-11-29  8:20 ` [U-Boot] [PATCH 00/10] USB: Gadget & DFU related fixes 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=201211291528.05906.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