Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp4066135pxu; Mon, 21 Dec 2020 03:30:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJyQJaoHvBDXxONHHsqkmNDdG8YIVYeq+OUhaQ8rQ/UCc1ALGUQddpqOBmM17BsGqUygdMUP X-Received: by 2002:a50:bacb:: with SMTP id x69mr15368844ede.39.1608550200070; Mon, 21 Dec 2020 03:30:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608550200; cv=none; d=google.com; s=arc-20160816; b=lGjNKBUTw2tPK48mTntSj7QKZk87vIFHV1e7rBgTSPkihtWy7w03gAqmsbuxt3JsCi k7l+VtIiPtTtLFRxV93oNsCcqTLbXBKVJ/PCekw3Ct/XBFS50dcUM0fcA3eRn3+7PnfP wOmHnwr6UYXyjL/uehWLMxEtmfJfJ3sDh1oodL21sIfrjClXTawN6GgNpHlUn/acpgRj KdEs2YtKX6bCr8ABI2QRg/BTi0y/MnOySGdYaIc1yaKF///Bj5E5kdys4l93xCqEQWwT Bzs3agl7u5PNp9r7spdBZyxPzSgAqMAJTwz+kodTulJREADUJxN0X28VyZloMcjw0oxJ DlRQ== 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 :ironport-sdr:ironport-sdr; bh=S38+RALqTi1XB5ro6bJR4zhCcC4OQwGuwT0ZwzrzV+s=; b=xfPtr9057Ktur3FGKJOnXuDYIcda3niOekDlfUtpVri8lj+HW78c/sPmexjwkgSh48 VEa8mpk21KQ/ApO2yP9f76BmHgTx9q0kZsYi0gjs20uEH1hgkVdmsSop54PXN3mrx1mL qbBYT8EtTALhMfTYVPxnLWVfbpFqV1wcPp+wAmhUzxcSwzAtCRqT5zOjP1fg+XM0qTuk 3T0JOslr/1JjMOYWO2NQg7qA2MNW77AcN+j6vNjtU4K5hZdZruV0YT51HyKbxWDzW0Mx mXOccny8ExditFgvYXIFYNjd86KKQ4frrpYVz/sxsiZMdWhM3ysCiiq6uE9gFBfQhAzk Chhg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gs30si7493085ejc.200.2020.12.21.03.29.37; Mon, 21 Dec 2020 03:30:00 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726209AbgLUL1g (ORCPT + 99 others); Mon, 21 Dec 2020 06:27:36 -0500 Received: from mga03.intel.com ([134.134.136.65]:16561 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725907AbgLUL1g (ORCPT ); Mon, 21 Dec 2020 06:27:36 -0500 IronPort-SDR: 8trWpxcyvhZLqpxlZUTtwQ3/XH0FoeeeE/RsRcF0v1CsjEUYWGru11nYuMZNLUqvlxCPiySgNE fE88+RlQJquw== X-IronPort-AV: E=McAfee;i="6000,8403,9841"; a="175811325" X-IronPort-AV: E=Sophos;i="5.78,436,1599548400"; d="scan'208";a="175811325" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Dec 2020 03:25:50 -0800 IronPort-SDR: Ruzlnmfcv9D1b7FsVnR64liNeineniqLbyQ/pLIu2fSbduGK6T9jBHtkTqcX239cJEUN41NB7C UpEroqRA8Zsw== X-IronPort-AV: E=Sophos;i="5.78,436,1599548400"; d="scan'208";a="563511809" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Dec 2020 03:25:44 -0800 Received: from andy by smile with local (Exim 4.94) (envelope-from ) id 1krJKu-00GJki-KA; Mon, 21 Dec 2020 13:26:44 +0200 Date: Mon, 21 Dec 2020 13:26:44 +0200 From: Andy Shevchenko To: Sakari Ailus Cc: Daniel Scally , 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 Subject: Re: [PATCH v2 05/12] software_node: unregister software_nodes in reverse order Message-ID: <20201221112644.GJ4077@smile.fi.intel.com> References: <20201217234337.1983732-1-djrscally@gmail.com> <20201217234337.1983732-6-djrscally@gmail.com> <20201221092116.GG26370@paasikivi.fi.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201221092116.GG26370@paasikivi.fi.intel.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. > > + i++; > > + > > + while (i--) > > software_node_unregister(node_group[i]); > > } -- With Best Regards, Andy Shevchenko