nvdimm.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 1/1] ACPI: NFIT: Import GUID before use
@ 2021-04-15 13:59 Andy Shevchenko
  2021-04-16  5:17 ` Dan Williams
  0 siblings, 1 reply; 8+ messages in thread
From: Andy Shevchenko @ 2021-04-15 13:59 UTC (permalink / raw)
  To: Dan Williams, linux-nvdimm, linux-acpi, linux-kernel
  Cc: Rafael J. Wysocki, Len Brown, Andy Shevchenko

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 <andriy.shevchenko@linux.intel.com>
---
 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;
 }
-- 
2.30.2
_______________________________________________
Linux-nvdimm mailing list -- linux-nvdimm@lists.01.org
To unsubscribe send an email to linux-nvdimm-leave@lists.01.org

^ permalink raw reply related	[flat|nested] 8+ messages in thread
* [PATCH v1 1/1] ACPI: NFIT: Import GUID before use
@ 2021-12-13 20:46 Andy Shevchenko
  2021-12-17 18:08 ` Rafael J. Wysocki
  0 siblings, 1 reply; 8+ messages in thread
From: Andy Shevchenko @ 2021-12-13 20:46 UTC (permalink / raw)
  To: Dan Williams, nvdimm, linux-acpi, linux-kernel
  Cc: Vishal Verma, Dave Jiang, Ira Weiny, Rafael J. Wysocki,
	Len Brown, Andy Shevchenko

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 <andriy.shevchenko@linux.intel.com>
---
 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 7dd80acf92c7..e5d7f2bda13f 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;
 }
-- 
2.33.0


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-12-17 18:37 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-15 13:59 [PATCH v1 1/1] ACPI: NFIT: Import GUID before use Andy Shevchenko
2021-04-16  5:17 ` Dan Williams
     [not found]   ` <CAHp75VcpQREYFesS9q2TeqrR29hf0CvMESM42AVGAFzEYeRr_Q@mail.gmail.com>
2021-04-16 16:15     ` Dan Williams
2021-04-16 17:33       ` Andy Shevchenko
2021-04-16 18:04         ` Dan Williams
2021-12-13 20:46 Andy Shevchenko
2021-12-17 18:08 ` Rafael J. Wysocki
2021-12-17 18:37   ` Dan Williams

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).