From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: [PATCH 4/4] dt-uart: support /chosen/stdout-path property. Date: Wed, 7 Jan 2015 16:47:11 +0000 Message-ID: <1420649231.18631.123.camel@citrix.com> References: <1420644673.18631.101.camel@citrix.com> <1420644701-26776-4-git-send-email-ian.campbell@citrix.com> <54AD61F5.2080205@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <54AD61F5.2080205@linaro.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Julien Grall Cc: stefano.stabellini@eu.citrix.com, tim@xen.org, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Wed, 2015-01-07 at 16:42 +0000, Julien Grall wrote: > > + > > + if ( chosen ) > > + { > > + ret = dt_property_read_string(chosen, "stdout-path", &stdout); > > + if ( ret >= 0 ) > > + { > > + printk("Taking dtuart configuration from /chosen/stdout-path\n"); > > + strlcpy(opt_dtuart, stdout, sizeof(opt_dtuart)); > > The final string in opt_dtuart may be truncated if stdout is bigger than > 255 characters. > > I would add a check to avoid hours of debugging later. Good point. I suppose it may as well warn and continue: hypothetically the truncation might only affect some non-critical options so the console might actually work, so we might as well try. Ian.