From: Liviu Dudau Date: Wed, 19 Sep 2018 17:37:22 +0100 Subject: [U-Boot] [PATCH] uclass: Use uclass_foreach_dev() macro instead of open coding In-Reply-To: References: <20180917164404.27530-1-Liviu.Dudau@foss.arm.com> <20180918080833.GA8027@e110455-lin.cambridge.arm.com> Message-ID: <20180919163722.GD8027@e110455-lin.cambridge.arm.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit To: u-boot@lists.denx.de On Wed, Sep 19, 2018 at 09:30:37AM -0600, Simon Glass wrote: > Hi, > > On 18 September 2018 at 02:08, Liviu Dudau wrote: > > > > On Tue, Sep 18, 2018 at 04:06:13AM +0200, Simon Glass wrote: > > > On 17 September 2018 at 10:44, Liviu Dudau wrote: > > > > Use the uclass_foreach_dev() macro instead of the open coded version. > > > > > > > > Signed-off-by: Liviu Dudau > > > > --- > > > > drivers/core/uclass.c | 2 +- > > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > Reviewed-by: Simon Glass > > > > > > Perhaps you could also convert a few usages? > > > > Not sure what you mean. Are you suggesting that I should convert more of > > the code that uses the open coded version into uclass_foreach_dev() ? > > Yes. After all, at present your macro is just dead code :-) I think there is some confusion here. I didn't write the macro, it is present in include/dm/uclass.h since you have introduced it in commit 6494d708bfc630ac0 ("dm: Add base driver model support"). All I have done was to notice that in uclass.c the list_for_each_entry() line can be replaced by the macro with the same effect. I also didn't get what you meant by "your macro is just dead code". Best regards, Liviu > > Regards, > Simon -- ==================== | I would like to | | fix the world, | | but they're not | | giving me the | \ source code! / --------------- ¯\_(ツ)_/¯