public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: u-boot@lists.denx.de
Subject: [PATCH 2/2] x86: acpi: Add memset to initialize SPCR table
Date: Wed, 9 Sep 2020 16:09:20 +0300	[thread overview]
Message-ID: <20200909130920.GV1891694@smile.fi.intel.com> (raw)
In-Reply-To: <20200909123322.1684889-2-wolfgang.wallner@br-automation.com>

On Wed, Sep 09, 2020 at 02:33:21PM +0200, Wolfgang Wallner wrote:
> Add a missing memset to acpi_create_spcr().
> 
> The other acpi_create_xxxx() functions perform a memset on their
> structures, acpi_create_spcr() does not and as a result the contents of
> this table are partly uninitialized (and thus random after every reset).

Fixes: tag?
In any case, after addressing below,
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

> Signed-off-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com>
> ---
> 
>  arch/x86/lib/acpi_table.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/arch/x86/lib/acpi_table.c b/arch/x86/lib/acpi_table.c
> index 6b827bfa3f..054235843e 100644
> --- a/arch/x86/lib/acpi_table.c
> +++ b/arch/x86/lib/acpi_table.c
> @@ -252,6 +252,8 @@ static void acpi_create_spcr(struct acpi_spcr *spcr)
>  	int space_id;
>  	int ret = -ENODEV;
>  
> +	memset((void *)spcr, 0, sizeof(struct acpi_spcr));
> +
>  	/* Fill out header fields */
>  	acpi_fill_header(header, "SPCR");
>  	header->length = sizeof(struct acpi_spcr);

> @@ -359,6 +361,7 @@ static void acpi_create_spcr(struct acpi_spcr *spcr)
>  		spcr->baud_rate = 0;
>  
>  	/* Fix checksum */
> +
>  	header->checksum = table_compute_checksum((void *)spcr, header->length);
>  }

Unrelated change.

-- 
With Best Regards,
Andy Shevchenko

  reply	other threads:[~2020-09-09 13:09 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-09 12:33 [PATCH 1/2] x86: acpi: Fix calculation of DSDT length Wolfgang Wallner
2020-09-09 12:33 ` [PATCH 2/2] x86: acpi: Add memset to initialize SPCR table Wolfgang Wallner
2020-09-09 13:09   ` Andy Shevchenko [this message]
2020-09-09 14:35   ` Simon Glass
2020-09-09 13:08 ` [PATCH 1/2] x86: acpi: Fix calculation of DSDT length Andy Shevchenko
2020-09-09 13:11   ` Andy Shevchenko
2020-09-16 15:00     ` Wolfgang Wallner
2020-09-16 15:53       ` Andy Shevchenko
2020-09-09 14:35 ` Simon Glass

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200909130920.GV1891694@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox