All of lore.kernel.org
 help / color / mirror / Atom feed
From: broonie@opensource.wolfsonmicro.com (Mark Brown)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/4] drivers: create a pinmux subsystem
Date: Tue, 10 May 2011 23:40:45 +0100	[thread overview]
Message-ID: <20110510224045.GA19154@sirena.org.uk> (raw)
In-Reply-To: <BANLkTi=XSevO72NqCYOYuketjE8XjeQU+A@mail.gmail.com>

On Wed, May 11, 2011 at 12:18:00AM +0200, Linus Walleij wrote:

> This is the idiomatic way of providing sysfs strings (compare e.g.
> *_show() in drivers/regulator/core.c), the char *buf comes
> from the sysfs core in struct device_attribute in <linus/device.h>
> with this prototype:

>  ssize_t (*show)(struct device *dev, struct device_attribute *attr,
>                         char *buf);

> and I have no way of knowing how large that buffer is. Migrating all

It's implicitly PAGE_SIZE.  In pretty much all users the buffer is
constrained to well below that by the inputs (sometimes with some help
from users not using insanely long names for things) and the sysfs
semantics which mean you probably got something badly wrong if you get
anywhere near PAGE_SIZE.

WARNING: multiple messages have this Message-ID (diff)
From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: Joe Perches <joe@perches.com>,
	Grant Likely <grant.likely@secretlab.ca>,
	Martin Persson <martin.persson@stericsson.com>,
	Lee Jones <lee.jones@linaro.org>,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 1/4] drivers: create a pinmux subsystem
Date: Tue, 10 May 2011 23:40:45 +0100	[thread overview]
Message-ID: <20110510224045.GA19154@sirena.org.uk> (raw)
In-Reply-To: <BANLkTi=XSevO72NqCYOYuketjE8XjeQU+A@mail.gmail.com>

On Wed, May 11, 2011 at 12:18:00AM +0200, Linus Walleij wrote:

> This is the idiomatic way of providing sysfs strings (compare e.g.
> *_show() in drivers/regulator/core.c), the char *buf comes
> from the sysfs core in struct device_attribute in <linus/device.h>
> with this prototype:

>  ssize_t (*show)(struct device *dev, struct device_attribute *attr,
>                         char *buf);

> and I have no way of knowing how large that buffer is. Migrating all

It's implicitly PAGE_SIZE.  In pretty much all users the buffer is
constrained to well below that by the inputs (sometimes with some help
from users not using insanely long names for things) and the sysfs
semantics which mean you probably got something badly wrong if you get
anywhere near PAGE_SIZE.

  parent reply	other threads:[~2011-05-10 22:40 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-02 19:16 [PATCH 1/4] drivers: create a pinmux subsystem Linus Walleij
2011-05-02 19:16 ` Linus Walleij
2011-05-02 19:37 ` Joe Perches
2011-05-02 19:37   ` Joe Perches
2011-05-10 22:18   ` Linus Walleij
2011-05-10 22:18     ` Linus Walleij
2011-05-10 22:37     ` Joe Perches
2011-05-10 22:37       ` Joe Perches
2011-05-10 22:52       ` Linus Walleij
2011-05-10 22:52         ` Linus Walleij
2011-05-10 23:23         ` [PATCH] gpio: Convert gpio_is_valid to return bool Joe Perches
2011-05-10 23:42           ` Linus Walleij
2011-05-27  3:02           ` Grant Likely
2011-05-10 22:40     ` Mark Brown [this message]
2011-05-10 22:40       ` [PATCH 1/4] drivers: create a pinmux subsystem Mark Brown
     [not found] ` <1304363786-30376-1-git-send-email-linus.walleij-0IS4wlFg1OjSUeElwK9/Pw@public.gmane.org>
2011-05-02 20:52   ` Stephen Warren
2011-05-02 20:52     ` Stephen Warren
2011-05-02 20:52     ` Stephen Warren
     [not found]     ` <74CDBE0F657A3D45AFBB94109FB122FF0497F1B201-C7FfzLzN0UxDw2glCA4ptUEOCMrvLtNR@public.gmane.org>
2011-05-02 21:30       ` Colin Cross
2011-05-02 21:30         ` Colin Cross
2011-05-02 21:30         ` Colin Cross
2011-05-04  9:22         ` Tony Lindgren
2011-05-04  9:22           ` Tony Lindgren
     [not found]           ` <20110504092219.GW2092-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2011-05-07 19:06             ` Mike Rapoport
2011-05-07 19:06               ` Mike Rapoport
2011-05-07 19:06               ` Mike Rapoport
     [not found]               ` <BANLkTin9-aKZjEGdBeZqDwHwADXCYERErg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-05-09 15:25                 ` Tony Lindgren
2011-05-09 15:25                   ` Tony Lindgren
2011-05-09 15:25                   ` Tony Lindgren
2011-05-10 22:46       ` Linus Walleij
2011-05-10 22:46         ` Linus Walleij
2011-05-10 22:46         ` Linus Walleij
2011-05-03  1:45     ` Ben Nizette
2011-05-03  1:45       ` Ben Nizette
2011-05-03  1:45       ` Ben Nizette
2011-05-03  1:47 ` Ben Nizette
2011-05-03  1:47   ` Ben Nizette
2011-05-04  9:16 ` Tony Lindgren
2011-05-04  9:16   ` Tony Lindgren
2011-05-07 19:10   ` Mike Rapoport
2011-05-07 19:10     ` Mike Rapoport
2011-05-09 15:46     ` Tony Lindgren
2011-05-09 15:46       ` Tony Lindgren
2011-05-04 22:48 ` Rohit Vaswani
2011-05-05 18:16 ` Rohit Vaswani
2011-05-05 18:16   ` Rohit Vaswani
2011-05-07 20:09 ` Greg KH
2011-05-07 20:09   ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110510224045.GA19154@sirena.org.uk \
    --to=broonie@opensource.wolfsonmicro.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.