Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp3537036rwd; Sat, 3 Jun 2023 07:08:10 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7G1IF1f8S2r6rcVt+KQsZvMAb5dluQkh+0tJFYQwcZlShRfRbt2JZ7ew478eWST1NrDcEe X-Received: by 2002:a17:902:9887:b0:1a9:80a0:47ef with SMTP id s7-20020a170902988700b001a980a047efmr2195176plp.20.1685801289743; Sat, 03 Jun 2023 07:08:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685801289; cv=none; d=google.com; s=arc-20160816; b=b1y+SDAlEzagcqUB50pRP/CoP2scGC12ow4dONlJS0A50cLgqTOvBTXSYFxNanNmAX Cb2ziPSLMqPKy8rfduybpj5Ta40Hbj3TVrY+npEipz6egjPU9Jjspy+mbcxnie5LWHOF HnT+naNAYbpKXaFORLdRX05MZ/rhXqmYvkzrRkaafNHALJ7fy5pXL7j+j3kYkUKAZ2wu AD1ttbqDyKADCXaXXeJXadt2me1kTfWGXvJySzQvm1aL42+PkIx8jr17QcK4QF0LRFei UIizJIp+4DeA94ZDfgftGm+hBAsJpNSLW+hkQPFh7qqVnyTRYItEL0kYe5TTKbrmfqkw zgFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:date:from; bh=jS0GeFQHmWMlZjkwFkhhzo18rNYSB8GOYeV51VHmEwo=; b=R356Y/aM497eeXdFxGZMxR4VDK2uNWWmfTaidjrDUAk85ruJhwBSKGexUcBSNTm4Ch 6tG7YvqmCh21VDtn+2t9Ifgd65Jz064gc5eTkx5ylw4xAYEBqkoLsvzC1ZdSncil+ArC Lgkah0HPZsNjP2+ubyg4COEkbFiqGZ8ziLaIJoUmM42XGVTlsISHJQ/6T3x848Ck3PNy 86jgLReeILIIMQvMBynhpG4oGDKPZkYBusW8vFhQJYufWh7COB4PcM55x5OgC0VEfRtc TQfVtLtLoDrU5ibzmHu5wHOavW+7vTLmg36b4RHRqMyDEfi2W5NSBMneqjouWn+w58K0 adbw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 19-20020a631753000000b005304208cfe3si2647860pgx.685.2023.06.03.07.07.52; Sat, 03 Jun 2023 07:08:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229445AbjFCNqf (ORCPT + 99 others); Sat, 3 Jun 2023 09:46:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48756 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229450AbjFCNqe (ORCPT ); Sat, 3 Jun 2023 09:46:34 -0400 Received: from fgw20-7.mail.saunalahti.fi (fgw20-7.mail.saunalahti.fi [62.142.5.81]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 18436123 for ; Sat, 3 Jun 2023 06:46:31 -0700 (PDT) Received: from localhost (88-113-26-95.elisa-laajakaista.fi [88.113.26.95]) by fgw20.mail.saunalahti.fi (Halon) with ESMTP id 0a710ade-0215-11ee-b3cf-005056bd6ce9; Sat, 03 Jun 2023 16:46:29 +0300 (EEST) From: andy.shevchenko@gmail.com Date: Sat, 3 Jun 2023 16:46:28 +0300 To: Astrid Rost Cc: Jonathan Cameron , Lars-Peter Clausen , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@axis.com, Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= , Mathieu Othacehe Subject: Re: [PATCH v5 4/7] iio: light: vcnl4000: add illuminance irq vcnl4040/4200 Message-ID: References: <20230530142405.1679146-1-astrid.rost@axis.com> <20230530142405.1679146-5-astrid.rost@axis.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230530142405.1679146-5-astrid.rost@axis.com> X-Spam-Status: No, score=0.7 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, FORGED_GMAIL_RCVD,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_SOFTFAIL,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Tue, May 30, 2023 at 04:24:02PM +0200, Astrid Rost kirjoitti: > Add support to configure ambient light sensor interrupts and threshold > limits for vcnl4040 and vcnl4200. If an interrupt is detected an event > will be pushed to the event interface. ... > - int ret; > + int ret = -EINVAL; What is the purpose of this change? ... > - int ret; > + int ret = -EINVAL; Ditto. ... > int ret; > struct vcnl4000_data *data = iio_priv(indio_dev); > + switch (chan->type) { Had you run checkpatch.pl? A definition block and a code should be delimited by a blank line. ... > - int ret; > + int ret = -EINVAL; Purpose? ... > - val = state ? (ret | mask) : (ret & ~mask); > + val = state ? (ret | mask) : (ret & ~mask); I'm wondering if you can prepere the code by introducing switch-case instead of current implementation in the preparatory patch and then do what you want to do here. It will show much better the change and make review easier. -- With Best Regards, Andy Shevchenko