From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wolfgang Wallner Date: Thu, 12 Mar 2020 14:03:15 +0100 Subject: Antwort: Re: [PATCH v2 21/39] acpi: Convert part of acpi_table to use acpi_ctx In-Reply-To: References: , <20200309034504.149659-1-sjg@chromium.org> <20200308214442.v2.21.I93e1e33891714417335e1dd517982b18bf9f882f@changeid> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Simon, -----"Simon Glass" schrieb: ----- > Hi Wolfgang, > > On Wed, 11 Mar 2020 at 06:58, Wolfgang Wallner wrote: > > > > Hi Simon, > > > > -----"Simon Glass" schrieb: ----- > > > > > > 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. > > > > > > Signed-off-by: Simon Glass > > > --- > > > > > > Changes in v2: None > > > > > > arch/x86/lib/acpi_table.c | 88 +++++++++++++++++++-------------------- > > > include/acpi_table.h | 36 ++++++++++++++++ > > > lib/acpi/acpi_table.c | 22 ++++++++++ > > > test/dm/acpi.c | 28 +++++++++++++ > > > 4 files changed, 129 insertions(+), 45 deletions(-) > > > > > [..] > > > > +/** > > > + * acpi_align() - Align the ACPI output pointer to a 16-byte boundary > > > + * > > > + * @ctx: ACPI context > > > + */ > > > +void acpi_align(struct acpi_ctx *ctx); > > > > Nit: The function names acpi_align() and acpi_align_large() are both vague > > on the exact alignment that is used. > > How about acpi_align16() and acpi_align64() ? > > There is I think only one case where we use 64. Most of the time it is 16. So I thought it was a bit silly to put 16 in the function name - it is the standard alignment. > > Perhaps I should use align() and align64()? Yes, I'm fine with that. regards, Wolfgang