From patchwork Sat May 27 11:51:17 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Pali_Roh=C3=A1r?= X-Patchwork-Id: 9751847 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4A1F56037E for ; Sat, 27 May 2017 11:51:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3F4642845C for ; Sat, 27 May 2017 11:51:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 33E3F2847A; Sat, 27 May 2017 11:51:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C64BF2845C for ; Sat, 27 May 2017 11:51:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756491AbdE0Lve (ORCPT ); Sat, 27 May 2017 07:51:34 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:36574 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756051AbdE0Lvd (ORCPT ); Sat, 27 May 2017 07:51:33 -0400 Received: by mail-wm0-f65.google.com with SMTP id k15so7954773wmh.3; Sat, 27 May 2017 04:51:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=BBZf9FNyRCX6LAYHcGfget29Rl84Awe/bPdNO2oLpKY=; b=NVe97s63MhuwbMGsquaB8PdxAFL/r/WY/g4OgUP+eo+bGOQFIQhZ94Q+d1kYDoT1Xu IQDsovY3akFGkZTfqvJwuOvuCRdPlOcE9xHuaQ/23Gg9yTihTqf4WlSrdz0FKrMDo7/y 6kRI3D7kpxH9Vi8Pht9IvMmHtGhmp3/rh4iNzHRllREPIcTO03RZ+yDVHW0R+K02bO/M AuQkBhqGc2CvOrOf7rmMAMVcFtAZzWSzzXgDn/1vGxKdH6XzSPmIEu8htRg3wxV1xKtU +9ChgjAYQvPObuzA+vDXg/7Y+VgxEOyTE9Pzyz7THv6e+MrIfZvJOFY7VgMHJgNBxrc7 ypJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=BBZf9FNyRCX6LAYHcGfget29Rl84Awe/bPdNO2oLpKY=; b=RY4s0/g5BUfq6qLmI5nuvlKp0acM5vG34WxoHAA0SItnK7JGYl2ExNSjuGAhUM9Ygn KGM2E/dVBdtFcObUOeHubDA95F3Gll/6cOZf1Cbbmhr4DA4Ugm4luLxYwo/OUh2+57M2 TqeqIwqgrrjmQYHHRx+O4J04dypP8QzGnqsr6QnP+UX5q2zRC9GS03XdY/QtYCyEo/KD KwbSKNUS2vk3adayD1Mqy6clbiffoH7agQk9LqI5v3iFLphmcXrhaZkvUnQvrGc8CfEy uPe3YdmdnRZTfwoKW8aCPvOpql/JxFE8JmXVSFBvvMavEAjof72IawwbvdJYulTXcw++ Snmw== X-Gm-Message-State: AODbwcALnULJeJiIDjSOfwmlkkP35VBFd4It4+qft0DAMQkiCN+2xgLB wstR65lOdj1Vbdhc X-Received: by 10.28.218.3 with SMTP id r3mr15593760wmg.120.1495885891554; Sat, 27 May 2017 04:51:31 -0700 (PDT) Received: from Pali-Latitude.lan (pali.kolej.mff.cuni.cz. [78.128.193.202]) by smtp.gmail.com with ESMTPSA id u141sm6009752wmd.28.2017.05.27.04.51.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 27 May 2017 04:51:30 -0700 (PDT) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: Darren Hart , Andy Shevchenko , Andy Lutomirski Cc: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, =?UTF-8?q?Pali=20Roh=C3=A1r?= Subject: [PATCH] platform/x86: wmi: Fix printing info about WDG structure Date: Sat, 27 May 2017 13:51:17 +0200 Message-Id: <1495885877-7906-1-git-send-email-pali.rohar@gmail.com> X-Mailer: git-send-email 1.7.9.5 MIME-Version: 1.0 Sender: platform-driver-x86-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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. Signed-off-by: Pali Rohár --- drivers/platform/x86/wmi.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/platform/x86/wmi.c b/drivers/platform/x86/wmi.c index ceeb8c1..cd7045f 100644 --- a/drivers/platform/x86/wmi.c +++ b/drivers/platform/x86/wmi.c @@ -352,9 +352,10 @@ acpi_status wmi_set_block(const char *guid_string, u8 instance, static void wmi_dump_wdg(const struct guid_block *g) { pr_info("%pUL:\n", g->guid); - 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); + 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]); pr_info("\tinstance_count: %d\n", g->instance_count); pr_info("\tflags: %#x", g->flags); if (g->flags) {