public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Alexey Mahotkin <alexm@hsys.msk.ru>
To: Manuel Estrada Sainz <ranty@debian.org>
Cc: <linux-kernel@vger.kernel.org>
Subject: Re: request_firmware() hotplug interface, third round and a halve
Date: Sun, 18 May 2003 20:14:06 +0400	[thread overview]
Message-ID: <877k8oqlkh.fsf@192.168.10.23> (raw)


Two comments on firmware_class_hotplug(), maybe both are irrelevant.

+int firmware_class_hotplug(struct class_device *class_dev, char **envp,
+			   int num_envp, char *buffer, int buffer_size)
+{
+	struct firmware_priv *fw_priv = class_get_devdata(class_dev);
+	int i=0;
+	char *scratch=buffer;
+
+	if (buffer_size < (FIRMWARE_NAME_MAX+10))
+		return -ENOMEM;
+
+	envp [i++] = scratch;
+	scratch += sprintf(scratch, "FIRMWARE=%s", fw_priv->fw_id) + 1;
+	return 0;
+}
+

First, I do not understand how the environment is handled here.  You're
just setting first element of provided environment to "FIRMWARE=%s",
possibly overwriting the existing value.  Then why are you incrementing
`i'?  Why are you using `i' at all?  Why are you incrementing `scratch'?

Ah, it seems like you should be using num_envp somehow, and you're not.

Also, environment pointer list must be terminated with a NULL pointer. Is
it not done or is that handled somewhere else?  The machine I have 2.5.69
sources is not reachable now so I cannot check it.  Sorry if I am wrong.

--alexm

             reply	other threads:[~2003-05-18 16:01 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-18 16:14 Alexey Mahotkin [this message]
2003-05-18 18:17 ` request_firmware() hotplug interface, third round and a halve Manuel Estrada Sainz
  -- strict thread matches above, loose matches on Subject: below --
2003-05-17 22:19 Manuel Estrada Sainz
2003-05-21  7:23 ` Greg KH
2003-05-21  7:44   ` David Gibson
2003-05-21 18:36     ` Manuel Estrada Sainz
2003-05-21 18:34   ` Manuel Estrada Sainz
2003-05-21 19:03     ` 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=877k8oqlkh.fsf@192.168.10.23 \
    --to=alexm@hsys.msk.ru \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ranty@debian.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