Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755630AbcJ3LuT (ORCPT ); Sun, 30 Oct 2016 07:50:19 -0400 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]:25550 "EHLO mail3-relais-sop.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753071AbcJ3LuS (ORCPT ); Sun, 30 Oct 2016 07:50:18 -0400 X-IronPort-AV: E=Sophos;i="5.31,569,1473112800"; d="scan'208";a="198648820" Date: Sun, 30 Oct 2016 12:50:12 +0100 (CET) From: Julia Lawall X-X-Sender: jll@hadrien To: Jarkko Nikula cc: Peter Ujfalusi , kernel-janitors@vger.kernel.org, Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , alsa-devel@alsa-project.org, linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 10/15] ASoC: omap-mcbsp: use permission-specific DEVICE_ATTR variants In-Reply-To: <20161030125851.bd0e74854c52ce7d4ab3570c@bitmer.com> Message-ID: References: <1477769829-22230-1-git-send-email-Julia.Lawall@lip6.fr> <1477769829-22230-11-git-send-email-Julia.Lawall@lip6.fr> <20161030125851.bd0e74854c52ce7d4ab3570c@bitmer.com> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 929 Lines: 29 On Sun, 30 Oct 2016, Jarkko Nikula wrote: > Hi > > On Sat, 29 Oct 2016 21:37:04 +0200 > Julia Lawall wrote: > > > Use DEVICE_ATTR_RW for read-write attributes. This simplifies the > > source code, improves readbility, and reduces the chance of > > inconsistencies. > > > ... > > > > - DEVICE_ATTR(x, \(0644\|S_IRUGO|S_IWUSR\), x_show, x_store); > > + DEVICE_ATTR_RW(x); > > I'm not so sure does this improve readability. 644 is pretty obvious but > for DEVICE_ATTR_RW() one has to dive into include/linux/device.h and > include/linux/sysfs.h to see for what users it grants the write access. OK, as you like. It does help ensure that the functions that are supposed to be defined are available. There were a couple of occurrences of 0644 with no show or no store function. Among the three declarers, there are currently in total over 800 uses in the kernel, so they are also not so obscure. julia