From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH 4/4] dt-uart: support /chosen/stdout-path property. Date: Wed, 07 Jan 2015 17:04:55 +0000 Message-ID: <54AD6737.4070706@linaro.org> References: <1420644673.18631.101.camel@citrix.com> <1420644701-26776-4-git-send-email-ian.campbell@citrix.com> <54AD61F5.2080205@linaro.org> <1420649231.18631.123.camel@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1420649231.18631.123.camel@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Campbell Cc: stefano.stabellini@eu.citrix.com, tim@xen.org, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On 07/01/15 16:47, Ian Campbell wrote: > 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. Sounds good. Regards, -- Julien Grall