Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp606870iog; Wed, 29 Jun 2022 06:48:31 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sG44Fwfje/WT/YaXeJtaOIWo/nbX0EPsZEgNkOiNtfZ5lEbTZXuzd0QIgvbsWPIcnXRsQH X-Received: by 2002:a05:6402:909:b0:435:a8b:5232 with SMTP id g9-20020a056402090900b004350a8b5232mr4231693edz.240.1656510511010; Wed, 29 Jun 2022 06:48:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656510511; cv=none; d=google.com; s=arc-20160816; b=YIuTn7gJ77cXjYomAw3Y2Cd/6c7Ow5rbUg5Lt9d/zcM+vgoFAyW+NkA1T1VHIWyXqi hhhCKaE2V/YbiU8jEmBc5dZIeLjQm3L0/mgMZmhulhF1OUwMJgXDPeZQYCCHbpcQ+KT8 GvQfUQXLZe4MQOevKqj1a7yxlGJSxDYck9uByUAHPcNc2449hjr1msxgK60TXVpH8UMB 1VxKg/UAAp0HlUPjie0qQ626srEZJhVrIdL9pEINd3vSGDE+XWS5ZugbBrWhUvb9G+tb Uqw2ft45jbAAvHtCwC2FGEVgMM2Xo/V00XzfTdnUrlLsaRsjne0o3DeQ6EBvVNZFcffg q3Hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version; bh=qWd+/GNRWrMnJtQdycCFMuXDDvHCsZXhcHtITuVCwxk=; b=jZIsGA6czT/dO5tIrT+fPI1DTSHSK+O5c3Vb/IzROVEJVWFI4AFbOvIO3cjO/WIOAt S25FNRb8ocuGlSbA+3UV8ZGTSlxi3+fZ7Bqa0qRQMUmrxkG0X5CcH4I6LRMLsJxifohZ siEwsJ9BIWKC8pz+UiefXb2kMZ0aY5ENINlinX7lIzWneq061Mj8g1sYi/6i/myOIEQ4 FpPWzzXklVqTqKbgfzuXRYtePRgROFke2YN9wlRnNle6iEcVvvRr/QHZx+8agP6stFkb 8d0zuH3lBnkvhlei1e8OTu/KvxQXz0+ndWrlz8gpSo5mXLYsK59/vgSADf2aomgjFLgP 9V5g== 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 a7-20020aa7d907000000b004353fbbd63csi17146086edr.426.2022.06.29.06.48.05; Wed, 29 Jun 2022 06:48:31 -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 S233645AbiF2Niz convert rfc822-to-8bit (ORCPT + 99 others); Wed, 29 Jun 2022 09:38:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41552 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232215AbiF2Nit (ORCPT ); Wed, 29 Jun 2022 09:38:49 -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 9895B219C; Wed, 29 Jun 2022 06:38:45 -0700 (PDT) Received: by mail-yw1-f180.google.com with SMTP id 00721157ae682-3178acf2a92so148189147b3.6; Wed, 29 Jun 2022 06:38:45 -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:content-transfer-encoding; bh=B/wOP5TkUKJr9Ua3F5xrOhp3YHBuachNRIARHLsgoOk=; b=YntU0pXbUqMMyj8GDe3gLL1YiaRbaaPieMtU6sqwyze7UeqQvF1LUpOt+kGnwPtedv rtNnMDte0qEEGHRaRZHzMRFSF6bd2nkbf7DOZZmmLlGyAmDUlB60X4IanrmKtymG0eiC mmxM9zOZ7EgfPOKDJa31Sk6sEoLhO5oc10vuzJdUVJcgxIXrrPuD8bi0c5Ok6gzvLd1C MJuL4UVwrW6QvUX3GrR+E6CRPaJNUBt/ybP35vaMubbQwJh2jGyyWWV9LXI6YnPvTYES 4pYWETE/+dXmDt45hTDgF8VCGqEsk9Sc1xFthGgLHXQaoedhd1MuVL0GnIqQzoyuaR/H lPSA== X-Gm-Message-State: AJIora8lm5ktAKDv31ndNS2NpTczDfhXWJ7hxrAjicOmcCTQQaMBHIgM 9rBEi0jDbM/GxXRpL/9Xu9zwSnlth8F4pU/Kqdg= X-Received: by 2002:a81:68d7:0:b0:318:11df:a40d with SMTP id d206-20020a8168d7000000b0031811dfa40dmr3895805ywc.196.1656509924699; Wed, 29 Jun 2022 06:38:44 -0700 (PDT) MIME-Version: 1.0 References: <12026357.O9o76ZdvQC@kreacher> In-Reply-To: From: "Rafael J. Wysocki" Date: Wed, 29 Jun 2022 15:38:33 +0200 Message-ID: Subject: Re: [PATCH] hisi_lpc: Use acpi_dev_for_each_child() To: John Garry Cc: "Rafael J. Wysocki" , Linux ACPI , LKML , Andy Shevchenko , Greg Kroah-Hartman Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT 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 Wed, Jun 29, 2022 at 3:34 PM John Garry wrote: > > On 29/06/2022 13:55, Rafael J. Wysocki wrote: > > From: Rafael J. Wysocki > > > > Instead of walking the list of children of an ACPI device directly, > > use acpi_dev_for_each_child() to carry out an action for all of > > the given ACPI device's children. > > > > 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 > > Hi Rafael, > > > --- > > drivers/bus/hisi_lpc.c | 12 ++++++++---- > > 1 file changed, 8 insertions(+), 4 deletions(-) > > > > Index: linux-pm/drivers/bus/hisi_lpc.c > > =================================================================== > > --- linux-pm.orig/drivers/bus/hisi_lpc.c > > +++ linux-pm/drivers/bus/hisi_lpc.c > > @@ -471,6 +471,12 @@ static int hisi_lpc_acpi_remove_subdev(s > > return 0; > > } > > > > +static int hisi_lpc_acpi_clear_enumerated(struct acpi_device *adev, void *not_used) > > +{ > > + acpi_device_clear_enumerated(adev); > > + return 0; > > +} > > + > > struct hisi_lpc_acpi_cell { > > const char *hid; > > const char *name; > > @@ -480,13 +486,11 @@ struct hisi_lpc_acpi_cell { > > > > static void hisi_lpc_acpi_remove(struct device *hostdev) > > { > > - struct acpi_device *adev = ACPI_COMPANION(hostdev); > > struct acpi_device *child; > > > I got this warn: > > drivers/bus/hisi_lpc.c: In function ‘hisi_lpc_acpi_remove’: > drivers/bus/hisi_lpc.c:489:22: warning: unused variable ‘child’ > [-Wunused-variable] > 489 | struct acpi_device *child; > | ^~~~~ > CC drivers/bus/brcmstb_gisb. I've overlooked that, sorry. Will send a v2 fixing this shortly. > With that fixed: > > Acked-by: John Garry Thanks! > Can you route this through one of your trees? Yes, I will do that.