Re: [PATCH 1/6] x86/platform/uv/BAU: Declare bau_operations struct after other BAU structs

From: Thomas Gleixner
Date: Thu Feb 16 2017 - 13:00:50 EST

On Tue, 14 Feb 2017, Andrew Banman wrote:

> We must declare bau_operations after the other BAU structs so that we may
> reference them in the bau_operations function declarations.

This changelog is misleading. I really had to look twice to figure out that
this is just a preparatory patch for adding stuff which references a bau
struct later. There is no 'MUST declare after'. You always can forward
declare structs when you only use a pointer in the struct op
declaration. Sure you can avoid it, but then please tell so, e.g.:

Move the bau_operations declaration after bau struct declaration so the
bau structs can be referenced when adding new functions to
bau_operations. That way we avoid forward declarations of the bau


> +/* Abstracted BAU functions */
> +struct bau_operations {
> + unsigned long (*read_l_sw_ack)(void);
> + unsigned long (*read_g_sw_ack)(int pnode);
> + unsigned long (*bau_gpa_to_offset)(unsigned long vaddr);
> + void (*write_l_sw_ack)(unsigned long mmr);
> + void (*write_g_sw_ack)(int pnode, unsigned long mmr);
> + void (*write_payload_first)(int pnode, unsigned long mmr);
> + void (*write_payload_last)(int pnode, unsigned long mmr);

I appreciate that you made them tabular aligned!