Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1512046

Re: [PATCH 10/15] ASoC: omap-mcbsp: use permission-specific DEVICE_ATTR variants

Path csiph.com!1.us.feeder.erje.net!feeder.erje.net!2.eu.feeder.erje.net!news.roellig-ltd.de!open-news-network.org!weretis.net!feeder4.news.weretis.net!news.unit0.net!news.panservice.it!bofh.it!news.nic.it!robomod
From Jarkko Nikula <jarkko.nikula@bitmer.com>
Newsgroups linux.kernel
Subject Re: [PATCH 10/15] ASoC: omap-mcbsp: use permission-specific DEVICE_ATTR variants
Date Sun, 30 Oct 2016 12:40:02 +0100
Message-ID <sxWD0-42a-3@gated-at.bofh.it> (permalink)
References <sxHXj-2qm-3@gated-at.bofh.it> <sxHXj-2qm-7@gated-at.bofh.it>
X-Original-To Julia Lawall <Julia.Lawall@lip6.fr>
X-Greylist delayed 1785 seconds by postgrey-1.27 at vger.kernel.org; Sun, 30 Oct 2016 07:28:58 EDT
X-Mailer Sylpheed 3.5.0beta1 (GTK+ 2.24.25; i586-pc-linux-gnu)
MIME-Version 1.0
Content-Type text/plain; charset=US-ASCII
Content-Transfer-Encoding 7bit
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 18
Organization linux.* mail to news gateway
X-Original-Cc Peter Ujfalusi <peter.ujfalusi@ti.com>, kernel-janitors@vger.kernel.org, Liam Girdwood <lgirdwood@gmail.com>, Mark Brown <broonie@kernel.org>, Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>, alsa-devel@alsa-project.org, linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org
X-Original-Date Sun, 30 Oct 2016 12:58:51 +0200
X-Original-Message-ID <20161030125851.bd0e74854c52ce7d4ab3570c@bitmer.com>
X-Original-References <1477769829-22230-1-git-send-email-Julia.Lawall@lip6.fr> <1477769829-22230-11-git-send-email-Julia.Lawall@lip6.fr>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1512046

Show key headers only | View raw


Hi

On Sat, 29 Oct 2016 21:37:04 +0200
Julia Lawall <Julia.Lawall@lip6.fr> 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.

-- 
Jarkko

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 10/15] ASoC: omap-mcbsp: use permission-specific DEVICE_ATTR variants Julia Lawall <Julia.Lawall@lip6.fr> - 2016-10-29 22:00 +0200
  Re: [PATCH 10/15] ASoC: omap-mcbsp: use permission-specific  DEVICE_ATTR variants Jarkko Nikula <jarkko.nikula@bitmer.com> - 2016-10-30 12:40 +0100
    Re: [PATCH 10/15] ASoC: omap-mcbsp: use permission-specific DEVICE_ATTR  variants Julia Lawall <julia.lawall@lip6.fr> - 2016-10-30 13:00 +0100

csiph-web