Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1651869

Re: [PATCH] platform/x86: wmi: Fix printing info about WDG structure

From Andy Shevchenko <andy.shevchenko@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH] platform/x86: wmi: Fix printing info about WDG structure
Date 2017-05-27 15:10 +0200
Message-ID <tLJDH-4so-9@gated-at.bofh.it> (permalink)
References <tLIxX-34o-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Sat, May 27, 2017 at 2:51 PM, Pali Rohár <pali.rohar@gmail.com> wrote:
> object_id and notify_id are in one union structure and their meaning is
> defined by flags. Therefore do not print notify_id for non-event block and
> do not print object_id for event block. Remove also reserved member as it
> does not have any defined meaning or type yet.
>
> As object_id and notify_id union members overlaps and have different types,
> it caused that kernel print to dmesg binary data. This patch eliminates it.

> -       pr_info("\tobject_id: %c%c\n", g->object_id[0], g->object_id[1]);
> -       pr_info("\tnotify_id: %02X\n", g->notify_id);

> -       pr_info("\treserved: %02X\n", g->reserved);

Do we need this? Commit message doesn't clarify.

> +       if (g->flags & ACPI_WMI_EVENT)
> +               pr_info("\tnotify_id: 0x%02X\n", g->notify_id);
> +       else

> +               pr_info("\tobject_id: %c%c\n", g->object_id[0], g->object_id[1]);

If this can still contain non-printable characters the %*pE can help instead.

-- 
With Best Regards,
Andy Shevchenko

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] platform/x86: wmi: Fix printing info about WDG structure Pali Rohár <pali.rohar@gmail.com> - 2017-05-27 14:00 +0200
  Re: [PATCH] platform/x86: wmi: Fix printing info about WDG structure Andy Shevchenko <andy.shevchenko@gmail.com> - 2017-05-27 15:10 +0200
    Re: [PATCH] platform/x86: wmi: Fix printing info about WDG structure Pali Rohár <pali.rohar@gmail.com> - 2017-05-27 15:20 +0200
      Re: [PATCH] platform/x86: wmi: Fix printing info about WDG structure Pali Rohár <pali.rohar@gmail.com> - 2017-05-27 15:30 +0200
      Re: [PATCH] platform/x86: wmi: Fix printing info about WDG structure Andy Shevchenko <andy.shevchenko@gmail.com> - 2017-05-27 15:40 +0200
        Re: [PATCH] platform/x86: wmi: Fix printing info about WDG structure Andy Shevchenko <andy.shevchenko@gmail.com> - 2017-05-27 22:50 +0200
        Re: [PATCH] platform/x86: wmi: Fix printing info about WDG structure Pali Rohár <pali.rohar@gmail.com> - 2017-05-27 22:50 +0200

csiph-web