Received: by 10.223.185.116 with SMTP id b49csp823426wrg; Sat, 3 Mar 2018 08:16:21 -0800 (PST) X-Google-Smtp-Source: AG47ELsYNd2g0FeYOJeMfgRxQI+NS2Co9MvbmEd/RY3SHTNuNG61fr+mP1U3qJeWjreYGroSartp X-Received: by 10.98.73.89 with SMTP id w86mr9435612pfa.227.1520093781365; Sat, 03 Mar 2018 08:16:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520093781; cv=none; d=google.com; s=arc-20160816; b=i0p0h5kClEzAqb3+MbCxKvDKRB7Jp4v5gMKlim6djokZzQUAqumHBxqrh2lrIZqi85 MLSZ8xG1MaReRm1/B+Vbenz0xLdj9qYVJnqFzETIeqhi4oSrNiq+WXSmV8kROlf6Bdsg UZFknPRh+SzbENfSYRA3eU3gNwmaJlGNpL159hcgLnn3VL82pHGStfGiYKPv/Zud44yl eaBmwhizTi+94O1a+UaXY7Q0DdcHNkTd6Grv2ULci3e3ZfGzKc852hVFmNH786fuVYm1 d8ZuSDuIclew2dmaWCwb9ata0jUhfuJJ4EkEpO1g4mOHRQ6cb6zeO09MluBiHir0gC/D P7Eg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dmarc-filter:arc-authentication-results; bh=600jIVDcGRA2NmDzFZAx+FJokynTLBgS3ZvLdLRyKIQ=; b=YDF1MzXbOsQelI9YReFAMmh4K9fJt9OISGlny0gYICRxAv4wEcipGx5NjjaMAPVzHd N+mpWhj+BvAiBGX0A5YhHSoP1vm/EIgOyQlj3sfHR1Hqg8R2I2wFznqa4ZGKv95jltlF fKoQLV9eZehr/7uXbfv5E9smUc/PwurOwpKTo0NXx/sdckCTYfPM2vhE1uKNrA1LjTDr DD5rhWppehzf1MBWSc3nnDJTZ6/1jQ08QUqBxwK9SnKWpIMZRRn7uZRvnPhuOSzefb9i 1QTj2gOiio2asaecHYUjYK7qdBk8M3qcXyNuLnQ0RQxMTySRuj76Jt29b6HaB3voqT9N 6k3w== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q18si7007307pfi.105.2018.03.03.08.16.07; Sat, 03 Mar 2018 08:16:21 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752208AbeCCQPO (ORCPT + 99 others); Sat, 3 Mar 2018 11:15:14 -0500 Received: from mail.kernel.org ([198.145.29.99]:53886 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751898AbeCCQPM (ORCPT ); Sat, 3 Mar 2018 11:15:12 -0500 Received: from archlinux (cpc91196-cmbg18-2-0-cust659.5-4.cable.virginm.net [81.96.234.148]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E2C382178D; Sat, 3 Mar 2018 16:15:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E2C382178D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=jic23@kernel.org Date: Sat, 3 Mar 2018 16:15:07 +0000 From: Jonathan Cameron To: Andy Shevchenko 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 Subject: Re: [PATCH v3 1/2] iio: light: add driver for bh1730fvc chips Message-ID: <20180303161507.2f60345f@archlinux> In-Reply-To: References: <20180228001525.96044-1-delroth@google.com> <20180303153723.40773aae@archlinux> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 3 Mar 2018 17:44:44 +0200 Andy Shevchenko wrote: > 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. Absolutely. > > >> > + 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. Given it's specifically indexing over an enum (which can have any definition it likes) I wouldn't normally care, but fair enough. > > 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. Agreed. > > >> int ret; >