Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4183363yba; Tue, 7 May 2019 13:37:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqwUxV81DqVaSIWfGgE/e2h19nyG2nYxImaKRA8mlb0Hg94ZBtDUr6ucl8XMPlNeKkb6z2h2 X-Received: by 2002:a63:c10d:: with SMTP id w13mr41618339pgf.311.1557261425471; Tue, 07 May 2019 13:37:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557261425; cv=none; d=google.com; s=arc-20160816; b=Fh+ulLayASMbZptzSDkXjIOO725IzwI7GVlY12wceetDwmp0ahSGKfvpHkjF6dxezK EkRD0iEL0P5PIu6pHybgtZa6Wz/gtnRq+XXg+rZ//ugBjlrd7X/1O3FOIG2HEze3fX+K f8EfEzfzjy3Fv074h0mwPCCU1ehECBsjPhWaKYEsGpI2zKEIo+gHe9s4FMO1Y6T7PSg2 Q3kI9YDCr7/EE7rQwK6oolGTo63E20T67IokFZqBLnWllmSIX/GEvEWq0O8S4l0oEa25 0KHHozgxN396RBn4XoBkl83div3ALYgStMB/9tUa0f/i0j7l8UZaCWxC4lcGGV6tFR1T uB6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:date:from:dkim-signature; bh=O6gYEqTbmv77FQYhVi46xNiLmwAMPiLYwUgMBGFBieA=; b=JVqCGZ7BYwFopPNcnqGZ9nO5iB3PA9aozCYiAm49XL2BtQiR/JZs0R9n4n7WxOk9Xn cANQKw6dzbWWbog4FkuaYiijwgpxfRNR5Y0X0iPqtUtEeCbuZBGLOS3uUj7TzXZt5akM hGEilIvRGkJfWzYtlss0q7TJt32ZfvnEpft7HsBZwgXbu+po3h0sq568DNTQxZplmTbm dOukrJamnRJlEQW+R/7xTj9SmbvDnzNYHxX8JiyE9IExdWX3SGjq40Jyo+0vUqXpKeIe 4iZ7GUJckl10Bcs6G6/mK8Q07JeP8/RIMJl9Uqb6oEBusiz3UvPLKCJppf8MgfmPXiiX ELug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=DP4a2KW5; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e21si19851813pgi.382.2019.05.07.13.36.49; Tue, 07 May 2019 13:37:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=DP4a2KW5; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726558AbfEGUfw (ORCPT + 99 others); Tue, 7 May 2019 16:35:52 -0400 Received: from mail-qt1-f195.google.com ([209.85.160.195]:37298 "EHLO mail-qt1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725843AbfEGUfw (ORCPT ); Tue, 7 May 2019 16:35:52 -0400 Received: by mail-qt1-f195.google.com with SMTP id o7so8734897qtp.4; Tue, 07 May 2019 13:35:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:date:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=O6gYEqTbmv77FQYhVi46xNiLmwAMPiLYwUgMBGFBieA=; b=DP4a2KW5qtKsIGNZTbytzYP7dwD1YeVKxt5nKVusb5m2B9WbYuR5Jf/HLcnroDEl3F ZDZSYuCplS0pSppqUPkpUzCv3/Y3T9WdzWUkVqjmKRy00gSOLHRjUTqlmmKPPrwndkLu ifcBifvdYmBG40jasDnyuJpDXu01VtHRtHk86MiHT9yI8jFdciqilPFn86X6QMaGz1AO AKk1rBcVS8JJ5z7/AQvUtbkChQBnSFNwnV7jzbz4ulZlNPy9bfZ7b2O8xF/e2M0ltQUt IdKjGtG154Pj1mRvnRxyFKI9bqSQp/QEs3//JYoI7aZPq0KIJqdwNa0yKJuXhBvqR6eq bKNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=O6gYEqTbmv77FQYhVi46xNiLmwAMPiLYwUgMBGFBieA=; b=T9OTGnWxgKayN61SNvKUA/YNhjw0Imjout8qJeBudCFSDpETiGTksX2ze/aGctMIYG nsUvhJhi/fBUNMyGmIFw57Mk2vGgOPbJxQdygoZOdUQpvOIKJ78eMDc/p3ei2cvTZkn5 MeLQojWoHHEyTcTZLngs7aXMnloxt0wT7aDP3y7NnRtAyN1zg6EK82PcZMtFh4kQ7m7A qSCGelONyLzHzkp5MVUrAYEXagusQNAtefobco3H00aeSztOtn0wgWaDzYmIA+BvJTpO OPzA1tt7lQL4VANtiRMKLVW19xw2SORYjlnkelYjDSbV49n9w3VPGFPLkTxTYq6DvAwg Lyxg== X-Gm-Message-State: APjAAAUSDbQYsPa74PlTE8NTf4drULHWjhjSG4WTWtTXfUs7WIR1VWAI nRPdARrzvGMyQcuQpHXRhCE= X-Received: by 2002:ac8:222f:: with SMTP id o44mr29115731qto.198.1557261351365; Tue, 07 May 2019 13:35:51 -0700 (PDT) Received: from smtp.gmail.com ([143.107.45.1]) by smtp.gmail.com with ESMTPSA id j25sm9197094qtc.24.2019.05.07.13.35.45 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 07 May 2019 13:35:49 -0700 (PDT) From: Melissa Wen X-Google-Original-From: Melissa Wen Date: Tue, 7 May 2019 17:35:43 -0300 To: Jonathan Cameron Cc: Alexandru Ardelean , Melissa Wen , Alexandru Ardelean , Lars-Peter Clausen , Michael Hennerich , Stefan Popa , Hartmut Knaack , Peter Meerwald-Stadler , Greg Kroah-Hartman , Barry Song <21cnbao@gmail.com>, linux-iio@vger.kernel.org, devel@driverdev.osuosl.org, LKML , kernel-usp@googlegroups.com Subject: Re: [PATCH 0/4] staging: iio: ad7150: improve driver readability Message-ID: <20190507203543.dpold6kx5j2pjar2@smtp.gmail.com> References: <20190505140510.62b42abe@archlinux> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190505140510.62b42abe@archlinux> User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/05, Jonathan Cameron wrote: > On Sat, 4 May 2019 14:12:22 +0300 > Alexandru Ardelean wrote: > > > On Sat, May 4, 2019 at 1:24 AM Melissa Wen wrote: > > > > > > This patchset solves readability issues in AD7150 code, such as clarify > > > register and mask definition, fashion improvement of mask uses, reduce > > > tedious operation and useless comments. > > > > > > > Hey, > > > > Two patches seem a bit noisy/un-needed. > > The other 2 are fine from me. > > > > This driver does need some work to move it out of staging. > > I am not sure what would be a big blocker for it, other than maybe it > > needs a device-tree binding doc (in YAML format). > > Maybe Jonathan remembers. > > > > Some other low-hanging-fruit ideas would be: > > 1) remove the code for platform_data ; that one seems forgotten from > > some other time; the interrupts should be coming from device-tree, > > from the i2c bindings > > 2) you could do a AD7150_EVENT_SPEC() macro (similar to > > AD7150_TIMEOUT() macro) and use it in the ad7150_events[] list; that > > would reduce a few lines > > 3) similar to 2), you could do a AD7150_CHANNEL(x) macro ; > > 4) in ad7150_event_handler() the checks could be wrapped into a macro, > > or maybe some function ; i am referring to "(int_status & > > AD7150_STATUS_OUT1) && (chip->old_state & AD7150_STATUS_OUT1)" checks > > ; those seem to be repeated > > 5) add of_match_table to the driver > > > > I (now) suspect that the reason this driver is still in staging is this comment: > > /* Timeouts not currently handled by core */ > > > > I wonder if things changed since then ? > > If not, it would be interesting to implement it in core. > Hmm. Timeouts are 'unusual' to put it lightly. > I'm thinking the ABI needs to perhaps be more specific but not sure what > a good naming is. > > Otherwise, I just took a quick look and can't see anything much else > that needs doing. Obviously something might come up in a thorough > review prior to moving it though! > > Jonathan > > > > Thanks > > Alex > > Hi Alexandru and Jonathan, Thank you for your help! Soon I will send a v2 with the fixes pointed out. I'm also including the ideas above in the work plan for this driver. P.s.: Sorry for having previously sent an email with HTML. Melissa > > > > > Melissa Wen (4): > > > staging: iio: ad7150: organize registers definition > > > staging: iio: ad7150: use FIELD_GET and GENMASK > > > staging: iio: ad7150: simplify i2c SMBus return treatment > > > staging: iio: ad7150: clean up of comments > > > > > > drivers/staging/iio/cdc/ad7150.c | 102 ++++++++++++++----------------- > > > 1 file changed, 47 insertions(+), 55 deletions(-) > > > > > > -- > > > 2.20.1 > > > >