From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932434AbdJZOuR (ORCPT ); Thu, 26 Oct 2017 10:50:17 -0400 Received: from mail.free-electrons.com ([62.4.15.54]:59634 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932246AbdJZOuN (ORCPT ); Thu, 26 Oct 2017 10:50:13 -0400 Date: Thu, 26 Oct 2017 16:50:12 +0200 From: Alexandre Belloni To: Dan Carpenter Cc: SF Markus Elfring , linux-iio@vger.kernel.org, Andreas Dannenberg , Felipe Balbi , Hartmut Knaack , Javier Martinez Canillas , Jonathan Cameron , Lars-Peter Clausen , Peter Meerwald-Stadler , LKML , kernel-janitors@vger.kernel.org Subject: Re: [PATCH] iio/light/opt3001: Use common error handling code in opt3001_get_lux() Message-ID: <20171026145012.vnev4ivbxdk3ak5e@piout.net> References: <20171026134852.bprrrv3htfyryyy4@piout.net> <20171026140743.wfstmoy3lbolm7xv@mwanda> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171026140743.wfstmoy3lbolm7xv@mwanda> User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 26/10/2017 at 17:07:43 +0300, Dan Carpenter wrote: > On Thu, Oct 26, 2017 at 03:48:52PM +0200, Alexandre Belloni wrote: > > On 26/10/2017 at 14:17:30 +0200, SF Markus Elfring wrote: > > > From: Markus Elfring > > > Date: Thu, 26 Oct 2017 14:06:49 +0200 > > > > > > * Add jump targets so that two error messages are stored only once > > > at the end of this function implementation. > > > > > > * Adjust condition checks. > > > > > > * Replace string literals by references to two global constant variables > > > in eight functions. > > > > > > This issue was detected by using the Coccinelle software. > > > > > > Signed-off-by: Markus Elfring > > > --- > > > drivers/iio/light/opt3001.c | 88 +++++++++++++++++++-------------------------- > > > 1 file changed, 36 insertions(+), 52 deletions(-) > > > > > > diff --git a/drivers/iio/light/opt3001.c b/drivers/iio/light/opt3001.c > > > index 54d88b60e303..23d7d4e6ae61 100644 > > > --- a/drivers/iio/light/opt3001.c > > > +++ b/drivers/iio/light/opt3001.c > > > @@ -77,6 +77,9 @@ > > > #define OPT3001_RESULT_READY_SHORT 150 > > > #define OPT3001_RESULT_READY_LONG 1000 > > > > > > +static char const read_failure[] = "failed to read register %02x\n"; > > > +static char const write_failure[] = "failed to write register %02x\n"; > > > + > > > > If you are going to do that > > The answer to that question is we're not going to do that... Please > stop taking bad ideas and making them even more complicated and worse. > I just wanted to know how far he was able to push his reasoning. And hopefully waste a bit of his time. I don't expect anyone to take patches from Markus seriously. -- Alexandre Belloni, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexandre Belloni Date: Thu, 26 Oct 2017 14:50:12 +0000 Subject: Re: [PATCH] iio/light/opt3001: Use common error handling code in opt3001_get_lux() Message-Id: <20171026145012.vnev4ivbxdk3ak5e@piout.net> List-Id: References: <20171026134852.bprrrv3htfyryyy4@piout.net> <20171026140743.wfstmoy3lbolm7xv@mwanda> In-Reply-To: <20171026140743.wfstmoy3lbolm7xv@mwanda> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Dan Carpenter Cc: SF Markus Elfring , linux-iio@vger.kernel.org, Andreas Dannenberg , Felipe Balbi , Hartmut Knaack , Javier Martinez Canillas , Jonathan Cameron , Lars-Peter Clausen , Peter Meerwald-Stadler , LKML , kernel-janitors@vger.kernel.org On 26/10/2017 at 17:07:43 +0300, Dan Carpenter wrote: > On Thu, Oct 26, 2017 at 03:48:52PM +0200, Alexandre Belloni wrote: > > On 26/10/2017 at 14:17:30 +0200, SF Markus Elfring wrote: > > > From: Markus Elfring > > > Date: Thu, 26 Oct 2017 14:06:49 +0200 > > > > > > * Add jump targets so that two error messages are stored only once > > > at the end of this function implementation. > > > > > > * Adjust condition checks. > > > > > > * Replace string literals by references to two global constant variables > > > in eight functions. > > > > > > This issue was detected by using the Coccinelle software. > > > > > > Signed-off-by: Markus Elfring > > > --- > > > drivers/iio/light/opt3001.c | 88 +++++++++++++++++++-------------------------- > > > 1 file changed, 36 insertions(+), 52 deletions(-) > > > > > > diff --git a/drivers/iio/light/opt3001.c b/drivers/iio/light/opt3001.c > > > index 54d88b60e303..23d7d4e6ae61 100644 > > > --- a/drivers/iio/light/opt3001.c > > > +++ b/drivers/iio/light/opt3001.c > > > @@ -77,6 +77,9 @@ > > > #define OPT3001_RESULT_READY_SHORT 150 > > > #define OPT3001_RESULT_READY_LONG 1000 > > > > > > +static char const read_failure[] = "failed to read register %02x\n"; > > > +static char const write_failure[] = "failed to write register %02x\n"; > > > + > > > > If you are going to do that > > The answer to that question is we're not going to do that... Please > stop taking bad ideas and making them even more complicated and worse. > I just wanted to know how far he was able to push his reasoning. And hopefully waste a bit of his time. I don't expect anyone to take patches from Markus seriously. -- Alexandre Belloni, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com