Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1696949

RE: [PATCH 3/4] powerpc: pseries: only store the device node basename in full_name

From David Laight <David.Laight@ACULAB.COM>
Newsgroups linux.kernel
Subject RE: [PATCH 3/4] powerpc: pseries: only store the device node basename in full_name
Date 2017-07-26 12:10 +0200
Message-ID <u7rqq-7pw-3@gated-at.bofh.it> (permalink)
References <u7fSh-8jG-11@gated-at.bofh.it> <u7fSh-8jG-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Rob Herring
> Sent: 25 July 2017 22:44
> With dependencies on full_name containing the entire device node path
> removed, stop storing the full_name in nodes created by
> dlpar_configure_connector() and pSeries_reconfig_add_node().
...
>	dn = kzalloc(sizeof(*dn), GFP_KERNEL);
> 	if (!dn)
> 		return NULL;
> 
> 	name = (char *)ccwa + be32_to_cpu(ccwa->name_offset);
> -	dn->full_name = kasprintf(GFP_KERNEL, "%s/%s", path, name);
> +	dn->full_name = kasprintf(GFP_KERNEL, "%s", name);

Isn't this just strdup()?
Perhaps you should rename full_name to name - since it is no longer 'full'?

Maybe you could do a single malloc() for both 'dn' and the name?

	David

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 3/4] powerpc: pseries: only store the device node basename in full_name Rob Herring <robh@kernel.org> - 2017-07-25 23:50 +0200
  RE: [PATCH 3/4] powerpc: pseries: only store the device node  basename in full_name David Laight <David.Laight@ACULAB.COM> - 2017-07-26 12:10 +0200
    Re: [PATCH 3/4] powerpc: pseries: only store the device node basename  in full_name Rob Herring <robh@kernel.org> - 2017-07-26 16:40 +0200

csiph-web