[lkml]   [2019]   [Mar]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH v2 2/7] x86/boot: Introduce helpers for serial I/O
On Tue, Mar 19, 2019 at 09:43:20PM +0300, Andy Shevchenko wrote:
> As preparatory to enable earlyprintk on non-standard ports on x86,
> introduce serial_in() and serial_out() helpers to perform serial I/O.
> No functional change intended.


> +/* Assign serial I/O accessors */
> +static void early_serial_use_io_accessors(void)
> +{
> + /* These will always be IO based ports */
> + serial_in = io_serial_in;
> + serial_out = io_serial_out;
> +}

This and the early_serial_use_mmio_accessors() in a later patch is just
silly because you need to export and forward-declare those serial_in and
serial_out function pointers in a bunch of places.

Just define exactly *two* simple functions serial_in() and serial_out()
which have enough logic to decide whether to do serial IO or MMIO and
put all that logic in those functions. No need for all that function
pointer assignment "fun".



Good mailing practices for 400: avoid top-posting and trim the reply.

 \ /
  Last update: 2019-03-28 13:34    [W:0.086 / U:20.596 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site