public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: "Lothar Waßmann" <LW@KARO-electronics.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 5/5] fit: Introduce methods for applying overlays on fit-load
Date: Wed, 5 Jul 2017 08:32:20 +0200	[thread overview]
Message-ID: <20170705083220.3b0bf35a@karo-electronics.de> (raw)
In-Reply-To: <2067154.9qYUSksqAR@pebbles.site>

Hi,

On Wed, 5 Jul 2017 00:19:28 +0200 stefan.bruens at rwth-aachen.de wrote:
> On Dienstag, 4. Juli 2017 19:05:25 CEST Pantelis Antoniou wrote:
> > Hi Marek,
> > 
> > On Sat, 2017-07-01 at 16:11 +0200, Marek Vasut wrote:
> > > On 06/30/2017 06:23 PM, Pantelis Antoniou wrote:
> > > > Introduce an overlay based method for constructing a base DT blob
> > > > to pass to the kernel.
> > > > 
> > > > Both canned and runtime feature selection is supported.
> > > > 
> > > > Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
> > > 
> > > [...]
> > > 
> > > > @@ -1475,29 +1482,58 @@ int fit_conf_get_node(const void *fit, const
> > > > char *conf_uname)> > 
> > > >  		debug("Found default configuration: '%s'\n", conf_uname);
> > > >  	
> > > >  	}
> > > > 
> > > > +	s = strchr(conf_uname, '#');
> > > > +	if (s) {
> > > > +		len = s - conf_uname;
> > > > +		conf_uname_copy = malloc(len + 1);
> > > > +		if (!conf_uname_copy) {
> > > > +			debug("Can't allocate uname copy: '%s'\n",
> > > > +					conf_uname);
> > > > +			return -ENOMEM;
> > > > +		}
> > > > +		memcpy(conf_uname_copy, conf_uname, len);
> > > 
> > > Is that like strdup() here ?
> > 
> > No. The space allocated is not the full string, just the span until the
> > next #.
> 
> You could use strndup() to copy only the first n characters.
>  
or strsep() to tokenize (a copy of) the original string.
IMO using strdup() and strsep() makes the intent of this function
clearer, than the current code. 


Lothar Waßmann

  reply	other threads:[~2017-07-05  6:32 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-30 16:22 [U-Boot] [PATCH 0/5] uboot overlays and FIT image Pantelis Antoniou
2017-06-30 16:22 ` [U-Boot] [PATCH 1/5] libfdt.h: Introduce FDT_PATH_MAX Pantelis Antoniou
2017-07-01 14:01   ` Marek Vasut
2017-07-07  3:58     ` Simon Glass
2017-07-07  7:03       ` Pantelis Antoniou
2017-06-30 16:22 ` [U-Boot] [PATCH 2/5] libfdt_env.h: Add <malloc.h> in libfdt environment Pantelis Antoniou
2017-07-01 14:02   ` Marek Vasut
2017-07-04 16:53     ` Pantelis Antoniou
2017-07-07  3:58   ` Simon Glass
2017-06-30 16:23 ` [U-Boot] [PATCH 3/5] fdt: Allow stacked overlays phandle references Pantelis Antoniou
2017-07-01 14:07   ` Marek Vasut
2017-07-04 17:03     ` Pantelis Antoniou
2017-07-05  6:25     ` Lothar Waßmann
2017-07-07  3:58   ` Simon Glass
2017-07-07  7:02     ` Pantelis Antoniou
2017-07-14 13:51       ` Simon Glass
2017-06-30 16:23 ` [U-Boot] [PATCH 4/5] test: overlay: Add unit test for stacked overlay Pantelis Antoniou
2017-07-07  3:58   ` Simon Glass
2017-07-07  7:48   ` Moritz Fischer
2017-07-07  8:32     ` Marek Vasut
2017-07-07 10:33     ` Pantelis Antoniou
2017-06-30 16:23 ` [U-Boot] [PATCH 5/5] fit: Introduce methods for applying overlays on fit-load Pantelis Antoniou
2017-07-01 14:11   ` Marek Vasut
2017-07-04 17:05     ` Pantelis Antoniou
2017-07-04 22:19       ` stefan.bruens at rwth-aachen.de
2017-07-05  6:32         ` Lothar Waßmann [this message]
2017-07-28 18:48 ` [U-Boot] [PATCH 0/5] uboot overlays and FIT image Simon Glass
2017-07-28 19:20   ` Tom Rini

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=20170705083220.3b0bf35a@karo-electronics.de \
    --to=lw@karo-electronics.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