Received: by 2002:a5d:925a:0:0:0:0:0 with SMTP id e26csp1431880iol; Fri, 10 Jun 2022 07:25:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzEjd/1oSXSiwuhQI0Xaw8Gu3TkyMjw7P4gt/OR6ifXdvbL0GkixqFzEBhEuAZjnBFJH/8L X-Received: by 2002:a05:6402:34c8:b0:42f:b59e:b98c with SMTP id w8-20020a05640234c800b0042fb59eb98cmr39709081edc.275.1654871153026; Fri, 10 Jun 2022 07:25:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654871153; cv=none; d=google.com; s=arc-20160816; b=MwQMrJMGMUBGmfv3+DN2o8jaBelt7XG6rECHhDL0/hrDvq2MrVdsZ7KkLfcXg/TmpV v56cs13/4GP8MORhebmVugowan8ogMSMdNF26/9eaaR4bLuWq2WYoaJemo3BDxu7bQbZ pqMxgzna9uJlRc0ipDrsH31tBw2wdy3eVsjkOSXRfj+JCa8lDQs/drnjkikBKzZ8z5u/ l4JfR98h/m6g6KJr6p/ycEGiPfgPoJtueyPcTWKgqWfTOHDgEvSNbs1hCQ8BJFF0RllN 1qHMmpPLc3kJqSeY8G+q/c8XkBr41SENJ/CgCIcJDHwGgl5mTdbCZ7RuVqQlNNr+yzbG Qhlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=Ui+ZlqvjfQ4kGZHjfzfTbsf4WxD0gXAASGAQvdxLTE4=; b=Dec1yAWJ3OAro4E5jWtUpf6KscxFyOnJHlAEu+h2AF9KtCR5VbIJo/wIK28u+ApR+n ViFDkZsSS09wVrWkNxR+8UW+ze4OMAyX+eOtnTWVhJaJg0ri72g4hl4iswbhEie3VhjH MfwsADfYatxgT8wblgJg3Gx0U9T53VLzhroOfUjvx4qAklL9RfKWAQ4DU+iIivMoXJfY dnfHE1FLF1FWnx0/tfc/WFPZdemi69Zblw1ZgPOA6YH9eQ+wvq3fBLVCphUBjdsAua3E hTeqh2FSTlzwGJuvwN5Orzxx6J2xa5UoNS6cUTrNqFOZpRsN/hUbDzBtUF28cAlITCb4 9w2g== ARC-Authentication-Results: i=1; mx.google.com; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ne7-20020a1709077b8700b00707929cc4a9si8191430ejc.178.2022.06.10.07.25.27; Fri, 10 Jun 2022 07:25:53 -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; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237704AbiFJNOz (ORCPT + 99 others); Fri, 10 Jun 2022 09:14:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56248 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245512AbiFJNOv (ORCPT ); Fri, 10 Jun 2022 09:14:51 -0400 Received: from mail-yw1-f180.google.com (mail-yw1-f180.google.com [209.85.128.180]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DBCFD366AF; Fri, 10 Jun 2022 06:14:46 -0700 (PDT) Received: by mail-yw1-f180.google.com with SMTP id 00721157ae682-3135519f95fso101691387b3.6; Fri, 10 Jun 2022 06:14:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Ui+ZlqvjfQ4kGZHjfzfTbsf4WxD0gXAASGAQvdxLTE4=; b=WnkfXbHlrjXUhu7KG+76UQVO3pEeljbjMVVMILJArZAi4lcTtVwmll20QF0hSsHWhO uvHTBK45y9utD8bsAx1KojmWVCUL+neR5hgxHc+oRMOK4Yr6r4n62BREj+HorZA0j4e5 vOhFfQqaFLEpG1jA7pISfGuLm8u0/PUvOf97j4/aX1J+mo8z3uomC3F5OiaX6kdKyrRu P/qY8dl/Lk4G3RbZORQ96kMxcK4I3ewzXOrDOdzj6opPqPeQ274ztEJd1SI9pR6CbMZ0 m5eaja4MxiNJludk16oz93cVSaWtAzTxI9xAng2oqXacKoG6obKCITh6moO14CxphCku ASaw== X-Gm-Message-State: AOAM533uH+wr6PCbzHIi9XZJcjdfeg+vcy+Rxm7LzGjBdfRDdl9eg/s1 K6rvtTRDHVaKQwG430pDOu/geBGMVu0ewfL++/E= X-Received: by 2002:a81:3dc6:0:b0:313:cc8a:e39e with SMTP id k189-20020a813dc6000000b00313cc8ae39emr560803ywa.196.1654866886071; Fri, 10 Jun 2022 06:14:46 -0700 (PDT) MIME-Version: 1.0 References: <1843211.tdWV9SEqCh@kreacher> <3459925.iIbC2pHGDl@kreacher> In-Reply-To: From: "Rafael J. Wysocki" Date: Fri, 10 Jun 2022 15:14:34 +0200 Message-ID: Subject: Re: [PATCH v1 05/16] USB: ACPI: Use acpi_find_child_by_adr() To: Heikki Krogerus Cc: "Rafael J. Wysocki" , Linux ACPI , LKML , Linux PM , Andy Shevchenko , Mika Westerberg , Hans de Goede , Sakari Ailus , Greg Kroah-Hartman , "open list:ULTRA-WIDEBAND (UWB) SUBSYSTEM:" Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no 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 Fri, Jun 10, 2022 at 8:47 AM Heikki Krogerus wrote: > > On Thu, Jun 09, 2022 at 03:56:42PM +0200, Rafael J. Wysocki wrote: > > From: Rafael J. Wysocki > > > > Instead of walking the list of children of an ACPI device directly > > in order to find the child matching a given bus address, use > > acpi_find_child_by_adr() for this purpose. > > > > Apart from simplifying the code, this will help to eliminate the > > children list head from struct acpi_device as it is redundant and it > > is used in questionable ways in some places (in particular, locking is > > needed for walking the list pointed to it safely, but it is often > > missing). > > > > Signed-off-by: Rafael J. Wysocki > > --- > > drivers/usb/core/usb-acpi.c | 9 +-------- > > 1 file changed, 1 insertion(+), 8 deletions(-) > > > > Index: linux-pm/drivers/usb/core/usb-acpi.c > > =================================================================== > > --- linux-pm.orig/drivers/usb/core/usb-acpi.c > > +++ linux-pm/drivers/usb/core/usb-acpi.c > > @@ -127,17 +127,10 @@ out: > > static struct acpi_device *usb_acpi_find_port(struct acpi_device *parent, > > int raw) > > { > > - struct acpi_device *adev; > > - > > if (!parent) > > return NULL; > > > > - list_for_each_entry(adev, &parent->children, node) { > > - if (acpi_device_adr(adev) == raw) > > - return adev; > > - } > > - > > - return acpi_find_child_device(parent, raw, false); > > + return acpi_find_child_by_adr(parent, raw); > > } > > > > static struct acpi_device * > > I think usb_acpi_find_port() can also be dropped now. Yes, it can. I'm dropping it in the new version of the patch to be posted.