[Skiboot] [PATCH v2 05/14] console: move mambo con_ops into the platform

Andrew Donnellan andrew.donnellan at au1.ibm.com
Tue Dec 20 17:57:18 AEDT 2016


On 20/12/16 17:03, Oliver O'Halloran wrote:
> There's no need for this to be in the skiboot core console code.
>
> Signed-off-by: Oliver O'Halloran <oohall at gmail.com>

A couple of minor comments below. Otherwise:

Reviewed-by: Andrew Donnellan <andrew.donnellan at au1.ibm.com>

> diff --git a/platforms/mambo/console.c b/platforms/mambo/console.c
> new file mode 100644
> index 000000000000..9bf4050b3a5d
> --- /dev/null
> +++ b/platforms/mambo/console.c
> @@ -0,0 +1,84 @@
> +/* Copyright 2015 IBM Corp.
> + *
> + * Licensed under the Apache License, Version 2.0 (the "License");
> + * you may not use this file except in compliance with the License.
> + * You may obtain a copy of the License at
> + *
> + *     http://www.apache.org/licenses/LICENSE-2.0
> + *
> + * Unless required by applicable law or agreed to in writing, software
> + * distributed under the License is distributed on an "AS IS" BASIS,
> + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
> + * implied.
> + * See the License for the specific language governing permissions and
> + * limitations under the License.
> + */
> +
> +#include <skiboot.h>
> +#include <device.h>
> +#include <console.h>
> +#include <chip.h>
> +#include <opal-api.h>
> +#include <opal-internal.h>
> +#include <time-utils.h>
> +#include <time.h>

This block can be reduced to skiboot.h and console.h.

> +
> +#include "mambo.h"
> +
> +int mambo_console_read(void)
> +{
> +	return callthru0(SIM_READ_CONSOLE_CODE);
> +}

This can be static and the extern in console.h dropped, though we still 
call mambo_console_write() from console.c.

> +static size_t mambo_con_write(const char *buf, size_t len)
> +{
> +	mambo_console_write(buf, len);
> +	return len;
> +}

This feels a bit redundant, idk.

-- 
Andrew Donnellan              OzLabs, ADL Canberra
andrew.donnellan at au1.ibm.com  IBM Australia Limited



More information about the Skiboot mailing list