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


Groups > linux.kernel > #1662101 > unrolled thread

[PATCH v1] thermal: int340x_thermal: Switch to use new generic UUID API

Started byAndy Shevchenko <andriy.shevchenko@linux.intel.com>
First post2017-06-09 10:40 +0200
Last post2017-06-09 15:20 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH v1] thermal: int340x_thermal: Switch to use new generic UUID API Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2017-06-09 10:40 +0200
    Re: [PATCH v1] thermal: int340x_thermal: Switch to use new generic         UUID API Christoph Hellwig <hch@lst.de> - 2017-06-09 15:20 +0200

#1662101 — [PATCH v1] thermal: int340x_thermal: Switch to use new generic UUID API

FromAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Date2017-06-09 10:40 +0200
Subject[PATCH v1] thermal: int340x_thermal: Switch to use new generic UUID API
Message-ID<tQnCy-7E3-23@gated-at.bofh.it>
There are new types and helpers that are supposed to be used in
new code.

As a preparation to get rid of legacy types and API functions do
the conversion here.

The conversion fixes a potential bug in int340x_thermal as well
since we have to use memcmp() on binary data.

Acked-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/thermal/int340x_thermal/int3400_thermal.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/thermal/int340x_thermal/int3400_thermal.c b/drivers/thermal/int340x_thermal/int3400_thermal.c
index 9413c4abf0b9..fb7284153878 100644
--- a/drivers/thermal/int340x_thermal/int3400_thermal.c
+++ b/drivers/thermal/int340x_thermal/int3400_thermal.c
@@ -23,7 +23,7 @@ enum int3400_thermal_uuid {
 	INT3400_THERMAL_MAXIMUM_UUID,
 };
 
-static u8 *int3400_thermal_uuids[INT3400_THERMAL_MAXIMUM_UUID] = {
+static const char *int3400_thermal_uuids[INT3400_THERMAL_MAXIMUM_UUID] = {
 	"42A441D6-AE6A-462b-A84B-4A8CE79027D3",
 	"3A95C389-E4B8-4629-A526-C52C88626BAE",
 	"97C68AE7-15FA-499c-B8C9-5DA81D606E0A",
@@ -141,10 +141,10 @@ static int int3400_thermal_get_uuids(struct int3400_thermal_priv *priv)
 		}
 
 		for (j = 0; j < INT3400_THERMAL_MAXIMUM_UUID; j++) {
-			u8 uuid[16];
+			guid_t guid;
 
-			acpi_str_to_uuid(int3400_thermal_uuids[j], uuid);
-			if (!strncmp(uuid, objb->buffer.pointer, 16)) {
+			guid_parse(int3400_thermal_uuids[j], &guid);
+			if (guid_equal(objb->buffer.pointer, &guid)) {
 				priv->uuid_bitmap |= (1 << j);
 				break;
 			}
-- 
2.11.0

[toc] | [next] | [standalone]


#1662399 — Re: [PATCH v1] thermal: int340x_thermal: Switch to use new generic UUID API

FromChristoph Hellwig <hch@lst.de>
Date2017-06-09 15:20 +0200
SubjectRe: [PATCH v1] thermal: int340x_thermal: Switch to use new generic UUID API
Message-ID<tQrZw-1Zf-1@gated-at.bofh.it>
In reply to#1662101
On Fri, Jun 09, 2017 at 11:33:06AM +0300, Andy Shevchenko wrote:
> There are new types and helpers that are supposed to be used in
> new code.
> 
> As a preparation to get rid of legacy types and API functions do
> the conversion here.
> 
> The conversion fixes a potential bug in int340x_thermal as well
> since we have to use memcmp() on binary data.

Thanks Andy, applied.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web