Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753392AbeAFOR6 (ORCPT + 1 other); Sat, 6 Jan 2018 09:17:58 -0500 Received: from mail.kernel.org ([198.145.29.99]:33146 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753145AbeAFOR4 (ORCPT ); Sat, 6 Jan 2018 09:17:56 -0500 DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E2BC520685 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, 6 Jan 2018 14:17:52 +0000 From: Jonathan Cameron To: Julia Lawall Cc: Lars-Peter Clausen , Aishwarya Pant , Hartmut Knaack , Peter Meerwald-Stadler , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Joe Perches Subject: Re: [PATCH 1/5] iio: buffer: use permission specific variants of DEVICE_ATTR Message-ID: <20180106141752.7d4e5c93@archlinux> In-Reply-To: References: <20180106123521.3bacb64b@archlinux> X-Mailer: Claws Mail 3.15.1-dirty (GTK+ 2.24.31; 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 List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On Sat, 6 Jan 2018 14:18:58 +0100 (CET) Julia Lawall wrote: > On Sat, 6 Jan 2018, Lars-Peter Clausen wrote: > > > On 01/06/2018 01:35 PM, Jonathan Cameron wrote: > > > On Thu, 4 Jan 2018 20:07:14 +0530 > > > Aishwarya Pant wrote: > > > > > >> This is a clean-up patch which replaces DEVICE_ATTR macro with the file > > >> permission specific DEVICE_ATTR_{RO/WO/RW} macros for compaction and > > >> readability. Done using coccinelle. > > > > > > Hmm. I'll be honest, I personally really dislike these macros. > > > They absolutely don't help with readability because they obscure > > > the connection between the attributes being created and their callbacks. > > > Short is not the same as more readable. > > > > FWIW fully agreed. > > Could there be variants that keep the function names as arguments, but > keep the benefit of the simpler permission specification and ensuring that > the right functions are provided for the given permissions? Yes, that would bring the benefits without the readability cost. No one needs to know that RW means some octal number after all. Jonathan > > julia > -- > To unsubscribe from this list: send the line "unsubscribe linux-iio" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html