From: Christoph Hellwig <hch@caldera.de>
To: Jeff Garzik <jgarzik@mandrakesoft.com>
Cc: David Ford <david@linux.com>, LKML <linux-kernel@vger.kernel.org>,
nils@kernelconcepts.de
Subject: Re: OOPS loading cs46xx module, test11-pre1
Date: Thu, 9 Nov 2000 18:17:16 +0100 [thread overview]
Message-ID: <20001109181716.A25109@caldera.de> (raw)
In-Reply-To: <200011091239.NAA05580@ns.caldera.de> <3A0AD8B5.9BB73A7D@mandrakesoft.com>
In-Reply-To: <3A0AD8B5.9BB73A7D@mandrakesoft.com>; from jgarzik@mandrakesoft.com on Thu, Nov 09, 2000 at 12:02:45PM -0500
On Thu, Nov 09, 2000 at 12:02:45PM -0500, Jeff Garzik wrote:
> > I have an (untested) update for the cs46xx driver in Linux 2.4.
> > It includes Nils' 2.2 changes, use of initcalls (so compiled-in
> > should work) and use of the 2.4 PCI interface.
>
> Patch Generally looks ok. Comments:
>
> 1) This code is weird:
> > if (copy_to_user(buffer, dmabuf->rawbuf + swptr, cnt)) {
> >- if (!ret) ret = -EFAULT;
> >- return ret;
> >+ if (!ret)
> >+ ret = -EFAULT;
> >+ break;
> > }
>
> If you have an error condition (ret != 0), then you should not attempt
> the copy_to_user at all.
> If you do not have an error condition, you should unconditionally assign
> -EFAULT to 'ret'.
Makes sense. But I did not change the logic at all ...
Ask the Author (Alan or Nils) what this is about.
> 2) this patch enabled cs_mmap, and removes a check for vma->vm_offset !=
> 0. Also that is clearly 2.2.x code, simply removing the check is
> wrong. You should replace the check with one that checks vma->vm_pgoff
> != 0.
Sorry, forgot to add this back in the patch I sent.
> 3) is there method or madness to the delay changes? they are not
> explained, just changed...
Not shure. This was accepted in 2.2.18pre, so it should be sane.
> 4) cs_probe is marked __init but cs_remove is marked __devexit. on
> hotplug, cs_probe simply doesn't exist in the kernel anymore... boom.
Ok, should be fixed.
> 5) there is no need to appear zeroes to the end of these cs_pci_tbl
> entries. Just end each with "PCI_ANY_ID,"...
> + { PCI_VENDOR_ID_CIRRUS, 0x6001, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0
> },
> + { PCI_VENDOR_ID_CIRRUS, 0x6003, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0
> },
> + { PCI_VENDOR_ID_CIRRUS, 0x6004, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0
> },
That's true. But i think it looks cleaner if all members are present.
> 6) remove check for pci_present(), redundant
Lot's of pci drivers do this. Anyway I will removed this in the next version.
> 7) use pci_module_init for hotplug. quite simply:
>
> init_module() { return pci_module_init(&my_driver); }
Ok.
> of course for cs46xx, you will want to keep the version printk...
>
> 8) xxx_MODULE_NAME was a dumb and overly-lengthy creation of mine. Use
> instead MODNAME.
It doesn't really matter ...
Christoph
--
Always remember that you are unique. Just like everyone else.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/
next prev parent reply other threads:[~2000-11-09 17:17 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-11-09 1:38 OOPS loading cs46xx module, test11-pre1 David Ford
2000-11-09 12:39 ` Christoph Hellwig
2000-11-09 17:02 ` Jeff Garzik
2000-11-09 17:17 ` Christoph Hellwig [this message]
2000-11-09 17:32 ` Jeff Garzik
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=20001109181716.A25109@caldera.de \
--to=hch@caldera.de \
--cc=david@linux.com \
--cc=jgarzik@mandrakesoft.com \
--cc=linux-kernel@vger.kernel.org \
--cc=nils@kernelconcepts.de \
/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