[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Tue, 4 Apr 2017 13:12:02 +0200
From: Petr Mladek <pmladek@...e.com>
To: Sergey Senozhatsky <sergey.senozhatsky.work@...il.com>
Cc: Aleksey Makarov <aleksey.makarov@...aro.org>,
linux-serial@...r.kernel.org, linux-kernel@...r.kernel.org,
Sudeep Holla <sudeep.holla@....com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Peter Hurley <peter@...leysoftware.com>,
Jiri Slaby <jslaby@...e.com>,
Robin Murphy <robin.murphy@....com>,
Steven Rostedt <rostedt@...dmis.org>,
"Nair, Jayachandran" <Jayachandran.Nair@...ium.com>,
Sergey Senozhatsky <sergey.senozhatsky@...il.com>
Subject: Re: [PATCH v8 3/3] printk: fix double printing with earlycon
On Thu 2017-03-30 14:55:46, Sergey Senozhatsky wrote:
> On (03/28/17 14:56), Petr Mladek wrote:
> [..]
> > > > Is it better? If not, I will send a version with console_cmdline_last.
> > >
> > > personally I'm fine with the nested loop. the latest version
> > > "for (last = MAX_CMDLINECONSOLES - 1; last >= 0;..."
> > >
> > > is even easier to read.
> >
> > The number of elements is bumped on a single location, so there
> > is not much to synchronize. The old approach was fine because
> > the for cycles were needed anyway, they started on the 0th element,
> > and NULL ended arrays are rather common practice.
> >
> > But we are searching the array from the end now. Also we use the
> > for cycle just to get the number here. This is not a common
> > practice and it makes the code more complicated and strange from
> > my point of view.
>
> I'm fine with either way :)
Alekesey, any chance to use the global variable to count used or point
to the last element?
I know that you have already spent a lot of time with it. It was great
work. But the current solution of the cycle looks weird to me.
Best Regards,
Petr
Powered by blists - more mailing lists