From mboxrd@z Thu Jan 1 00:00:00 1970 From: sjg at google.com Date: Thu, 18 May 2017 09:01:33 -0700 Subject: [U-Boot] [PATCH 3/8] dm: blk: Add a function to find the next block device number In-Reply-To: References: <20170424020211.20690-1-sjg@chromium.org> <20170424020211.20690-4-sjg@chromium.org> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Wed, May 3, 2017 at 5:36 AM, Simon Glass wrote: > Hi Andy, > > On 24 April 2017 at 02:04, Andy Shevchenko wrote: >> On Mon, Apr 24, 2017 at 5:02 AM, Simon Glass wrote: >>> At present this code is inline. Move it into a function to allow it to >>> be used elsewhere. >>> >>> Signed-off-by: Simon Glass >> >>> +static int blk_next_free_devnum(enum if_type if_type) >>> +{ >>> + int ret; >>> + >>> + ret = blk_find_max_devnum(if_type); >>> + if (ret == -ENODEV) >>> + return 0; >> >>> + else if (ret < 0) >> >> Useless 'else'. >> >>> + return ret; >>> + else >> >> Ditto. >> >>> + return ret + 1; >>> +} > > I think it is clearer with these. At least, I would ask for them to be > added if they were missing. Really? It's just noise in the code which makes it harder to read. In Linux kernel we remove that. If U-Boot has the above style kinda mandatory I would be really surprised. > What do you think of this series as a whole? It was a while ago. So, if there were no comments from me, that means I have nothing to argue of. -- With Best Regards, Andy Shevchenko Applied to u-boot-dm