public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jean Tourrilhes <jt@bougret.hpl.hp.com>
To: Jeff Garzik <jgarzik@mandrakesoft.com>
Cc: Linux kernel mailing list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2.5.3] wavelan_cs.c : new WE api
Date: Mon, 4 Feb 2002 19:11:52 -0800	[thread overview]
Message-ID: <20020204191152.B7010@bougret.hpl.hp.com> (raw)
In-Reply-To: <20020204110138.B6533@bougret.hpl.hp.com> <3C5F4522.8D4D74A6@mandrakesoft.com>
In-Reply-To: <3C5F4522.8D4D74A6@mandrakesoft.com>; from jgarzik@mandrakesoft.com on Mon, Feb 04, 2002 at 09:36:18PM -0500

On Mon, Feb 04, 2002 at 09:36:18PM -0500, Jeff Garzik wrote:
> Comments pertaining to all three of wavelan, wavelan_cs, and netwave_cs:
> * wv_splhi should really just be spin_lock_irqsave.  calling
> spin_lock_irqsave with 'flags' from another function is non-portable. 
> doing so to an inline function is just barely portable, and is
> discouraged :)

	We will have to agree to disagree. I won't oppose a patch (as
long as the driver still works after it).

> * I still see a couple save_flags/restore_flags in there...

	Of course, I haven't removed them, just moved them around.

	Old code (simplified) :
---------------------------
xxx_ioctl()
{
	save_flags();
	switch(cmd) {
		[...]
		copy_from_user(extra, ...);
		outsb(..., extra);
		[...]
	}
	restore_flags();
}
----------------------------
	Alan told me that this is a no-no.

	New code :
-----------------------
xxx_set_xxx(... , char *extra)
{
	save_flags();
	[...]
	outsb(..., extra);
	[...]
	restore_flags();
}
-----------------------
	copy_to/from_user is handled before reaching the wireless
handler. What is nice is that the new API *enforce* the proper
behaviour.

	Actually, you may want to add that to the list of cleanups for
the kernel janitors, check that all copy_to/from_user in device ioctl
functions are not done with irq disabled. Actually, I think it was
mostly in Wireless drivers...

> otherwise looks ok to me.

	Good. If I understood the new "official" procedure from Linus
himself, you are supposed to forward my patches to hin ;-)

> Jeff Garzik

	Have fun...

	Jean

      reply	other threads:[~2002-02-05  3:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-02-04 19:01 [PATCH 2.5.3] wavelan_cs.c : new WE api Jean Tourrilhes
2002-02-05  2:36 ` Jeff Garzik
2002-02-05  3:11   ` Jean Tourrilhes [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=20020204191152.B7010@bougret.hpl.hp.com \
    --to=jt@bougret.hpl.hp.com \
    --cc=jgarzik@mandrakesoft.com \
    --cc=jt@hpl.hp.com \
    --cc=linux-kernel@vger.kernel.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