From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752532AbcKSGlS (ORCPT ); Sat, 19 Nov 2016 01:41:18 -0500 Received: from mail-qk0-f193.google.com ([209.85.220.193]:33349 "EHLO mail-qk0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750982AbcKSGlQ (ORCPT ); Sat, 19 Nov 2016 01:41:16 -0500 Date: Sat, 19 Nov 2016 09:41:12 +0300 From: Eugene Korenevsky To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org Subject: Re: [PATCH v5] USB hub_probe: rework ugly goto-into-compound-statement Message-ID: <20161119064112.GA4582@vnote> Mail-Followup-To: Eugene Korenevsky , Greg Kroah-Hartman , linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org References: <20161113125358.GA12417@vnote> <20161114065054.GB29356@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161114065054.GB29356@kroah.com> User-Agent: Mutt/1.7.1 (2016-10-04) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > Ok, I'm going to be really pedantic here and ask that you spell this > last statement out: > if (usb...) > return true; > return false; > > Also, the comment should say: > /* If the first endpoint is not interrupt IN, we... */ > It's better to inverse the condition and return false: ``` if (!usb...) return false; return true; ``` This is exactly what is said in the comment ("If the first endpoint... we'd better punt!"). And does not break the composition of the entire function (all `if` bodies return false, last statement is `return true`). -- Eugene