Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp6125470pxu; Wed, 23 Dec 2020 14:25:57 -0800 (PST) X-Google-Smtp-Source: ABdhPJzkF1+7H2xMXCw+z0LpDGt/0EHyyDpgkZJjJVAUuzRZJCZYu3o8qNLuXi3JgfKl0oYnqwxO X-Received: by 2002:aa7:c84c:: with SMTP id g12mr26058375edt.193.1608762357029; Wed, 23 Dec 2020 14:25:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608762357; cv=none; d=google.com; s=arc-20160816; b=UCQBj4Nmd41Oo8TTGgZp+x4X1wRvv3y+b+RL8+KEWN5h1DSxObwRntnEvits3BWFZS 1s4oC7s4AJ6MACuu73nJekFcNsnmxR3bYLvUZDzwHl+Oa+qbMxzSK26cQwGuUZCgWG8B FdWqM2Vmp0YoJA+lVsI5M5eBs4bcRDYeEyTOb0tNuSdr/Fs2SPczaUkhe1EOxueayzRp hBUENYUUnY74+FN6yoo3DKA430lbw46JCFT82XspnuGtRRADcx1SaXLVDqZ3Lqwrdsge bSsbim9pz+R4K09BP2Ou5I24zj2PsCf3jtrkXoDftK60fYroJRz2fkiCfllyj/ja9H9x 4IyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=sCveDTAqg2krVZsKdg4haeDPpG4bCY8xxdMqSu4hHV0=; b=MyvAqx9NZaDwOM2MWJsMM0N0DDxbge7PxL+KQwv7/AjzFEp+iDxRgbWYWozvqgO1LA QL5lqUQ1euawcZUQSVgo3xuRn6TuL1EKUb5rWeh2BbXfKxzaHuP2RwDNf4jD6oHAO51P uJCrozYAPL1J+8dmw4S8W54zGuYHKCQvN0lHl6NsGb8q8EZxqrBudz/k/8YkksGmAWp9 yTpoSsO6w1VyAua6kRvI1pZSW6B0WB5uEKSjQVgiyA1Ei5zmMebel3vn2Ln6IRywurFm kvp392mPhq3rUmGYPfssYWsN0UL6BLKwh68H7las7DOhteaJzVBgnXYWLLFdWmb9g2JG BaYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=SPXs4ihQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u10si14793199edd.90.2020.12.23.14.25.34; Wed, 23 Dec 2020 14:25:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=SPXs4ihQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726642AbgLWWYu (ORCPT + 99 others); Wed, 23 Dec 2020 17:24:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51196 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725811AbgLWWYu (ORCPT ); Wed, 23 Dec 2020 17:24:50 -0500 Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5B3FFC061794; Wed, 23 Dec 2020 14:24:09 -0800 (PST) Received: by mail-wm1-x32a.google.com with SMTP id y23so188201wmi.1; Wed, 23 Dec 2020 14:24:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=sCveDTAqg2krVZsKdg4haeDPpG4bCY8xxdMqSu4hHV0=; b=SPXs4ihQVtEbUsfzq1Hqda/oybQY2OvK1F30H3bW7uhyexY2dCo/M5s+KEqAlT8DTW NnUQ9UXiunXMMi0M/eSQKDqEZEfiNBr1AbSwHWYkLlz8pczbU+5Tln/W4HkHt6nXHVOk JvqZjlFk2wtYTvfmArSUIGFqo7SjZZlF1AgW91N23aj+UeKxUYhqAFbtrP8F9jyQZIek 6kmuBfpl9J1B8095HEd4jGDE13OPDjOv3FNwztMx/fZUtdr96EczLM8hw7yZE+s8g2/G gwubldFpGI2S/aB9kwz8INnewVxAaiIygY7VJk9yOHY3aXU0sz1TtfKcheVq1dFtJaeP UPNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=sCveDTAqg2krVZsKdg4haeDPpG4bCY8xxdMqSu4hHV0=; b=VijRwiKzVIdnv8U4pauT6KuJYwFpyLDQOZsLjbGH3btc6ecj8AO64wfrPUQsEst9bF IwQ0sngdS1S8f7gSBmnOaup+bwSkO2weR8vX4U9IPaybXCMb4s4i6vmfDQFCMwjYCpRP Y5mzVWWf2Qwss9zEmocp6XAJEWbG4zYQ2TgNLH4+JuIoIFAjK48vktaxtXaoAJjNtm53 yRvtFUHxAuFEQTez7F3c/hm+H092JtF3vhfwrhAU3g00/L1OgkdQ6g9dEd4zSG9pvIBb /H4jhkTjklN9oFB+fa5eKel0Ww9v4t+I+vqfrcOvil2dzjsub8B322d+kZ4p9TWKqS02 7WpQ== X-Gm-Message-State: AOAM532akjqOdBtEkS5OVBFNGKIP64LodJRRRPV0AS9bgtw9pbLBAR13 RT/knrVtaK2y2ufAOC36ZbQ= X-Received: by 2002:a1c:bc02:: with SMTP id m2mr1548175wmf.59.1608762248064; Wed, 23 Dec 2020 14:24:08 -0800 (PST) Received: from [192.168.1.158] ([2.31.224.116]) by smtp.gmail.com with ESMTPSA id c20sm1217971wmb.38.2020.12.23.14.24.06 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 23 Dec 2020 14:24:07 -0800 (PST) Subject: Re: [PATCH v2 05/12] software_node: unregister software_nodes in reverse order To: Andy Shevchenko , Sakari Ailus Cc: linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, linux-media@vger.kernel.org, devel@acpica.org, rjw@rjwysocki.net, lenb@kernel.org, gregkh@linuxfoundation.org, yong.zhi@intel.com, bingbu.cao@intel.com, tian.shu.qiu@intel.com, mchehab@kernel.org, robert.moore@intel.com, erik.kaneda@intel.com, pmladek@suse.com, rostedt@goodmis.org, sergey.senozhatsky@gmail.com, linux@rasmusvillemoes.dk, laurent.pinchart+renesas@ideasonboard.com, jacopo+renesas@jmondi.org, kieran.bingham+renesas@ideasonboard.com, linus.walleij@linaro.org, heikki.krogerus@linux.intel.com, kitakar@gmail.com, jorhand@linux.microsoft.com, kernel test robot , Dan Carpenter , Laurent Pinchart References: <20201217234337.1983732-1-djrscally@gmail.com> <20201217234337.1983732-6-djrscally@gmail.com> <20201221092116.GG26370@paasikivi.fi.intel.com> <20201221112644.GJ4077@smile.fi.intel.com> From: Daniel Scally Message-ID: <9fbd8234-6cc3-ac3c-7273-854e965a4794@gmail.com> Date: Wed, 23 Dec 2020 22:24:03 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20201221112644.GJ4077@smile.fi.intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 21/12/2020 11:26, Andy Shevchenko wrote: > On Mon, Dec 21, 2020 at 11:21:16AM +0200, Sakari Ailus wrote: >> On Thu, Dec 17, 2020 at 11:43:30PM +0000, Daniel Scally wrote: >>> To maintain consistency with software_node_unregister_nodes(), reverse >>> the order in which the software_node_unregister_node_group() function >>> unregisters nodes. > > ... > >>> void software_node_unregister_node_group(const struct software_node **node_group) >>> { >>> - unsigned int i; >>> + unsigned int i = 0; >>> >>> if (!node_group) >>> return; >>> >>> - for (i = 0; node_group[i]; i++) >>> + while (node_group[i]->name) >> >> Why is this change made? node_group is a NULL-terminated array, and the >> above accesses the name pointer on each entry before checking the entry is >> non-NULL. Or do I miss something here? > > I believe it's a copy'n'paste typo. Careless copy and paste yeah, my bad. I was doing it for consistency but really should've just changed the ordering; I'll just drop that part.