Received: by 10.223.185.116 with SMTP id b49csp1735198wrg; Sat, 17 Feb 2018 04:17:04 -0800 (PST) X-Google-Smtp-Source: AH8x2242MSsNaaMn18p2+dtFtJrs5tu/hCyAl2MmYwq0Te9mAp1jIlnyQYTJrMJbkrYTyF6z8bgN X-Received: by 10.99.63.9 with SMTP id m9mr7868807pga.247.1518869824584; Sat, 17 Feb 2018 04:17:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518869824; cv=none; d=google.com; s=arc-20160816; b=S9y1+MryaXVq/nMSp5J4sJYg7P7y2bgOKWgWjajkHt/UwgVvep+I6fC2dD8s+tX4oG jSE6XLk0fEji5vLs2ANJHEl2Pfl4okrzgrvv+gFSnBQTi6YiOVB05iXXD5IU6VgHeUnM xYKwZbd6fSrGfxqz25Dc9WtBdfG4/BoBG2vqNeZ0wr/tAlK4PuQDmRK8ShtjShCTH0hU F8YNSbyDoVdU5JAbZ3+FDN87somAfOWHONAPil8T/aePRobG0k7+xCU5+uAhtMy/D6ox l9NR/GAZpVyotB6dWuNCt8/vTq8+7OKm8fQCCMsjQ/PgUseBqyFCklRP7kLV3psjtWT7 78hg== 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=Mrb87c0kerJVdA6kKvuP6GObRaCGjAZSOg67HPEJFjw=; b=UqmdR47ZSusDOPhEgACS/m6cfb/4diy1n4H6HrDC5WkxmiDvK9NwQBu4uDXGwS91tB v5g2NjABVYZ+gUvr9Z/XvAO9Dxdf448mtK+qoWtT8ZBwV5+dg6wOXI9VF7KvNChl20D/ c/JVW08dWKkSzHiPC7hPOXe4PJvIomOwPJtD939wxL3Khs5wUOZIPEID2qniM2Bdi6lX /9S90sTJ+fu7vwK8W7wfl9Wo3Qw801Ke1Rvgwf9bKNLr08RZwiqAwPQJflWFimljkDNn +XQTqqtlcrFqtKhkI2HFsNNe63tiYJpkVCFReSk6wRxKv1KbYDhDKPwAhhKPNHdBgja8 inEQ== 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 p18-v6si2764638plo.388.2018.02.17.04.16.49; Sat, 17 Feb 2018 04:17:04 -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 S1751048AbeBQMQK (ORCPT + 99 others); Sat, 17 Feb 2018 07:16:10 -0500 Received: from mail.kernel.org ([198.145.29.99]:45276 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750771AbeBQMQJ (ORCPT ); Sat, 17 Feb 2018 07:16:09 -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 B5FCD217C1; Sat, 17 Feb 2018 12:16:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B5FCD217C1 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, 17 Feb 2018 12:16:03 +0000 From: Jonathan Cameron To: Dan Carpenter Cc: Himanshu Jha , devel@driverdev.osuosl.org, lars@metafoo.de, Michael.Hennerich@analog.com, linux-iio@vger.kernel.org, gregkh@linuxfoundation.org, 21cnbao@gmail.com, linux-kernel@vger.kernel.org, pmeerw@pmeerw.net, knaack.h@gmx.de Subject: Re: [PATCH 2/4] staging: iio: accel: Remove unnecessary comments and add suitable suffix Message-ID: <20180217121603.1551e27b@archlinux> In-Reply-To: <20180212145731.kws25sjinzqq6ax6@mwanda> References: <1518436499-8584-1-git-send-email-himanshujha199640@gmail.com> <1518436499-8584-3-git-send-email-himanshujha199640@gmail.com> <20180212125312.cjo76spuu6agjawc@mwanda> <20180212143522.GA12142@himanshu-Vostro-3559> <20180212145731.kws25sjinzqq6ax6@mwanda> 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 Mon, 12 Feb 2018 17:57:31 +0300 Dan Carpenter wrote: > On Mon, Feb 12, 2018 at 08:05:22PM +0530, Himanshu Jha wrote: > > But these should be done when we have *more* instances. > > > > For eg: > > I added a tab space in function static int adis16201_read_raw() argument > > to match open parentheses in this patch. But I also added tabs while > > removing and adding suitable suffix to the macros. So, should it also be > > done in a separate patch ? > > If you're changing a line of code and you fix a white space issue on > that same line, then that's fine. If it's just in the same function, > then do it in a separate patch. In other words, adding tabs when you're > moving around macros is fine, but adding it to the arguments is > unrelated. > > This patch was honestly pretty tricky to review. > > Jonathan assumes reviewers have the datasheet in front of them and I > assume that that they don't. He's probably right... But especially > comments like this: Actually I don't. I like the code to be very clear without the datasheet. That is one of the reasons I always advocate making it very clear what is a register and what is a field. The _REG postfix is useful to my mind for that reason. What I really don't like is needing comments to tell you what a register is for when the name of the define should make it clear. Obviously there are sometimes places you can't do this because the meaning cannot be explained in a short enough name but they are fairly rare. I agree it is a trade off on whether the naming is sufficiently clear or not and your example of the power supply one is a classic. That register has a stupid name on the datasheet given how easy it would have been to make it clear in the name choice that it was measuring the power supply. The naming things _OUT on this datasheet is particularly nasty as it adds nothing other than confusion. However, the question arises on whether it makes sense to get rid of that in the driver and make it harder to read with the datasheet. > > *val2 = 220000; /* 1.22 mV */ > > They seem really helpful to me. This isn't about the data sheet, it is about knowledge of IIO. That one is perhaps debatable as the base units for voltage are less than ideal (I really wish I had been a stickler for SI units throughout from the first - this came about through trying to maintain compatibility with hwmon which with hind sight was a bad idea). > > regards, > dan carpenter >