Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp422858rwn; Thu, 8 Sep 2022 03:52:03 -0700 (PDT) X-Google-Smtp-Source: AA6agR6HKDA2jdmFkOyPYfvRrFJdL5ZLxVZZYPxmimXXrr/IVKyzkoVpVNnUsexrEo+SSRkDmwKh X-Received: by 2002:a17:903:22d0:b0:177:e5b2:c598 with SMTP id y16-20020a17090322d000b00177e5b2c598mr5873778plg.56.1662634323496; Thu, 08 Sep 2022 03:52:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662634323; cv=none; d=google.com; s=arc-20160816; b=bNgwxY0eMFwAwFzUvIADKWy5aCWWzy3VUlR5Nr5zF5BtnFXerdPmlxCrWkQlDcHNik B56gPFuc1+15snU/2gz2wU9e69DGzj0Ot5uOXonzB1Nhg8QtSeetcn4CPzatdlupUP47 wzT+VfDJBaU934GwnEpTXkU+njvfvPw81eoMdffUBNKi0HZ3Au0uaS4KVvCJQnOmDiLc WWo4T8BeEt5ebeSKGJv5QzjEvA8jwIv7e9pSwK1fWMIrIH+FMFxR9Ytg9mHIJAheR5VQ Mdpj/Pg8dsGrBLa9G4RhkXsuUePYHVP/tTw6CINK5DcPENLyuZuiMm54p2J0znMCK+Gq iEzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=KA2/PhyIwkAo+dzCU0cE/I0Cxt6sVzdpO1mqCZvG4wc=; b=enZg3FmaHzfnfalNAndMpVep+n/kisDtyJh0wYb4iJ14WiukUBhDR1Hc8mEiojXXFP SjxSdxhI6yd1Js2Du7TGRhUlEzHKzr6LtmJM5wfB65DLfPQoE3uY/k1eQciR9yR4Td9G jiimh16O196eF7P2J/1gG/j8KXAHuspCtl+X6Z9Tj0KZtG0ryZw38K/5MtRH9QqLV2uN Iogw6qOazWKaIamhL45wkR8eiPKAEOAmLODLJ4/EwFGceviAuW5hchiznOvl4bIAInrw d4t0Tdywv8xYvC5HGUIcS0pIp/hXbPOpTk5T9o5NNtzYqjAPXthY6nlgiMIzWMMgVfeT e65g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="SCj+/x7W"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c12-20020a17090ae10c00b001fa5ea8e65bsi1919079pjz.19.2022.09.08.03.51.52; Thu, 08 Sep 2022 03:52:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="SCj+/x7W"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229973AbiIHKGw (ORCPT + 99 others); Thu, 8 Sep 2022 06:06:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48524 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229517AbiIHKGr (ORCPT ); Thu, 8 Sep 2022 06:06:47 -0400 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F0946C6CCF; Thu, 8 Sep 2022 03:06:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1662631605; x=1694167605; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=utHqLGNMZQcLYnqO4sBDHQZs1TyYxxyrfzGILDMppNI=; b=SCj+/x7WPUeXkEpUrREhDhMKp36uuFpW55uGmzq2hyBEXdYhduZmeK4V 9pYPXk6HJTMqh79LMK2jIJy7WxVzyKasrk+XCpzmYBFZ4uLkb+obGyjb5 B8fFJKk+nngPhQPBaxqONF2gkQluPo17yf+ErSHAO9qnVb/SjQnyfxU7o eeDgMCQurGt6ft9GMl19NyyHwJ/GNu8obrUnBVY1VaqG2Iga6yE93AyVM dHVxxugGiMwVIWa6UXiOty1dbU77i3Eo5ZdbGhyot02vTUwevh4uteRLU lXuxVFBAHIsGuWpFbmrtopCBeeyr42lwjMjHbQjWIakbP5sUq4mtEbcwk g==; X-IronPort-AV: E=McAfee;i="6500,9779,10463"; a="383422266" X-IronPort-AV: E=Sophos;i="5.93,299,1654585200"; d="scan'208";a="383422266" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Sep 2022 03:06:45 -0700 X-IronPort-AV: E=Sophos;i="5.93,299,1654585200"; d="scan'208";a="790383928" Received: from smile.fi.intel.com ([10.237.72.54]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Sep 2022 03:06:38 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1oWEQc-00A4R0-1h; Thu, 08 Sep 2022 13:06:34 +0300 Date: Thu, 8 Sep 2022 13:06:34 +0300 From: Andy Shevchenko To: Ard Biesheuvel Cc: "Rafael J. Wysocki" , Wolfram Sang , Hans de Goede , 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, "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 , Mark Brown , Robert Moore , Wolfram Sang Subject: Re: [PATCH v1 8/8] efi/dev-path-parser: Refactor _UID handling to use acpi_dev_uid_to_integer() Message-ID: References: <20220907164606.65742-1-andriy.shevchenko@linux.intel.com> <20220907164606.65742-9-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 08, 2022 at 10:20:47AM +0200, Ard Biesheuvel wrote: > On Wed, 7 Sept 2022 at 18:57, Andy Shevchenko > wrote: ... > > 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 == -ENODATA && node->acpi.uid == 0) > > break; > > - if (!adev->pnp.unique_id && node->acpi.uid == 0) > > + if (ret == 0 && node->acpi.uid == uid) > > Is it necessary to reorder the conditions here? I.e., why not Code-wise there should be not much difference which does not affect the flow, I think I moved it to be closer to the pattern "let's handle errors first", but in this case I'm fine with your proposal. > > + ret = acpi_dev_uid_to_integer(adev, &uid); > > + if (ret == 0 && node->acpi.uid == uid) > > break; > > + if (ret == -ENODATA && node->acpi.uid == 0) > > break; > > ? > > With that fixed, > > Reviewed-by: Ard Biesheuvel Thanks! -- With Best Regards, Andy Shevchenko