mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Cornelia Huck <cornelia.huck@de.ibm.com>
To: Pavel Emelyanov <xemul@openvz.org>
Cc: Kay Sievers <kay.sievers@vrfy.org>, Greg KH <gregkh@suse.de>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@osdl.org>,
	devel@openvz.org
Subject: Re: [PATCH] Fix OOPS in show_uevent()
Date: Fri, 10 Aug 2007 15:37:28 +0200	[thread overview]
Message-ID: <20070810153728.7cf99fc1@gondolin.boeblingen.de.ibm.com> (raw)
In-Reply-To: <46BC666F.6010409@openvz.org>

On Fri, 10 Aug 2007 17:21:51 +0400,
Pavel Emelyanov <xemul@openvz.org> wrote:

> Cornelia Huck wrote:
> > On Fri, 10 Aug 2007 14:23:56 +0200,
> > "Kay Sievers" <kay.sievers@vrfy.org> wrote:
> > 
> >> But we still don't update the remaining buffer size and the remaining
> >> array fields which are left after the call. Shouldn't we instead just
> >> change the:
> >>    int (*dev_uevent)(struct device *dev,
> >>                                 char **envp, int num_envp,
> >>                                 char *buffer, int buffer_size);
> >> to:
> >>   int (*dev_uevent)(struct device *dev,
> >>                                char **envp, int num_envp, int *cur_index,
> >>                                char *buffer, int buffer_size, int *cur_len);
> >>
> >> like we do for:
> >>   int add_uevent_var(char **envp, int num_envp, int *cur_index,
> >>                                   char *buffer, int buffer_size, int *cur_len,
> >>                                   const char *format, ...)
> >>
> >> and along with the change of the callers, we would update the values
> >> properly, so the next call has the correct numbers? There are 6
> >> classes and something like 12 buses using this method, so it shouldn't
> >> be too much trouble.
> 
> isn't it better to change
>     int (*dev_uevent)(struct device *dev,
>                                  char **envp, int num_envp,
>                                  char *buffer, int buffer_size);
> to
>     int (*dev_uevent)(struct device *dev,
>                                  char **envp, int num_envp,
>                                  char **buffer);
> and alter the buffer pointer inside?

But the function wants to know the buffer_size, doesn't it?
(And the caller can make the adjustments easily; it saves duplicated
code.)

      reply	other threads:[~2007-08-10 13:36 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-10 10:13 Pavel Emelyanov
2007-08-10 12:09 ` Cornelia Huck
2007-08-10 12:23 ` Kay Sievers
2007-08-10 12:39   ` Cornelia Huck
2007-08-10 13:21     ` Pavel Emelyanov
2007-08-10 13:37       ` Cornelia Huck [this message]

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=20070810153728.7cf99fc1@gondolin.boeblingen.de.ibm.com \
    --to=cornelia.huck@de.ibm.com \
    --cc=akpm@osdl.org \
    --cc=devel@openvz.org \
    --cc=gregkh@suse.de \
    --cc=kay.sievers@vrfy.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=xemul@openvz.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®