From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753212AbbARLq7 (ORCPT ); Sun, 18 Jan 2015 06:46:59 -0500 Received: from mail-gw3-out.broadcom.com ([216.31.210.64]:57864 "EHLO mail-gw3-out.broadcom.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751441AbbARLq5 (ORCPT ); Sun, 18 Jan 2015 06:46:57 -0500 X-IronPort-AV: E=Sophos;i="5.09,420,1418112000"; d="scan'208";a="54915944" Message-ID: <54BB9D2B.20408@broadcom.com> Date: Sun, 18 Jan 2015 12:46:51 +0100 From: Arend van Spriel User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.9.2.24) Gecko/20111103 Lightning/1.0b2 Thunderbird/3.1.16 MIME-Version: 1.0 To: =?ISO-8859-1?Q?Uwe_Kleine-K=F6nig?= CC: Wolfram Sang , Ray Jui , "Mark Rutland" , , "Christian Daudt" , Russell King , "Scott Branden" , Pawel Moll , "Ian Campbell" , Florian Fainelli , Matt Porter , , Rob Herring , , , "Grant Likely" , Kumar Gala , Subject: Re: [PATCH v5 2/3] i2c: iproc: Add Broadcom iProc I2C Driver References: <1421451737-7107-1-git-send-email-rjui@broadcom.com> <1421451737-7107-3-git-send-email-rjui@broadcom.com> <54BB795C.6040402@broadcom.com> <20150118094741.GE22880@pengutronix.de> <20150118110658.GA1113@katana> <20150118111759.GG22880@pengutronix.de> In-Reply-To: <20150118111759.GG22880@pengutronix.de> Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/18/15 12:17, Uwe Kleine-König wrote: > Hello Wolfram, > > On Sun, Jan 18, 2015 at 12:06:58PM +0100, Wolfram Sang wrote: >> On Sun, Jan 18, 2015 at 10:47:41AM +0100, Uwe Kleine-König wrote: >>> On Sun, Jan 18, 2015 at 10:14:04AM +0100, Arend van Spriel wrote: >>>> On 01/17/15 00:42, Ray Jui wrote: >>>>> + complete_all(&iproc_i2c->done); >>>> >>>> Looking over this code it seems to me there is always a single >>>> process waiting for iproc_i2c->done to complete. So using complete() >>>> here would suffice. >>> Yeah, there is always only a single thread waiting. That means both >>> complete and complete_all are suitable. AFAIK there is no reason to pick >>> one over the other in this case. >> >> Clarity? > And which do you consider more clear? complete_all might result in the > question: "Is there>1 waiter?" and complete might yield to "What about > the other waiters?". If you already know there is only one, both are on > par on clarity. Might only be me?! I don't care much. Maybe it is me, but it is not about questions but it is about implicit statements that the code makes (or reader derives from it). When using complete_all you indicate to the reader "there can be more than one waiter". When using complete it indicates "there is only one waiter". If those statements are not true that is a code issue/bug. Regards, Arend > Best regards > Uwe > From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arend van Spriel Subject: Re: [PATCH v5 2/3] i2c: iproc: Add Broadcom iProc I2C Driver Date: Sun, 18 Jan 2015 12:46:51 +0100 Message-ID: <54BB9D2B.20408@broadcom.com> References: <1421451737-7107-1-git-send-email-rjui@broadcom.com> <1421451737-7107-3-git-send-email-rjui@broadcom.com> <54BB795C.6040402@broadcom.com> <20150118094741.GE22880@pengutronix.de> <20150118110658.GA1113@katana> <20150118111759.GG22880@pengutronix.de> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: In-Reply-To: <20150118111759.GG22880@pengutronix.de> Sender: linux-kernel-owner@vger.kernel.org To: =?ISO-8859-1?Q?Uwe_Kleine-K=F6nig?= Cc: Wolfram Sang , Ray Jui , Mark Rutland , devicetree@vger.kernel.org, Christian Daudt , Russell King , Scott Branden , Pawel Moll , Ian Campbell , Florian Fainelli , Matt Porter , linux-kernel@vger.kernel.org, Rob Herring , bcm-kernel-feedback-list@broadcom.com, linux-i2c@vger.kernel.org, Grant Likely , Kumar Gala , linux-arm-kernel@lists.infradead.org List-Id: devicetree@vger.kernel.org On 01/18/15 12:17, Uwe Kleine-K=F6nig wrote: > Hello Wolfram, > > On Sun, Jan 18, 2015 at 12:06:58PM +0100, Wolfram Sang wrote: >> On Sun, Jan 18, 2015 at 10:47:41AM +0100, Uwe Kleine-K=F6nig wrote: >>> On Sun, Jan 18, 2015 at 10:14:04AM +0100, Arend van Spriel wrote: >>>> On 01/17/15 00:42, Ray Jui wrote: >>>>> + complete_all(&iproc_i2c->done); >>>> >>>> Looking over this code it seems to me there is always a single >>>> process waiting for iproc_i2c->done to complete. So using complete= () >>>> here would suffice. >>> Yeah, there is always only a single thread waiting. That means both >>> complete and complete_all are suitable. AFAIK there is no reason to= pick >>> one over the other in this case. >> >> Clarity? > And which do you consider more clear? complete_all might result in th= e > question: "Is there>1 waiter?" and complete might yield to "What abou= t > the other waiters?". If you already know there is only one, both are = on > par on clarity. Might only be me?! I don't care much. Maybe it is me, but it is not about questions but it is about implicit=20 statements that the code makes (or reader derives from it). When using=20 complete_all you indicate to the reader "there can be more than one=20 waiter". When using complete it indicates "there is only one waiter". I= f=20 those statements are not true that is a code issue/bug. Regards, Arend > Best regards > Uwe > From mboxrd@z Thu Jan 1 00:00:00 1970 From: arend@broadcom.com (Arend van Spriel) Date: Sun, 18 Jan 2015 12:46:51 +0100 Subject: [PATCH v5 2/3] i2c: iproc: Add Broadcom iProc I2C Driver In-Reply-To: <20150118111759.GG22880@pengutronix.de> References: <1421451737-7107-1-git-send-email-rjui@broadcom.com> <1421451737-7107-3-git-send-email-rjui@broadcom.com> <54BB795C.6040402@broadcom.com> <20150118094741.GE22880@pengutronix.de> <20150118110658.GA1113@katana> <20150118111759.GG22880@pengutronix.de> Message-ID: <54BB9D2B.20408@broadcom.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On 01/18/15 12:17, Uwe Kleine-K?nig wrote: > Hello Wolfram, > > On Sun, Jan 18, 2015 at 12:06:58PM +0100, Wolfram Sang wrote: >> On Sun, Jan 18, 2015 at 10:47:41AM +0100, Uwe Kleine-K?nig wrote: >>> On Sun, Jan 18, 2015 at 10:14:04AM +0100, Arend van Spriel wrote: >>>> On 01/17/15 00:42, Ray Jui wrote: >>>>> + complete_all(&iproc_i2c->done); >>>> >>>> Looking over this code it seems to me there is always a single >>>> process waiting for iproc_i2c->done to complete. So using complete() >>>> here would suffice. >>> Yeah, there is always only a single thread waiting. That means both >>> complete and complete_all are suitable. AFAIK there is no reason to pick >>> one over the other in this case. >> >> Clarity? > And which do you consider more clear? complete_all might result in the > question: "Is there>1 waiter?" and complete might yield to "What about > the other waiters?". If you already know there is only one, both are on > par on clarity. Might only be me?! I don't care much. Maybe it is me, but it is not about questions but it is about implicit statements that the code makes (or reader derives from it). When using complete_all you indicate to the reader "there can be more than one waiter". When using complete it indicates "there is only one waiter". If those statements are not true that is a code issue/bug. Regards, Arend > Best regards > Uwe >