Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp544599yba; Sat, 4 May 2019 07:44:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqxf0GDQ6iTKGsr3Qjm4p0rAaydqL1LYLxaGFkl+U9s+VLVJmbgrDgZiASyeDHXrqVdm3Fr2 X-Received: by 2002:a63:314a:: with SMTP id x71mr19016860pgx.385.1556981075405; Sat, 04 May 2019 07:44:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556981075; cv=none; d=google.com; s=arc-20160816; b=mVsNebryh5z3LwHBQr4GxOeYj7sLt7o3Nz3qoGXBhJFElgwkGkIVyyoWOun65YEkOh SI56IcaovDpzc/wen7k5ZO89jFx7APg7I49xAGg25IWyMKEubWbDXd12/U80ZlyJ/J3g 5bPi1hOCg0vwt9D10TDF585tEj4y+jRdxnovx4Q4pWPfyHk+foTZ1yMWst7vdYNdpcVC xmfEIekpOxKQzMSqhxrmbUC/I5zeWxkz5xfo1Hq8UVaw+NdwGqYN+MEvV2+i6RkLy6jP HQd+wJRaw9j24k7rM1l/perZ7Wd6axUIktWWvxyQIYqefhr9a0pJ0ho7ZX8nCg7DprmO LwDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=r9bJ5mQH0bFiSdzMFFB9aG/I/ocJ8zclWjNdxs2Hvmc=; b=qIWgrfyt1o6/OTFgj5vcYMHYvC13RvDDASZAOjbksx60J/Jg17UCAnotmCJ0/dMjp5 Y49tGVDvveCUrYkkMfvPUwEyaQZthiuQ+N3qONtjmt/T8f7jwcy5auAXHXSj0ouMOQKi 73Vz3eyMx+OMQwMY39WpBQCinuhPUbOlLf7n3+lUQO6ZJNrH8TrqlfQ36gfcWzMeSL0T mcrrAvVPPAVMPfIbOlDr+H8j7TOxmY4Mg7SNKJN67apL6+TbKFcf1jnHVun50IQFqdPo wOy2r54rTbp6xoY2v3erySa9vkAcYtpYa+tWoSPszriDBftKw8qxWhEahlZn2/jDeXqE 2VDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=F9pvV3Iw; 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 f24si6554375pgv.511.2019.05.04.07.44.20; Sat, 04 May 2019 07:44:35 -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=F9pvV3Iw; 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 S1727282AbfEDOmV (ORCPT + 99 others); Sat, 4 May 2019 10:42:21 -0400 Received: from mail-oi1-f195.google.com ([209.85.167.195]:38028 "EHLO mail-oi1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726217AbfEDOmV (ORCPT ); Sat, 4 May 2019 10:42:21 -0400 Received: by mail-oi1-f195.google.com with SMTP id t70so6583766oif.5; Sat, 04 May 2019 07:42:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=r9bJ5mQH0bFiSdzMFFB9aG/I/ocJ8zclWjNdxs2Hvmc=; b=F9pvV3Iw0ijwtXW8NVwe7iDvNNXcDLXlSYMftcFbSh3TXFVxECvo0hYJOPGNx7/eIV Mnz6OTzHh/I+2tS1nQd9nLT2+ah8qGnw15m3JeCCuLX09gU20NwjZS1zw/Ac+h4lX7Gt v5kvfKBC66bIxucRd953nF+f415VzOefkU6MM9CMItaC5QWHUvPtavkoeyMsdybKOd4N PqFCzs8yAeXgWd0ldp+H/wlaqEhe4Rp1SE2FGce7oAUVvLu34C6WtYs/+9PL+uJY53za g6hWBFiF/QHuvB90NqPEz3C51cOxd9KsL//TrCgQIxQ9h5u7ifEcEQNTGGpp4IaRRQrv hWRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=r9bJ5mQH0bFiSdzMFFB9aG/I/ocJ8zclWjNdxs2Hvmc=; b=Uj16ZYWzlqL1QXGVx/Z9y0MBLzdfTPTQ4lZXagV47jMShlRCU5fc8la17VjeNzBr78 B36UXToOxW/F/CtxrbsCF05kWO/OQviCKLOqE/ZMimyE3osAiBXQQtm4Xd7xMHv5EnBN K2jm7Qw7oGRHopGGJOaQS12/5DfQCREzdiF+WpgU6OP7Z5sf/l2KxjlMXXhJa80wKPG2 wetWr8s+g+WFbl7BkpUlFWG4vfyu5I/GpVmHyS9Pn3LSzPA+4UKlQgpVoCffkWuhAXAE Qnhwq6lep6zQe+3DkyT3cncWOVDoOY9EZipC4dTRCQ8+LoOGIzKbtlbszJicguLj6m9M CltQ== X-Gm-Message-State: APjAAAU8vfEK2wzPQND2Qx/cCxuQyLhUBWV+p6baR4BZmijWTGfav3pM m/J3qKFTMY5WHdOnPuXIV7yI6UYFUwY/4lHEwuw= X-Received: by 2002:aca:5bd7:: with SMTP id p206mr2766026oib.128.1556980940695; Sat, 04 May 2019 07:42:20 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Alexandru Ardelean Date: Sat, 4 May 2019 17:42:06 +0300 Message-ID: Subject: Re: [PATCH 0/4] staging: iio: ad7150: improve driver readability To: Melissa Wen , Alexandru Ardelean Cc: Lars-Peter Clausen , Michael Hennerich , Stefan Popa , Jonathan Cameron , 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 Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, May 4, 2019 at 2:12 PM 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. > I forgot to mention the wiki page for the driver: https://wiki.analog.com/resources/tools-software/linux-drivers/iio-cdc/ad7150 it may help with a few things > Thanks > Alex > > > > 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 > >