[PATCH v3 23/29] acpi: Convert part of acpi_table to use acpi_ctx

Simon Glass sjg at chromium.org
Wed Apr 8 04:57:28 CEST 2020


Hi Andy,

On Fri, 3 Apr 2020 at 07:24, Andy Shevchenko
<andriy.shevchenko at linux.intel.com> wrote:
>
> On Mon, Mar 30, 2020 at 05:12:59PM -0600, Simon Glass wrote:
> > The current code uses an address but a pointer would result in fewer
> > casts. Also it repeats the alignment code in a lot of places so this would
> > be better done in a helper function.
> >
> > Update write_acpi_tables() to make use of the new acpi_ctx structure,
> > adding a few helpers to clean things up.
>
> ...
>
> > +void acpi_align(struct acpi_ctx *ctx);
>
> > +void acpi_align64(struct acpi_ctx *ctx);
>
> In the code, it will be not understandable the difference.
> align without number would be good if the function only single one.
>
> So, align16() much better.

We had this discussion previously and changed it to what we have now
in v3. I feel it is a matter of preference.

>
> > +void acpi_inc(struct acpi_ctx *ctx, uint amount);
>
> inc with amount is not inc, it's rather add.

Increment by one, or increment by an amount. The word 'add' would be
very confusing here, since we are not adding anything to the ACPI
table.

>
> > + * acpi_inc_align() - Increment the ACPI output pointer by a bit and align
>
> Align how?

Will update the comment

>
REgardsm

Simon


More information about the U-Boot mailing list