From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752354AbcBJPKt (ORCPT ); Wed, 10 Feb 2016 10:10:49 -0500 Received: from mx2.suse.de ([195.135.220.15]:50292 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751310AbcBJPKr (ORCPT ); Wed, 10 Feb 2016 10:10:47 -0500 Message-ID: <1455116893.8878.15.camel@suse.de> Subject: Re: [PATCH 2/3] usb: type-c: USB Type-C Connector System Software Interface From: Oliver Neukum To: Andy Shevchenko Cc: Felipe Balbi , Heikki Krogerus , Mathias Nyman , Greg KH , "linux-kernel@vger.kernel.org" , USB Date: Wed, 10 Feb 2016 16:08:13 +0100 In-Reply-To: References: <1455037283-106479-1-git-send-email-heikki.krogerus@linux.intel.com> <1455037283-106479-3-git-send-email-heikki.krogerus@linux.intel.com> <1455113742.8878.14.camel@suse.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.12.11 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2016-02-10 at 16:24 +0200, Andy Shevchenko wrote: > On Wed, Feb 10, 2016 at 4:15 PM, Oliver Neukum wrote: > > On Wed, 2016-02-10 at 13:56 +0200, Andy Shevchenko wrote: > >> > +err: > >> > + if (i > 0) > >> > + for (; i >= 0; i--, con--) > >> > + typec_unregister_port(con->port); > >> > >> Perhaps > >> > >> while (--i >= 0) { > >> ... > >> } > > > > While we are at it. No we should not change the semantics > > of conditionals for the sake of appearance. > > I'm sorry I didn't get you. > How this more or less standard pattern to clean up stuff on error path > does with conditional semantics? You change a postdecrement to a predecrement. The highest number the loop is executed for is changed. Oliver