From patchwork Thu Apr 15 13:59:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 422708 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 83CC6C433ED for ; Thu, 15 Apr 2021 13:58:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 62E7F61153 for ; Thu, 15 Apr 2021 13:58:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232759AbhDON7S (ORCPT ); Thu, 15 Apr 2021 09:59:18 -0400 Received: from mga17.intel.com ([192.55.52.151]:60059 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231549AbhDON7S (ORCPT ); Thu, 15 Apr 2021 09:59:18 -0400 IronPort-SDR: CkolhUsRVbRTZ7UKT7r4VIbAwBhMhXg5SromWdjeazFTA+H6yiorYf8mumGVKuMfeqEOpnnctz k9rvN4HbosBg== X-IronPort-AV: E=McAfee;i="6200,9189,9955"; a="174961472" X-IronPort-AV: E=Sophos;i="5.82,225,1613462400"; d="scan'208";a="174961472" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Apr 2021 06:58:53 -0700 IronPort-SDR: 1Ero4IpCmY7zN/BTHjiLpTX2bZF4Yh00EOPhGr04YRY+PryaHh50jCkmxU7H3tJHVBvXgIoVkE ovqkuIFI+rDQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,225,1613462400"; d="scan'208";a="425186820" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga008.jf.intel.com with ESMTP; 15 Apr 2021 06:58:49 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 7C258BA; Thu, 15 Apr 2021 16:59:05 +0300 (EEST) From: Andy Shevchenko To: Dan Williams , linux-nvdimm@lists.01.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Vishal Verma , Dave Jiang , Ira Weiny , "Rafael J. Wysocki" , Len Brown , Andy Shevchenko Subject: [PATCH v1 1/1] ACPI: NFIT: Import GUID before use Date: Thu, 15 Apr 2021 16:59:01 +0300 Message-Id: <20210415135901.47131-1-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org Strictly speaking the comparison between guid_t and raw buffer is not correct. Import GUID to variable of guid_t type and then compare. Signed-off-by: Andy Shevchenko --- drivers/acpi/nfit/core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c index 958aaac869e8..6d8a1a93636a 100644 --- a/drivers/acpi/nfit/core.c +++ b/drivers/acpi/nfit/core.c @@ -678,10 +678,12 @@ static const char *spa_type_name(u16 type) int nfit_spa_type(struct acpi_nfit_system_address *spa) { + guid_t guid; int i; + import_guid(&guid, spa->range_guid); for (i = 0; i < NFIT_UUID_MAX; i++) - if (guid_equal(to_nfit_uuid(i), (guid_t *)&spa->range_guid)) + if (guid_equal(to_nfit_uuid(i), &guid)) return i; return -1; }