Received: by 10.223.185.116 with SMTP id b49csp799154wrg; Sat, 3 Mar 2018 07:45:40 -0800 (PST) X-Google-Smtp-Source: AG47ELuMn2UxbROTK0x9Uh33uDBtZsJv7Vd8B85NtOVscyj4W8d6DmFlq7zQSNiOsqS4ao6NgL/z X-Received: by 2002:a17:902:34f:: with SMTP id 73-v6mr8113757pld.55.1520091940378; Sat, 03 Mar 2018 07:45:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520091940; cv=none; d=google.com; s=arc-20160816; b=DyXuXGGtOUCOCA/vzRmCFVp8cnAHVlUOSp2CVw7BvT1a5+dJHEvTIgX1cUKlZwBYwv Y4irYgnpD3jOJt1B5mZgUx95iUnhrqqku8lyms/v37D7m2G2wCmNuonIAaF/Z2SD67Ht uLiyf+42HA7p1bvxi373HVSOUo4xkxvfMhHrPIgo1Ug6cYcarr+9/NEWu1PbufTJYtv4 uO+gV98S9vri0GItNoXfphbThoKubqPhEAoDXH8LYNiEp6Lu8uK/xZzhfjE2nXbocHlH yTN2cxOrRE47iPWiXF8AhYc8ozTfg606BBO1GE3KfonaWtvvKDl+jmCjqOEn6GGPmqiK oOoQ== 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 :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=TBlMcLqUrK3c8PmrauaSY2gx0b9FCWJ23BI4kWTvnq4=; b=hZ6ZDWgend/5tyro4r/EPzhrYb0Dz1qR6fuWxKDLoHnLgA6/Hl77iJeIqCyAY169as TQM7mXJiedPnSRjcPAxrdN72OEevepbAs+1w1ifbvjP7Ob6ddWgaQYn5n/sF/vv5IKEi GaDOvOY/uEd7hnb65xL8NtasU+nbGZs/oMd3iT0ZeakkaWRXO9Jim9G/9hgalusN2s+B XWZeJcfUiqtVbTCE/3qaeuK+XX5juAkOA8lptzOXPZLq8NUO3bjwSRxvYAKAUMk5GxbG QlLzxrY2d9b7Kl6I7CFt1c4TPtkAb7n1ER/E8Mgu9utYpVVduvLhNa8C2E0zo6I27C4y ln8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=gAxkb3OJ; 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 d14si4430247pfk.29.2018.03.03.07.45.25; Sat, 03 Mar 2018 07:45:40 -0800 (PST) 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=gAxkb3OJ; 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 S1752151AbeCCPor (ORCPT + 99 others); Sat, 3 Mar 2018 10:44:47 -0500 Received: from mail-qk0-f196.google.com ([209.85.220.196]:38246 "EHLO mail-qk0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751953AbeCCPop (ORCPT ); Sat, 3 Mar 2018 10:44:45 -0500 Received: by mail-qk0-f196.google.com with SMTP id s198so15688574qke.5; Sat, 03 Mar 2018 07:44:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=TBlMcLqUrK3c8PmrauaSY2gx0b9FCWJ23BI4kWTvnq4=; b=gAxkb3OJ00ZaHzguRY/Wx1NyyWUS+aJzc6xfuo1yff+hXcqkY7o08azJvxJeYHA+Mg Ar7KvprnrUV4fpqVjd98b3VgiW3DktAl8s2rtiPdgtGtMI75l2poURUd/7tz8NlOiSSm 1hez+83IGkDQr+OMSHpPfUPR8YvXxh2+9gy3MlaBiRhEvEsuzuUuCxc/Y392EIG2C1Hi jtLHj9YII08GeWie5zbF7GvMQ4QXB8jwrfKSMAtX+QY02nrdk0Y3SaunjavBT09quRtm 9cDd6/Nf0eUEOXPEUASitGe5bxGTelTW3wNGyqbq630Zr6Rghv9jEefs9GVO9Xclgrm+ WO1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=TBlMcLqUrK3c8PmrauaSY2gx0b9FCWJ23BI4kWTvnq4=; b=hGaZRrWHYrH3cQafGf2i4GoCN2Yv74XhnpFYuOvoo11jSVTBqmkrHTgsXZ/holkazX VG8VanpSHnRN+2RRwUs3X+xpINn2t/IUvTV5JXfI6t1E18MOHxvzGa2nfbcY6JYHIjfn 2g0RXtENIgs8FeeCBkdhBfvJZ7G3OlXdOzjtqm4tzWATaOZAUrXFzBQdnmnUPc3bT8X/ MAVB1faWEenXFnfENmG5l6Liu4z+X7Pd2WtY1ZAHHDC8d0+pQnP/EvhOYK+krzvIYAMR hY6uu1rmsdstzUISq2S13HIVvilfKbiaRY0LNerRI3851vaqZuMVBXlLJWlcl7HYZOz0 Qigg== X-Gm-Message-State: AElRT7Hu0QgNLEHuNdBgGP4qqmkOndUqaKYnk7QW267lR+9mrN2TuU8i YneZMrtkebld0Ul3USy+Hqs6L641zM8BLRcsMo0= X-Received: by 10.55.0.203 with SMTP id t72mr6318762qkg.110.1520091884925; Sat, 03 Mar 2018 07:44:44 -0800 (PST) MIME-Version: 1.0 Received: by 10.12.195.80 with HTTP; Sat, 3 Mar 2018 07:44:44 -0800 (PST) In-Reply-To: <20180303153723.40773aae@archlinux> References: <20180228001525.96044-1-delroth@google.com> <20180303153723.40773aae@archlinux> From: Andy Shevchenko Date: Sat, 3 Mar 2018 17:44:44 +0200 Message-ID: Subject: Re: [PATCH v3 1/2] iio: light: add driver for bh1730fvc chips To: Jonathan Cameron Cc: Pierre Bourdon , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , linux-iio@vger.kernel.org, Rob Herring , Mark Rutland , devicetree , Linux Kernel Mailing List , Daniel Baluta 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, Mar 3, 2018 at 5:37 PM, Jonathan Cameron wrote: > On Wed, 28 Feb 2018 17:06:09 +0200 >> On Wed, Feb 28, 2018 at 2:15 AM, Pierre Bourdon wrote: Better to address even minors before submission. >> > + if (itime <= 0 || itime > 255) >> >> Just side note: Suprisingly how many in_range() implementations we >> have in kernel... > I guess one of those things that is so simple it's not worth having > one true in_range to rule them all ;) We have already several implementations of the macro. >> > +static int bh1730_adjust_gain(struct bh1730_data *bh1730) >> > +{ >> > + int visible, ir, highest, gain, ret, i; >> >> int visible, ir, highest, gain; >> unsigned int i; > > Is there a strong reason for this one that I'm missing? > (beyond personal taste!) First of all, I'm far from being fan of mixing int ret into other variable definitions. unsigned int i OTOH shows explicitly that we have counter which is not supposed to be negative. int i in most of the cases will work, so, it's a minor. I'm not insisting, though having counter variable on separate line is also a good thing. In general, having different things in one line is a bad idea for my opinion. >> int ret; -- With Best Regards, Andy Shevchenko