From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 715B0C54EE9 for ; Thu, 8 Sep 2022 13:43:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To: Subject:MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=2xwAxJCSUi8zFU40nbHcBd8rXY75ITTXK3RIkjyFQzc=; b=ukywgH1v8RUasE xx79gD0HwTXGMcCmnvPxvhlU3icO7fOYInL6umyvu8Z2H/BvVRFB/8p91EbZuqZbz1zP2aLwgt9rX 6pIL/UnTjwEbhHjehIYPQerl1HuaBIGi6zzVuEkqSyfL0u+qsGx4S5JF0C07ZcyN1uvaUtS4UNeVS 1iYU3H0z0tb/bjY31dlBrxijvMMYENNTGkkRQ2nGNzuRun4d0HHcD8wZu251NP1iOYLSyhL6ut/5H pDMz+r+6xg7NBk9IKEUQW2ECmSpNsm5QyW3yeOeVhuks6yMbbUxSAgFSMeoOwGMqkKnnxRBTkqQBp uiy85RIwLk8jgrXkvZMw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oWHna-0041LX-02; Thu, 08 Sep 2022 13:42:31 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oWHnS-0041J8-7l for linux-arm-kernel@lists.infradead.org; Thu, 08 Sep 2022 13:42:23 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1662644540; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=dY7UGDgAaThf/zGLCo78Nc7H8PVWh9/Q5L5/T8dTqWI=; b=aZt3pEaxQzlnRIFmRJbiD+vzhCbgfdM+EP6o0kAv1yRBAPbiAxbp2k4kbcnVUEgOAm9GcH X2JpznQo1K0YFAv3BkBxddJbe4ZP48+0qsoMfZ8FebCpqJ6iKfqWfUGa0oHhJirR01aqf6 eg5WODeQfJ3U67s01DzsEOJPwWUEe14= Received: from mail-ej1-f72.google.com (mail-ej1-f72.google.com [209.85.218.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-568-Xw95wpT4O4qEz2xe_v3j9w-1; Thu, 08 Sep 2022 09:42:19 -0400 X-MC-Unique: Xw95wpT4O4qEz2xe_v3j9w-1 Received: by mail-ej1-f72.google.com with SMTP id sb14-20020a1709076d8e00b0073d48a10e10so6422384ejc.16 for ; Thu, 08 Sep 2022 06:42:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date; bh=dY7UGDgAaThf/zGLCo78Nc7H8PVWh9/Q5L5/T8dTqWI=; b=UBvNLLV6Ya/Ni1dp42hotjEoCTUAj1UngF2cBiHt7oiXf/zd51yqFHOdpUC0jJGlrl f4kBhHhnQCdp2q9CzFFBTJKewq+DCl0dB58p7rfk459bcexHQfvhiqqSL3u8YweO4Ivx hYryXHBHuaSgVC5diB9NNDcbJQxjYEvQrSFLkywJKSUxcJITsrgFJ6/ISVuWpgfdCew7 YbHfGHWUlutBNvkIa8qrSC1wHa8H5yhMComQFzqHUEjL+GBmh0uVFziLbOWVwFyZgYav lbsF+fWoFB0uZ14+QDIqJt/2qjo8q9mlmkJRNj2QT8Q1CFZ8QS5dT1bZVa2kTzymvjSB W0BQ== X-Gm-Message-State: ACgBeo1yU59UWQJYeIA26I6uajqhJWs1USN/TuJ4EKAr9HnaSGrcgOiX /htgXs/z51imdlodzgMs6Ol9OL0LePBwLw6wErNXLN5OUoMOcvtVu+p6hU/hT5qitcTBwOM+JIC r2HX1UGG4zm0mF4mZFI6b8QeVLcQiRQjPw3w= X-Received: by 2002:a17:907:96a3:b0:740:a894:f with SMTP id hd35-20020a17090796a300b00740a894000fmr6136628ejc.460.1662644538495; Thu, 08 Sep 2022 06:42:18 -0700 (PDT) X-Google-Smtp-Source: AA6agR5AC4iFP8kH6lKh83PspsOpkpVkUS6JN8xBfUD/yEuKwkju+iQLnwP+Y88hQIIWETucCSz8UQ== X-Received: by 2002:a17:907:96a3:b0:740:a894:f with SMTP id hd35-20020a17090796a300b00740a894000fmr6136591ejc.460.1662644538255; Thu, 08 Sep 2022 06:42:18 -0700 (PDT) Received: from ?IPV6:2001:1c00:c1e:bf00:d69d:5353:dba5:ee81? (2001-1c00-0c1e-bf00-d69d-5353-dba5-ee81.cable.dynamic.v6.ziggo.nl. [2001:1c00:c1e:bf00:d69d:5353:dba5:ee81]) by smtp.gmail.com with ESMTPSA id bm9-20020a0564020b0900b0044ec76521a1sm5837844edb.55.2022.09.08.06.42.17 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 08 Sep 2022 06:42:17 -0700 (PDT) Message-ID: <767b4c6c-c860-b490-4e85-34c6677de456@redhat.com> Date: Thu, 8 Sep 2022 15:42:17 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.12.0 Subject: Re: [PATCH v2 8/8] efi/dev-path-parser: Refactor _UID handling to use acpi_dev_uid_to_integer() To: Andy Shevchenko , "Rafael J. Wysocki" , Ard Biesheuvel , Mark Brown , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-efi@vger.kernel.org, linux-i2c@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-spi@vger.kernel.org, devel@acpica.org Cc: "Rafael J. Wysocki" , Len Brown , Elie Morisse , Nehal Shah , Shyam Sundar S K , Khalil Blaiech , Andy Gross , Bjorn Andersson , Konrad Dybcio , Will Deacon , Mark Rutland , Daniel Mack , Haojian Zhuang , Robert Jarzmik , Robert Moore , Wolfram Sang References: <20220908132910.62122-1-andriy.shevchenko@linux.intel.com> <20220908132910.62122-9-andriy.shevchenko@linux.intel.com> From: Hans de Goede In-Reply-To: <20220908132910.62122-9-andriy.shevchenko@linux.intel.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220908_064222_431946_3A19ACE4 X-CRM114-Status: GOOD ( 19.97 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi, On 9/8/22 15:29, Andy Shevchenko wrote: > ACPI utils provide acpi_dev_uid_to_integer() helper to extract _UID as > an integer. Use it instead of custom approach. > > Signed-off-by: Andy Shevchenko > Reviewed-by: Ard Biesheuvel Thanks, patch looks good to me: Reviewed-by: Hans de Goede Regards, Hans > --- > drivers/firmware/efi/dev-path-parser.c | 10 ++++++---- > 1 file changed, 6 insertions(+), 4 deletions(-) > > diff --git a/drivers/firmware/efi/dev-path-parser.c b/drivers/firmware/efi/dev-path-parser.c > index eb9c65f97841..f80d87c199c3 100644 > --- a/drivers/firmware/efi/dev-path-parser.c > +++ b/drivers/firmware/efi/dev-path-parser.c > @@ -15,9 +15,11 @@ > static long __init parse_acpi_path(const struct efi_dev_path *node, > struct device *parent, struct device **child) > { > - char hid[ACPI_ID_LEN], uid[11]; /* UINT_MAX + null byte */ > struct acpi_device *adev; > struct device *phys_dev; > + char hid[ACPI_ID_LEN]; > + u64 uid; > + int ret; > > if (node->header.length != 12) > return -EINVAL; > @@ -27,12 +29,12 @@ static long __init parse_acpi_path(const struct efi_dev_path *node, > 'A' + ((node->acpi.hid >> 5) & 0x1f) - 1, > 'A' + ((node->acpi.hid >> 0) & 0x1f) - 1, > node->acpi.hid >> 16); > - sprintf(uid, "%u", node->acpi.uid); > > for_each_acpi_dev_match(adev, hid, NULL, -1) { > - if (adev->pnp.unique_id && !strcmp(adev->pnp.unique_id, uid)) > + ret = acpi_dev_uid_to_integer(adev, &uid); > + if (ret == 0 && node->acpi.uid == uid) > break; > - if (!adev->pnp.unique_id && node->acpi.uid == 0) > + if (ret == -ENODATA && node->acpi.uid == 0) > break; > } > if (!adev) _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel