lkml.org 
[lkml]   [2017]   [Mar]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v7 3/3] printk: fix double printing with earlycon
Hello,

On (03/17/17 16:43), Aleksey Makarov wrote:
[..]
> +static void ensure_preferred_is_last(int i)
> +{
> + int last;
> +
> + for (last = MAX_CMDLINECONSOLES - 1;
> + last >= 0 && !console_cmdline[last].name[0];
> + last--)
> + ;
> +
> + BUG_ON(last < 0);

let's not panic().


a nitpick, console swap can be done as

if (i != last)
swap(console_cmdline[i], console_cmdline[last]);
preferred_console = last;


-ss

\
 
 \ /
  Last update: 2017-03-20 07:17    [W:0.354 / U:0.064 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site